Mapper - Column Labels vs Column Names

22 views
Skip to first unread message

deadfolk

unread,
Oct 19, 2010, 11:38:53 AM10/19/10
to Lift
Hi Guys,

There was a thread a little while back where someone requested the
ability to get aliased column names in the results when using
DB.performQuery and DB.runQuery (and possibly other places I'm not
aware of). The current behaviour for these methods is to return the
real database column names.

e.g. running the query:
SELECT FirstName AS GivenName FROM accounts WHERE id = 1

returns FirstName as the colum name - but you would more likely want
GivenName.

Original thread here:
http://groups.google.com/group/liftweb/browse_thread/thread/1b82ab568d10328c/c43c585f80be38f5?lnk=gst&q=alias#c43c585f80be38f5

Is there any possibility of getting this option added in the future?
I know that breaking the existing behaviour is unacceptable, but
perhaps as DPP suggested in the earlier thread, an overloaded version
of the methods could be created. The original thread seemed to lose
momentum without any resolution, but this would be very helpful to me,
and I'm guessing others, too.

Failing that, any suggestions on how to work around this? I've had a
poke around in the code and I can't see a way to get the aliased names
without copying a buch of Lift code into an external class. My Scala
is still pretty weak, so maybe there's a clever way to do this without
having two copies of the code.

Thanks for reading,

Matt

David Pollak

unread,
Oct 19, 2010, 12:41:42 PM10/19/10
to lif...@googlegroups.com
Matt,

Your welcome to open a ticket on this issue (referencing this thread and the other thread).

I'm not sure what the priority of this feature is, but if there are lots of people who need it, we'll prioritize it accordingly.

Thanks,

David


--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.




--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Blog: http://goodstuff.im
Surf the harmonics

deadfolk

unread,
Oct 20, 2010, 5:16:18 AM10/20/10
to Lift
Thanks David - I have created ticket #687.

No problem on the priority - just glad to get it on the list.



On Oct 19, 5:41 pm, David Pollak <feeder.of.the.be...@gmail.com>
wrote:
> Matt,
>
> Your welcome to open a ticket on this issue (referencing this thread and the
> other thread).
>
> I'm not sure what the priority of this feature is, but if there are lots of
> people who need it, we'll prioritize it accordingly.
>
> Thanks,
>
> David
>
>
>
> On Tue, Oct 19, 2010 at 8:38 AM, deadfolk <deadf...@gmail.com> wrote:
> > Hi Guys,
>
> > There was a thread a little while back where someone requested the
> > ability to get aliased column names in the results when using
> > DB.performQuery and DB.runQuery (and possibly other places I'm not
> > aware of).  The current behaviour for these methods is to return the
> > real database column names.
>
> > e.g. running the query:
> > SELECT FirstName AS GivenName FROM accounts WHERE id = 1
>
> > returns FirstName as the colum name - but you would more likely want
> > GivenName.
>
> > Original thread here:
>
> >http://groups.google.com/group/liftweb/browse_thread/thread/1b82ab568...
>
> > Is there any possibility of getting this option added in the future?
> > I know that breaking the existing behaviour is unacceptable, but
> > perhaps as DPP suggested in the earlier thread, an overloaded version
> > of the methods could be created.  The original thread seemed to lose
> > momentum without any resolution, but this would be very helpful to me,
> > and I'm guessing others, too.
>
> > Failing that, any suggestions on how to work around this?  I've had a
> > poke around in the code and I can't see a way to get the aliased names
> > without copying a buch of Lift code into an external class.  My Scala
> > is still pretty weak, so maybe there's a clever way to do this without
> > having two copies of the code.
>
> > Thanks for reading,
>
> > Matt
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Lift" group.
> > To post to this group, send email to lif...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > liftweb+u...@googlegroups.com<liftweb%2Bunsu...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/liftweb?hl=en.
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Beginning Scalahttp://www.apress.com/book/view/1430219890
Reply all
Reply to author
Forward
0 new messages