mirror of
https://github.com/mariadb-corporation/mariadb-connector-python.git
synced 2025-08-10 04:10:19 +00:00
CONPY-217:
Add reconnect keyword for connection.
This commit is contained in:
@ -57,6 +57,7 @@ class Connection(mariadb._mariadb.connection):
|
|||||||
self._xid= None
|
self._xid= None
|
||||||
|
|
||||||
autocommit= kwargs.pop("autocommit", False)
|
autocommit= kwargs.pop("autocommit", False)
|
||||||
|
reconnect= kwargs.pop("reconnect", False)
|
||||||
self._converter= kwargs.pop("converter", None)
|
self._converter= kwargs.pop("converter", None)
|
||||||
|
|
||||||
# if host contains a connection string or multiple hosts,
|
# if host contains a connection string or multiple hosts,
|
||||||
@ -78,6 +79,7 @@ class Connection(mariadb._mariadb.connection):
|
|||||||
|
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
self.autocommit= autocommit
|
self.autocommit= autocommit
|
||||||
|
self.auto_reconnect= reconnect
|
||||||
|
|
||||||
def cursor(self, cursorclass=mariadb.cursors.Cursor, **kwargs):
|
def cursor(self, cursorclass=mariadb.cursors.Cursor, **kwargs):
|
||||||
"""
|
"""
|
||||||
|
Reference in New Issue
Block a user