Skip to content
Snippets Groups Projects
Commit 0df0d1a8 authored by Danijel Schorlemmer's avatar Danijel Schorlemmer
Browse files

Add `**kwargs` to the `connect` function of `SpatiaLiteDatabase`

parent b1c4b775
No related branches found
No related tags found
1 merge request!21Resolve "Expand the `connect` function of `SpatiaLiteDatabase` to accept keyword arguments"
Pipeline #65926 passed
......@@ -94,7 +94,7 @@ class SpatiaLiteDatabase(AbstractDatabase):
self.database_filepath = database_filepath
self.spatialite_filepath = spatialite_filepath
def connect(self, init_spatial_metadata=True):
def connect(self, init_spatial_metadata=True, **kwargs):
"""
Connects to a database, loads the SpatiaLite extension and
initializes it if requested. If the database file does not exist,
......@@ -109,7 +109,7 @@ class SpatiaLiteDatabase(AbstractDatabase):
# Connect (if exists) or create SQLite database
logger.debug("Connecting to database at %s" % self.database_filepath)
try:
self.connection = sqlite3.connect(self.database_filepath)
self.connection = sqlite3.connect(self.database_filepath, **kwargs)
except Exception:
logger.exception("Error connecting to the database file")
raise
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment