hdx-python-database 1.2.9__py3-none-any.whl → 1.3.0__py3-none-any.whl
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/database/__init__.py +8 -5
- hdx/database/_version.py +2 -2
- {hdx_python_database-1.2.9.dist-info → hdx_python_database-1.3.0.dist-info}/METADATA +1 -1
- {hdx_python_database-1.2.9.dist-info → hdx_python_database-1.3.0.dist-info}/RECORD +6 -6
- {hdx_python_database-1.2.9.dist-info → hdx_python_database-1.3.0.dist-info}/WHEEL +1 -1
- {hdx_python_database-1.2.9.dist-info → hdx_python_database-1.3.0.dist-info}/licenses/LICENSE +0 -0
hdx/database/__init__.py
CHANGED
|
@@ -23,7 +23,7 @@ class Database:
|
|
|
23
23
|
reflected classes. db_has_tz which defaults to False indicates whether
|
|
24
24
|
database datetime columns have timezones. If not, conversion occurs between
|
|
25
25
|
Python datetimes with timezones to timezoneless database columns (but not
|
|
26
|
-
when using reflection).
|
|
26
|
+
when using reflection). If table_base is supplied, db_has_tz is ignored.
|
|
27
27
|
|
|
28
28
|
Args:
|
|
29
29
|
database (Optional[str]): Database name
|
|
@@ -34,6 +34,7 @@ class Database:
|
|
|
34
34
|
dialect (str): Database dialect. Defaults to "postgresql".
|
|
35
35
|
driver (Optional[str]): Database driver. Defaults to None (psycopg if postgresql or None)
|
|
36
36
|
db_has_tz (bool): True if db datetime columns have timezone. Defaults to False.
|
|
37
|
+
table_base (Optional[Type[DeclarativeBase]]): Override table base. Defaults to None.
|
|
37
38
|
reflect (bool): Whether to reflect existing tables. Defaults to False.
|
|
38
39
|
**kwargs: See below
|
|
39
40
|
ssh_host (str): SSH host (the server to connect to)
|
|
@@ -55,6 +56,7 @@ class Database:
|
|
|
55
56
|
dialect: str = "postgresql",
|
|
56
57
|
driver: Optional[str] = None,
|
|
57
58
|
db_has_tz: bool = False,
|
|
59
|
+
table_base: Optional[Type[DeclarativeBase]] = None,
|
|
58
60
|
reflect: bool = False,
|
|
59
61
|
**kwargs: Any,
|
|
60
62
|
) -> None:
|
|
@@ -98,10 +100,11 @@ class Database:
|
|
|
98
100
|
)
|
|
99
101
|
if dialect == "postgresql":
|
|
100
102
|
wait_for_postgresql(db_uri)
|
|
101
|
-
if
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
if not table_base:
|
|
104
|
+
if db_has_tz:
|
|
105
|
+
table_base = TZBase
|
|
106
|
+
else:
|
|
107
|
+
table_base = NoTZBase
|
|
105
108
|
self.session = self.get_session(
|
|
106
109
|
db_uri, table_base=table_base, reflect=reflect
|
|
107
110
|
)
|
hdx/database/_version.py
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
hdx/database/__init__.py,sha256=
|
|
2
|
-
hdx/database/_version.py,sha256=
|
|
1
|
+
hdx/database/__init__.py,sha256=0CpgEC9GAqCtmZtBsTvwoDsW3T0VHY0aCNAh53piP6g,5835
|
|
2
|
+
hdx/database/_version.py,sha256=HGwtpza1HCPtlyqElUvIyH97K44TO13CYiYVZNezQ1M,411
|
|
3
3
|
hdx/database/dburi.py,sha256=hNksrjaCC7AtD_M5ef0DCjkS0rJCofQqdXVD2BHBIGc,2938
|
|
4
4
|
hdx/database/no_timezone.py,sha256=jawupasbCwNo-lDbX24CtxaSilb6LS-jLx-wZAa58nM,1129
|
|
5
5
|
hdx/database/postgresql.py,sha256=9VlcdHhBURZPDaazj1kEq8gA4hUFJY-5hIN9uzibOlM,969
|
|
6
6
|
hdx/database/utils.py,sha256=6lLymWriMFCq8BZgrDt4V5z14GR3PbvG_WXZeBc99Ws,415
|
|
7
7
|
hdx/database/views.py,sha256=qJ_f6DpBUSzAGuBbgOXwQDZGni7b-DOUlAdAjSXKwhs,2635
|
|
8
8
|
hdx/database/with_timezone.py,sha256=GUUylmTwQHp22yedmCVKpVJzvjWgdS9lg9KeqciNJkY,235
|
|
9
|
-
hdx_python_database-1.
|
|
10
|
-
hdx_python_database-1.
|
|
11
|
-
hdx_python_database-1.
|
|
12
|
-
hdx_python_database-1.
|
|
9
|
+
hdx_python_database-1.3.0.dist-info/METADATA,sha256=8lJk615nDYiwB9vT9JUzfd-mpGVa6rIFA6kP9WVMgxI,2785
|
|
10
|
+
hdx_python_database-1.3.0.dist-info/WHEEL,sha256=TJPnKdtrSue7xZ_AVGkp9YXcvDrobsjBds1du3Nx6dc,87
|
|
11
|
+
hdx_python_database-1.3.0.dist-info/licenses/LICENSE,sha256=wc-4GpMn-ODs-U_bTe1YCiPVgvcjzrpYOx2wPuyAeII,1079
|
|
12
|
+
hdx_python_database-1.3.0.dist-info/RECORD,,
|
{hdx_python_database-1.2.9.dist-info → hdx_python_database-1.3.0.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|