On Sun, Aug 27, 2017 at 9:52 AM, Thorsten Kampe
<[email protected]> wrote:
> Hi,
>
> is it possible to enable autocommit for a MSSQL
> connection with Pymssql? The feature is available in
> Pymssql since 2014. PyODBC - the default MSSQL driver -
> supports autoconnect in the connection string.
>
> I have been unsuccessful trying to enable autocommit in
> the connection string or as a keyword for
> `create_engine` (`isolation_level = 'AUTOCOMMIT'` or
> `autocommit = True`).

the pyodbc connector does accept 'autocommit' as a query parameter
which will be coerced to boolean, so this should work:

create_engine("mssql+pyodbc://scott:tiger@dsn?autocommit=true")


Beyond that, we like to support AUTOCOMMIT as an isolation level if it
is available from the DBAPI as a flag we can set upon the Connection
object itself after it's been created.   Here's what such a commit
looks like if you had the ability to propose an initial pull request:
https://bitbucket.org/zzzeek/sqlalchemy/commits/a87b3c21


>
> Thorsten
>
>
> --
> 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