hdx-python-database 1.3.2__tar.gz → 1.3.3__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.
- {hdx_python_database-1.3.2 → hdx_python_database-1.3.3}/PKG-INFO +1 -1
- {hdx_python_database-1.3.2 → hdx_python_database-1.3.3}/src/hdx/database/__init__.py +11 -2
- {hdx_python_database-1.3.2 → hdx_python_database-1.3.3}/src/hdx/database/_version.py +2 -2
- {hdx_python_database-1.3.2 → hdx_python_database-1.3.3}/tests/hdx/database/test_database.py +0 -1
- {hdx_python_database-1.3.2 → hdx_python_database-1.3.3}/tests/hdx/database/test_reflect.py +0 -1
- {hdx_python_database-1.3.2 → hdx_python_database-1.3.3}/tests/hdx/database/test_ssh.py +0 -16
- {hdx_python_database-1.3.2 → hdx_python_database-1.3.3}/.config/coveragerc +0 -0
- {hdx_python_database-1.3.2 → hdx_python_database-1.3.3}/.config/pre-commit-config.yaml +0 -0
- {hdx_python_database-1.3.2 → hdx_python_database-1.3.3}/.config/pytest.ini +0 -0
- {hdx_python_database-1.3.2 → hdx_python_database-1.3.3}/.config/ruff.toml +0 -0
- {hdx_python_database-1.3.2 → hdx_python_database-1.3.3}/.github/workflows/publish.yaml +0 -0
- {hdx_python_database-1.3.2 → hdx_python_database-1.3.3}/.github/workflows/run-python-tests.yaml +0 -0
- {hdx_python_database-1.3.2 → hdx_python_database-1.3.3}/.gitignore +0 -0
- {hdx_python_database-1.3.2 → hdx_python_database-1.3.3}/CONTRIBUTING.md +0 -0
- {hdx_python_database-1.3.2 → hdx_python_database-1.3.3}/LICENSE +0 -0
- {hdx_python_database-1.3.2 → hdx_python_database-1.3.3}/README.md +0 -0
- {hdx_python_database-1.3.2 → hdx_python_database-1.3.3}/documentation/.readthedocs.yaml +0 -0
- {hdx_python_database-1.3.2 → hdx_python_database-1.3.3}/documentation/main.md +0 -0
- {hdx_python_database-1.3.2 → hdx_python_database-1.3.3}/documentation/pydoc-markdown.yaml +0 -0
- {hdx_python_database-1.3.2 → hdx_python_database-1.3.3}/pyproject.toml +0 -0
- {hdx_python_database-1.3.2 → hdx_python_database-1.3.3}/requirements.txt +0 -0
- {hdx_python_database-1.3.2 → hdx_python_database-1.3.3}/src/hdx/database/dburi.py +0 -0
- {hdx_python_database-1.3.2 → hdx_python_database-1.3.3}/src/hdx/database/no_timezone.py +0 -0
- {hdx_python_database-1.3.2 → hdx_python_database-1.3.3}/src/hdx/database/postgresql.py +0 -0
- {hdx_python_database-1.3.2 → hdx_python_database-1.3.3}/src/hdx/database/utils.py +0 -0
- {hdx_python_database-1.3.2 → hdx_python_database-1.3.3}/src/hdx/database/views.py +0 -0
- {hdx_python_database-1.3.2 → hdx_python_database-1.3.3}/src/hdx/database/with_timezone.py +0 -0
- {hdx_python_database-1.3.2 → hdx_python_database-1.3.3}/tests/fixtures/test.db +0 -0
- {hdx_python_database-1.3.2 → hdx_python_database-1.3.3}/tests/hdx/database/__init__.py +0 -0
- {hdx_python_database-1.3.2 → hdx_python_database-1.3.3}/tests/hdx/database/conftest.py +0 -0
- {hdx_python_database-1.3.2 → hdx_python_database-1.3.3}/tests/hdx/database/dbtestdate.py +0 -0
- {hdx_python_database-1.3.2 → hdx_python_database-1.3.3}/tests/hdx/database/test_dburi.py +0 -0
- {hdx_python_database-1.3.2 → hdx_python_database-1.3.3}/tests/hdx/database/test_postgresql.py +0 -0
- {hdx_python_database-1.3.2 → hdx_python_database-1.3.3}/tests/hdx/database/test_recreate.py +0 -0
|
@@ -173,7 +173,11 @@ class Database:
|
|
|
173
173
|
self.reflected_classes = None
|
|
174
174
|
|
|
175
175
|
def cleanup(self) -> None:
|
|
176
|
-
|
|
176
|
+
"""Cleanup SQLAlchemy.
|
|
177
|
+
|
|
178
|
+
Returns:
|
|
179
|
+
sqlalchemy.Engine: SQLAlchemy engine
|
|
180
|
+
"""
|
|
177
181
|
self.session.close()
|
|
178
182
|
self.engine.dispose()
|
|
179
183
|
if self.server is not None:
|
|
@@ -185,7 +189,12 @@ class Database:
|
|
|
185
189
|
def __exit__(self, exc_type: Any, exc_value: Any, traceback: Any) -> None:
|
|
186
190
|
self.cleanup()
|
|
187
191
|
|
|
188
|
-
def drop_all(self):
|
|
192
|
+
def drop_all(self) -> None:
|
|
193
|
+
"""Drop all tables.
|
|
194
|
+
|
|
195
|
+
Returns:
|
|
196
|
+
None
|
|
197
|
+
"""
|
|
189
198
|
self.base.metadata.drop_all(self.engine)
|
|
190
199
|
|
|
191
200
|
def get_engine(self) -> Engine:
|
|
@@ -34,10 +34,6 @@ class TestSSH:
|
|
|
34
34
|
== "postgresql+psycopg://myuser@0.0.0.0:12345/mydatabase"
|
|
35
35
|
)
|
|
36
36
|
assert dbdatabase.base == TZBase
|
|
37
|
-
try:
|
|
38
|
-
dbdatabase.drop_all()
|
|
39
|
-
except AttributeError:
|
|
40
|
-
pass
|
|
41
37
|
|
|
42
38
|
with Database(
|
|
43
39
|
ssh_host="mysshhost", ssh_port=25, table_base=TZBase, **params
|
|
@@ -48,10 +44,6 @@ class TestSSH:
|
|
|
48
44
|
== "postgresql+psycopg://myuser@0.0.0.0:12345/mydatabase"
|
|
49
45
|
)
|
|
50
46
|
assert dbdatabase.base == TZBase
|
|
51
|
-
try:
|
|
52
|
-
dbdatabase.drop_all()
|
|
53
|
-
except AttributeError:
|
|
54
|
-
pass
|
|
55
47
|
|
|
56
48
|
with Database(ssh_host="mysshhost", **self.params_pg) as dbdatabase:
|
|
57
49
|
dbsession = dbdatabase.get_session()
|
|
@@ -60,10 +52,6 @@ class TestSSH:
|
|
|
60
52
|
== "postgresql+psycopg://myuser:***@0.0.0.0:12345/mydatabase"
|
|
61
53
|
)
|
|
62
54
|
assert dbdatabase.base == NoTZBase
|
|
63
|
-
try:
|
|
64
|
-
dbdatabase.drop_all()
|
|
65
|
-
except AttributeError:
|
|
66
|
-
pass
|
|
67
55
|
|
|
68
56
|
with Database(
|
|
69
57
|
ssh_host="mysshhost", ssh_port=25, **params
|
|
@@ -74,7 +62,3 @@ class TestSSH:
|
|
|
74
62
|
== "postgresql+psycopg://myuser@0.0.0.0:12345/mydatabase"
|
|
75
63
|
)
|
|
76
64
|
assert dbdatabase.base == NoTZBase
|
|
77
|
-
try:
|
|
78
|
-
dbdatabase.drop_all()
|
|
79
|
-
except AttributeError:
|
|
80
|
-
pass
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hdx_python_database-1.3.2 → hdx_python_database-1.3.3}/.github/workflows/run-python-tests.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hdx_python_database-1.3.2 → hdx_python_database-1.3.3}/tests/hdx/database/test_postgresql.py
RENAMED
|
File without changes
|
|
File without changes
|