I am not exactly sure where to add sql.func.lower(). Following command gave 
an error that lower() for jsonb does not exist.

sql_command = 
select([self.tables[subsection].c[id_label]]).where(sql.func.lower(self.tables[subsection].c[column_name]).contains(cast(word.lower(),
 
JSONB)))

ProgrammingError: (psycopg2.ProgrammingError) function lower(jsonb) does 
not exist
LINE 3: WHERE (lower(baserecords.first_names) LIKE '%' || CAST('"las...
               ^
HINT:  No function matches the given name and argument types. You might 
need to add explicit type casts.
 [SQL: "SELECT baserecords._id \nFROM baserecords \nWHERE 
(lower(baserecords.first_names) LIKE '%%' || CAST(%(param_1)s AS JSONB) || 
'%%')"] [parameters: {'param_1': '"last"'}]


tiistai 19. tammikuuta 2016 18.37.20 UTC+2 Michael Bayer kirjoitti:
>
> call func.lower(expr) on the expression that you're comparing towards so 
> that it will render the SQL LOWER() function, then compare to a lower 
> case Python value. 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to