Add statement_timeout to postgis get_connection

173ecc4f452d add a new parameter to get_connection so it must also be defined
for postgis.
This commit is contained in:
Cédric Krier
2023-12-01 12:03:55 +01:00
parent e195a0fb93
commit 47df4da88f
+5 -2
View File
@@ -37,8 +37,11 @@ class Database(PGDatabase):
params['dsn'] = uri._replace(scheme='postgresql').geturl()
return params
def get_connection(self, autocommit=False, readonly=False):
conn = super(Database, self).get_connection(autocommit, readonly)
def get_connection(
self, autocommit=False, readonly=False, statement_timeout=None):
conn = super().get_connection(
autocommit=autocommit, readonly=readonly,
statement_timeout=statement_timeout)
if self._GIS_OIDS is None:
cursor = conn.cursor()