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 <https://gist.github.com/ojomio/d449abffe588a2abd32b> 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/sqlalchemy/blob/master/lib/sqlalchemy/sql/sqltypes.py#L1960)
> , at least as for version 1.0.9, which I use? We have to explicitly use
> `array` literal everywhere insted of just specifying python lists like
> [1,2,3]
ARRAY isn't a SQL standard type so there's no straightforward way to
have the Core pull in a PG specific type when there is otherwise no
ARRAY type present.
that said, in most cases when you're dealing with ARRAY there should
already be an ARRAY type in play somewhere (e.g. the column you're
comparing to, or whatever), so that would handle your list values in
place. The _type_map is just a convenience. If you're doing
bindparam(), say bindparam('foo', ['some', 'list'], type_=ARRAY(String)).
>
> пятница, 20 ноября 2015 г., 0:30:15 UTC+5 пользователь Michael 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 documentation on SQLA internals, because
> it is
> > quite difficult to track the whole query compilation process for me
> > четверг, 19 ноября 2015 г., 21:14:59 UTC+5 пользователь Michael Bayer
> > написал:
> >
> >
> >
> > you can try a bindparam(), sure. the original question,
> everything
> > under @compiles should return plain text, yes, those functions
> all need
> > to return text that is appended to the SQL statement.
> >
> > --
> > 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] <javascript:>
> > <mailto:[email protected] <javascript:>>.
> > To post to this group, send email to [email protected]
> <javascript:>
> > <mailto:[email protected] <javascript:>>.
> > Visit this group at http://groups.google.com/group/sqlalchemy
> <http://groups.google.com/group/sqlalchemy>.
> > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
> --
> 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/d/optout.
--
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].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.