Great, thanks for this, I will definitely play around with this.
Lots of great tools and links here!
However, I do have a remark for Mike:
you suggest
('%' + literal(custom_string) + '%').ilike('%' + MyClass.column +
'%')
While this probably works for PGSQL (haven't tested though), in sqlite
it won't, as in sqlite
'%AA%' like 'XAAX'
isn't True, but:
'XAAX' like '%AA%'
is True.
At least where I am, the '%' symbol only works on the right hand side
of "LIKE" not on the left.
This is why I had to do the trick with or_ in my code.
Again, thanks for this answer Michael!To Cameron Jackson: my database is quite large, which is why I wan't to avoid python matching. Your solution, while it may work on small instances, is not suited for my particular use case. I try to avoid querying the entire database in memory before working on it as a general rule. Thanks anyways though ! -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
