Skip to content

Commit

Permalink
Merge pull request #76 from michaelbukachi/add_connect_kwargs
Browse files Browse the repository at this point in the history
Add connect kwargs to constructor
  • Loading branch information
thombashi authored Sep 10, 2023
2 parents 26dd2ab + 7163040 commit a613647
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion simplesqlite/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,15 @@ def __init__(
delayed_connection: bool = True,
max_workers: Optional[int] = None,
profile: bool = False,
**connect_kwargs: Any
) -> None:
self.debug_query = False

self.__initialize_connection()
self.__mode = mode
self.__max_workers = max_workers
self.__is_profile = profile
self.__connect_kwargs = connect_kwargs

if database_src is None:
raise TypeError("database_src must be not None")
Expand Down Expand Up @@ -278,7 +280,7 @@ def connect(self, database_path: str, mode: str = "a") -> None:
self.__database_path = os.path.realpath(database_path)

try:
self.__connection = sqlite3.connect(database_path)
self.__connection = sqlite3.connect(database_path, **self.__connect_kwargs)
except sqlite3.OperationalError as e:
raise OperationalError(e)

Expand Down

0 comments on commit a613647

Please sign in to comment.