Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add connect kwargs to constructor #76

Merged
merged 2 commits into from
Sep 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading