SQLAlchemy == 1.0.3
mysql-python == 1.2.5
I have been playing around with baked queries and have a couple
observations, one which is problem my lack of SQLA knowledge and the other
a possible feature.
1) .in_ and bindparam
I have a query that I am baking that uses in_ with a python list. For
example
baked_query += lambda q: q.filter(Model.attr1.in_([bindparam('attr1')])
Generating the query in python succeeds but fails in mysql as bindparam is
not being converted to a valid representation for the list. "operand should
contain 1 column(s)". I tried to manually convert the python list into a
string of comma separated values, the query runs but I am doing something
stupid so the query returns zero results.
2) Result class currently does not support count(). I have a use case where
I want to allow the possibility to paginate a baked query and with it,
gather the total number of records. Without supporting count I am having to
call _as_query() and then call count on the returned query.
Just some thoughts that I did not see brought up before in my searches.
--
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 https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.