Okay so basically what you are saying is that this is intended behaviour? I've been trying to dig through the source for quite some time now but finding the point where it is decided is harder than I thought. Could you explain why String + Int gives the operator "add" and not "concat_op"?
On 31.08.2013 00:28, Michael Bayer wrote: > (note: please keep answering the emails! this is great, I just > happen to have a little bit of net access here..) > > here's how you can turn any expression into any other type for > Python-side operator or data coercion purposes (that is, like a CAST > but doesn't render CAST on the database): > > from sqlalchemy import type_coerce > > type_coerce(any_expression, String) + > type_coerce(any_other_expression, String) > > you'll get <any expression> || <any other expression> no matter what > the two sides are. > > (if you don't, then *that's* the bug) > > > On Aug 30, 2013, at 1:34 PM, Jonathan Vanasco <[email protected] > <mailto:[email protected]>> wrote: > >> This might be a bug then. >> >> String || Integer ; Integer || String >> - PostgreSQL and sqlite both allow for a sting & integer to be concat >> together into a string. Order does not matter. >> >> Integer || Integer >> - PostgreSQL will error if 2 ints are concat together. >> - sqlite seems to cast both into a string, and returns a string ( >> i.e. "Select 1 || 2" == "12" == str(12) ) >> >> -- >> 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 [email protected] >> <mailto:[email protected]>. >> To post to this group, send email to [email protected] >> <mailto:[email protected]>. >> Visit this group at http://groups.google.com/group/sqlalchemy. >> For more options, visit https://groups.google.com/groups/opt_out. >
smime.p7s
Description: S/MIME Cryptographic Signature
