Hey guys,
SQLBuilder is working great for my optimized queries and table displays, one 
thing I think would be cool is if it could also provide some simple string 
operators for queries.

I think that concatenation would be particularly usefull, but it may not be 
standardized in the SQL specs, at least it appears to be implemented 
differently in different databases, but that's what SQLBuilder is for eh? I 
know at least postgres and sqlite use || for the operator.

I would like to generate a query such as 
"select last_name || ', ' || first_name from contact"

(I actually care about doing more complex queries involving data from multiple 
tables, but for simplicity this is the idea)

One possible syntax could be:

from sqlobject.sqlbuilder import *
Contact._connection.sqlrepr(
  Select( StrCat(Contact.q.lastName, ",", Contact.q.firstName) ) )

Does this sound like a reasonable feature request? I'd help with the coding if 
it was cleared. A reasonable concern would be if the majority of suppored 
databases have some syntax to deal with this and what would happen if they 
didn't (exception raised? do it in python?).

Cheers,
--gabe





-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to