Re: [sqlalchemy] Error while using return_defaults with insert

2017-03-21 Thread Christian Barra
Thanks Mike, at the end I resolved in this way: async with engine.acquire() as conn: query = models.User.insert().values(email=email, first_name= first_name, last_name=last_name, password=password).return_defaults() result = await conn.execute(query) user_id =

Re: [sqlalchemy] Query counter [code review]

2017-03-21 Thread mike bayer
the Session may make use of more than one DBAPI connection, it uses basically one connection per transaction (per database host, if you have multiple) procured from the connection pool.If the pool has more than one connection pooled, you might not see the same one repeatedly. So the report

[sqlalchemy] Re: Query counter [code review]

2017-03-21 Thread Jonathan Vanasco
> request.add_finished_callback(cleanup) is this pyramid? if so, you can use the sqlalchemy panel for pyramid_debugtoolbar. it will track all the queries for you in development. it's not appropriate for production, but may give you the insight you need. -- SQLAlchemy - The Python SQL

[sqlalchemy] Query counter [code review]

2017-03-21 Thread Theron Luhn
Hi! Because the SQLAlchemy ORM by default lazy-loads relationships, I've found that the greatest performance issues are caused by burgeoning query counts. In order to try and keep on top of this, I've decided to count and log the number of queries per request in my web application. I wrote

Re: [sqlalchemy] sqlalchemy polymorphism without discriminators

2017-03-21 Thread mike bayer
On 03/21/2017 12:39 AM, Isaac Martin wrote: down votefavorite I am trying to use an external library which defines a class model in my own program. I want the classes I define to be the

[sqlalchemy] Re: lazy='dynamic' with query_class

2017-03-21 Thread Edu Ferreira
That's ok, it's works well for me. Thank you. Em terça-feira, 28 de fevereiro de 2017 11:15:21 UTC-3, Edu Ferreira escreveu: > > Hello, i’ve been doing a work which i need to use a custom collection with > lazy=’dynamic’, and i saw that it’s not possible, and the right way to do > this is