for oracle, the only "timeout" I can find is this:

https://cx-oracle.readthedocs.io/en/latest/connection.html?highlight=timeout#Connection.callTimeout

looks like a connection attribute, can't set it within connect(), so
you'd need to use an event to set it across the board:

from sqlalchemy import event
e = create_engine("oracle://...")

@event.listens_for("connect", e)
def set_timeout(conn, rec):
    conn.callTimeout = 30


for SQL server it depends on the driver.  at
http://www.pymssql.org/en/stable/ I don't see any kind of "timeout" so
not sure this is supported.  you'd need to get it to happen for the
DBAPI first.


On Thu, Nov 29, 2018 at 11:32 AM <[email protected]> wrote:
>
> Hi,
>
> How to set Statement timeout for oracle and mssql in sql- alchemy ?
>
> --
> 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