python-glowplug 0.2.0__tar.gz → 0.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_glowplug-0.2.0 → python_glowplug-0.2.2}/PKG-INFO +1 -1
- {python_glowplug-0.2.0 → python_glowplug-0.2.2}/pyproject.toml +1 -1
- {python_glowplug-0.2.0 → python_glowplug-0.2.2}/src/glowplug/base.py +2 -0
- {python_glowplug-0.2.0 → python_glowplug-0.2.2}/src/glowplug/mssql.py +8 -3
- {python_glowplug-0.2.0 → python_glowplug-0.2.2}/LICENSE +0 -0
- {python_glowplug-0.2.0 → python_glowplug-0.2.2}/README.md +0 -0
- {python_glowplug-0.2.0 → python_glowplug-0.2.2}/src/glowplug/__init__.py +0 -0
- {python_glowplug-0.2.0 → python_glowplug-0.2.2}/src/glowplug/pg.py +0 -0
- {python_glowplug-0.2.0 → python_glowplug-0.2.2}/src/glowplug/sqlite.py +0 -0
|
@@ -7,14 +7,18 @@ class MsSqlDriver(DbDriver):
|
|
|
7
7
|
|
|
8
8
|
path: str
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
maintenance_db: str
|
|
11
|
+
|
|
12
|
+
def __init__(self, path: str, maintenance_db: str = "master", **kwargs):
|
|
11
13
|
"""Initialize the driver.
|
|
12
14
|
|
|
13
15
|
Args:
|
|
14
16
|
path (str): The path to connect to the database.
|
|
17
|
+
maintenance_db (str, optional): The database to connect to for maintenance. Defaults to "master".
|
|
15
18
|
"""
|
|
16
19
|
super().__init__(**kwargs)
|
|
17
20
|
self.path = path
|
|
21
|
+
self.maintenance_db = maintenance_db
|
|
18
22
|
|
|
19
23
|
async def exists(self) -> bool:
|
|
20
24
|
"""Check if the database exists."""
|
|
@@ -56,6 +60,7 @@ class MsSqlDriver(DbDriver):
|
|
|
56
60
|
head, tail = self.path.split("/", 1)
|
|
57
61
|
# Extract the database name from the tail
|
|
58
62
|
database, query = tail.split("?", 1)
|
|
59
|
-
# Re-join the query to the beginning of the path
|
|
60
|
-
|
|
63
|
+
# Re-join the query to the beginning of the path, with the
|
|
64
|
+
# name of the maintenance database.
|
|
65
|
+
path = f"{head}/{self.maintenance_db}?{query}"
|
|
61
66
|
return path, database
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|