Is there a good way to have a dialect automatically add casting to 'THEN' 
expressions in 'CASE' statements?

I'm working on a dialect for the H2 database, via Jython.  H2 requires 
values in a 'THEN' expression to have explicit casts (see: Unknown data 
type thrown with a case statement where all values are parameters in 
preparedStatement<http://h2-database.66688.n3.nabble.com/Unknown-data-type-thrown-with-a-case-statement-where-all-values-are-parameters-in-preparedStatement-td3091039.html>
 )

I would like to make it so that my H2 dialect will automatically add 
casting to 'CASE' expressions, so that users of the dialect don't have to 
use literal_columns each time they want to use a 'CASE' expression.

One idea I had was to add a 'before_execute' event that checks elements to 
see if their case statements, but that seems a bit kludgy.  is there a 
better way?


Levity:
Q: What do a database developer and a hollywood producer have in common?
A: They both can have problems with casting.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sqlalchemy/-/O20TVZRH2wAJ.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to