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