On Mon, Nov 12, 2018 at 2:08 PM Brian Cherinka <[email protected]> wrote:
>
> What's the best way to set a timeout for specific queries?  I have a custom 
> query tool that uses SQLAlchemy to build and submit queries.  This tool can 
> be used in a local python session with a database.  I'm also using it to 
> allow queries in a Flask web-app. In general, I do not want to apply a time 
> limit to all queries, but I only want to apply a time limit of 1 minute to 
> queries submitted through the web app.  Given a built SQLAlchemy query and a 
> db session instance, is there any way to set a timeout through the query or 
> session objects without having to recreate a database connection?

There's no set way to do that at the SQLAlchemy level, this depends
very much on the database and the Python driver you are using and may
not be possible for every driver.

>
> --
> SQLAlchemy -
> The Python SQL Toolkit and Object Relational Mapper
>
> http://www.sqlalchemy.org/
>
> To post example code, please provide an MCVE: Minimal, Complete, and 
> Verifiable Example. See http://stackoverflow.com/help/mcve for a full 
> description.
> ---
> 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.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
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.

Reply via email to