Re: [sqlalchemy] Determination of string lengths

2015-12-10 Thread 'Robert Forkel' via sqlalchemy
As stated in the docs: "Note that any name not known to func generates the function name as is - there is no restriction on what SQL functions can be called, known or unknown to SQLAlchemy, built-in or

Re: [sqlalchemy] Determination of string lengths

2015-12-10 Thread SF Markus Elfring
Thanks for the link to information I was looking for: http://stackoverflow.com/questions/15743121/how-to-filter-in-sqlalchemy-by-string-length#answer-15743220 Why is the method "length" not mentioned in the documentation chapter "SQL and Generic Functions" so far?

Re: [sqlalchemy] Determination of string lengths

2015-12-10 Thread Jonathan Vanasco
`sqlalchemy.func` does not map anything. It is a namespace for a factory generator. anything you access with it becomes a function of that caller's name. for example: filter( func.foo(table.column) > 1 ) produces WHERE foo(table.column) > 1 sqlalchemy generates the `foo`

Re: [sqlalchemy] Determination of string lengths

2015-12-10 Thread 'Robert Forkel' via sqlalchemy
I don't know which database you are using, but in postgresql there certainly is a function called "length" (see http://www.postgresql.org/docs/9.1/static/functions-string.html) On Thu, Dec 10, 2015 at 2:04 PM, SF Markus Elfring < elfr...@users.sourceforge.net> wrote: > > As stated in the docs: >

Re: [sqlalchemy] Determination of string lengths

2015-12-10 Thread SF Markus Elfring
> As stated in the docs: > "Note that any name not known to func generates the function name as is > - there is no restriction on what SQL functions can be called, > known or unknown to SQLAlchemy, built-in or user defined." I get an error message like "Function len(text) does not exist." if I

Re: [sqlalchemy] Determination of string lengths

2015-12-10 Thread SF Markus Elfring
> I don't know which database you are using, > but in postgresql there certainly is a function called "length" How do you think about to avoid the direct reuse of functions which are specific for a few database software implementations? Is there any more portability possible around string

Re: [sqlalchemy] Determination of string lengths

2015-12-10 Thread Mike Bayer
On 12/10/2015 12:08 PM, Jonathan Vanasco wrote: > `sqlalchemy.func` does not map anything. It is a namespace for a > factory generator. anything you access with it becomes a function of > that caller's name. > > for example: > > filter( func.foo(table.column) > 1 ) > > produces > >

[sqlalchemy] Determination of string lengths

2015-12-05 Thread SF Markus Elfring
Hello, I would like to reuse the standard function "len" for the determination of string lengths from specific database fields in a query. http://www.dailyfreecode.com/code/len-function-296.aspx Which interface does provide this functionality for the software "SQLAlchemy"? Regards, Markus --

Re: [sqlalchemy] Determination of string lengths

2015-12-05 Thread Jeff Widman
This is probably the fastest answer: http://stackoverflow.com/questions/15743121/how-to-filter-in-sqlalchemy-by-string-length ᐧ On Sat, Dec 5, 2015 at 1:34 AM, SF Markus Elfring < elfr...@users.sourceforge.net> wrote: > Hello, > > I would like to reuse the standard function "len" for the