Re: [sqlalchemy] Checking the generation of query parameters for record counting

2019-04-18 Thread Markus Elfring
>> Why is the expression “func.count(Address.id) > literal_column("2")” >> not referenced there? > > there's no reason to refer to this, literal values should be passed as > bound parameters unless there is some reason they shouldn't. Can this information be confusing? > again there is no

Re: [sqlalchemy] Checking the generation of query parameters for record counting

2019-04-18 Thread Mike Bayer
On Thu, Apr 18, 2019 at 4:30 PM Markus Elfring wrote: > > > it will generate the same SQL and provide "2" for the bound value > > instead of "1". > > Why is the expression “func.count(Address.id) > literal_column("2")” > not referenced there? there's no reason to refer to this, literal values

Re: [sqlalchemy] Checking the generation of query parameters for record counting

2019-04-18 Thread Markus Elfring
> it will generate the same SQL and provide "2" for the bound value > instead of "1". Why is the expression “func.count(Address.id) > literal_column("2")” not referenced there? > I don't know what SQL you are attempting to render. I would like to get an asterisk instead of the parameters

Re: [sqlalchemy] Checking the generation of query parameters for record counting

2019-04-18 Thread Mike Bayer
On Thu, Apr 18, 2019 at 4:00 PM Markus Elfring wrote: > > > there's no technical reason the "1" needs to render inline > > How does this information fit to the code “having(func.count(Address.id) > 2)” > from an example? >

Re: [sqlalchemy] Checking the generation of query parameters for record counting

2019-04-18 Thread Markus Elfring
> there's no technical reason the "1" needs to render inline How does this information fit to the code “having(func.count(Address.id) > 2)” from an example? https://docs.sqlalchemy.org/en/13/orm/query.html#sqlalchemy.orm.query.Query.having > and SQLAlchemy defaults literal values to being bound

Re: [sqlalchemy] Checking the generation of query parameters for record counting

2019-04-18 Thread Markus Elfring
> there's no technical reason the "1" needs to render inline How does this information fit to the code “having(func.count(Address.id) > 2)” from an example? https://docs.sqlalchemy.org/en/13/orm/query.html#sqlalchemy.orm.query.Query.having > and SQLAlchemy defaults literal values to being bound

Re: [sqlalchemy] Checking the generation of query parameters for record counting

2019-04-18 Thread Mike Bayer
On Thu, Apr 18, 2019 at 11:50 AM Markus Elfring wrote: > > * I am experimenting with data analysis in an execution environment > where I can not use Python decorators so far. > > * I would like to perform queries together with the engine > “sqlite:///:memory:” > (at the moment). > > > > q =

Re: [sqlalchemy] Checking the generation of query parameters for record counting

2019-04-18 Thread Markus Elfring
> Here is a complete proof of concept using your query, Thanks for this constructive response. > I hope this helps! The provided implementation details look very promising. > @compiles(CreateTableAs, "postgresql") There are additional constraints to consider. * I am experimenting with data

Re: [sqlalchemy] Checking the generation of query parameters for record counting

2019-04-18 Thread Mike Bayer
Here is a complete proof of concept using your query, I hope this helps! from sqlalchemy import * from sqlalchemy.orm import * from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.ext.declarative import declared_attr from sqlalchemy.ext.compiler import compiles from

Re: [sqlalchemy] Checking the generation of query parameters for record counting

2019-04-18 Thread Markus Elfring
> can you perhaps illustrate a code example of what you would like to do ? I have tried the following approach out for the software “SQLAlchemy 1.3.2” together with the engine “sqlite:///:memory:”. … q = session.query(action.statement1, action.statement2, action.name, action.source_file,