Re: [sqlalchemy] How to make use of bindparam() in a custom Compiled expression?

2015-11-19 Thread Mike Bayer
On 11/19/2015 05:23 PM, Юрий Пайков wrote: > Oh, man I got it. Cannot imagine what kind of an insight hit me when I > figured it out! > Here is a test > case and final version of VALUES clause > > Btw, why there is no _type_api mapping for a

Re: [sqlalchemy] How to make use of bindparam() in a custom Compiled expression?

2015-11-19 Thread Юрий Пайков
Oh, man I got it. Cannot imagine what kind of an insight hit me when I figured it out! Here is a test case and final version of VALUES clause Btw, why there is no _type_api mapping for a list() python type (https://github.com/zzzeek/sqlalch

Re: [sqlalchemy] How to make use of bindparam() in a custom Compiled expression?

2015-11-19 Thread Mike Bayer
well what is the ARRAY data you're passing into it? can you provide a complete example? On 11/19/2015 02:04 PM, Юрий Пайков wrote: > The problem is - I can't wrap my head round using it... Could you > direct me to same compiled clause which uses bindparams? > Or perhaps maybe to some documentati

Re: [sqlalchemy] How to make use of bindparam() in a custom Compiled expression?

2015-11-19 Thread Юрий Пайков
The problem is - I can't wrap my head round using it... Could you direct me to same compiled clause which uses bindparams? Or perhaps maybe to some documentation on SQLA internals, because it is quite difficult to track the whole query compilation process for me четверг, 19 ноября 2015 г., 21:1

Re: [sqlalchemy] How to make use of bindparam() in a custom Compiled expression?

2015-11-19 Thread Mike Bayer
On 11/19/2015 10:07 AM, Юрий Пайков wrote: > But if I used bound parameters in a query - wouldn't it be a solution? > I mean, if a value for a bindparam is not inlined in a query and rather > carried along - there is no need to quote it for the driver, is there? > Like done for any other literal

Re: [sqlalchemy] How to make use of bindparam() in a custom Compiled expression?

2015-11-19 Thread Юрий Пайков
But if I used bound parameters in a query - wouldn't it be a solution? I mean, if a value for a bindparam is not inlined in a query and rather carried along - there is no need to quote it for the driver, is there? Like done for any other literal comparison, for example. The driver will insert it

Re: [sqlalchemy] How to make use of bindparam() in a custom Compiled expression?

2015-11-19 Thread Mike Bayer
On 11/19/2015 05:29 AM, Юрий Пайков wrote: > I based my code on the Michaeil Bayer's answer to this Stack Overflow > question > . > I extended it a little so it takes into account NULLs and ARRAY for > Postgresql. > > |cla

[sqlalchemy] How to make use of bindparam() in a custom Compiled expression?

2015-11-19 Thread Юрий Пайков
I based my code on the Michaeil Bayer's answer to this Stack Overflow question . I extended it a little so it takes into account NULLs and ARRAY for Postgresql. class values(FromClause): named_with_column = True