mirror of
https://github.com/PyMySQL/mysqlclient.git
synced 2025-08-15 02:54:29 +08:00
Support autocommit=True
for constructor argument.
This commit is contained in:
@ -139,6 +139,9 @@ class Connection(_mysql.connection):
|
||||
local_infile
|
||||
integer, non-zero enables LOAD LOCAL INFILE; zero disables
|
||||
|
||||
autocommit
|
||||
If True, autocommit is enabled.
|
||||
|
||||
There are a number of undocumented, non-standard methods. See the
|
||||
documentation for the MySQL C API for some hints on what they do.
|
||||
|
||||
@ -224,7 +227,7 @@ class Connection(_mysql.connection):
|
||||
self.encoders[types.StringType] = string_literal
|
||||
self.encoders[types.UnicodeType] = unicode_literal
|
||||
self._transactional = self.server_capabilities & CLIENT.TRANSACTIONS
|
||||
if self._transactional:
|
||||
if self._transactional and not kwargs2.pop('autocommit', False):
|
||||
# PEP-249 requires autocommit to be initially off
|
||||
self.autocommit(False)
|
||||
self.messages = []
|
||||
|
Reference in New Issue
Block a user