hdx-python-database 1.3.4__py3-none-any.whl → 1.3.5__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/_version.py +2 -2
- hdx/database/views.py +8 -17
- {hdx_python_database-1.3.4.dist-info → hdx_python_database-1.3.5.dist-info}/METADATA +2 -2
- {hdx_python_database-1.3.4.dist-info → hdx_python_database-1.3.5.dist-info}/RECORD +6 -6
- {hdx_python_database-1.3.4.dist-info → hdx_python_database-1.3.5.dist-info}/WHEEL +1 -1
- {hdx_python_database-1.3.4.dist-info → hdx_python_database-1.3.5.dist-info}/licenses/LICENSE +0 -0
hdx/database/_version.py
CHANGED
hdx/database/views.py
CHANGED
|
@@ -7,10 +7,8 @@ https://github.com/sqlalchemy/sqlalchemy/wiki/Views#sqlalchemy-14-20-version
|
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
9
|
import sqlalchemy as sa
|
|
10
|
-
from sqlalchemy import MetaData, Selectable, TableClause
|
|
11
10
|
from sqlalchemy.ext import compiler
|
|
12
11
|
from sqlalchemy.schema import DDLElement
|
|
13
|
-
from sqlalchemy.sql import table
|
|
14
12
|
|
|
15
13
|
|
|
16
14
|
class CreateView(DDLElement):
|
|
@@ -45,22 +43,15 @@ def view_doesnt_exist(ddl, target, connection, **kw):
|
|
|
45
43
|
return not view_exists(ddl, target, connection, **kw)
|
|
46
44
|
|
|
47
45
|
|
|
48
|
-
def view(name
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
Returns:
|
|
57
|
-
TableClause: SQLAlchemy View
|
|
58
|
-
"""
|
|
59
|
-
t = table(name)
|
|
60
|
-
|
|
61
|
-
t._columns._populate_separate_keys(
|
|
62
|
-
col._make_proxy(t) for col in selectable.selected_columns
|
|
46
|
+
def view(name, metadata, selectable):
|
|
47
|
+
t = sa.table(
|
|
48
|
+
name,
|
|
49
|
+
*(
|
|
50
|
+
sa.Column(c.name, c.type, primary_key=c.primary_key)
|
|
51
|
+
for c in selectable.selected_columns
|
|
52
|
+
),
|
|
63
53
|
)
|
|
54
|
+
t.primary_key.update(c for c in t.c if c.primary_key)
|
|
64
55
|
|
|
65
56
|
sa.event.listen(
|
|
66
57
|
metadata,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: hdx-python-database
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.5
|
|
4
4
|
Summary: HDX Python database utilities
|
|
5
5
|
Project-URL: Homepage, https://github.com/OCHA-DAP/hdx-python-database
|
|
6
6
|
Author-email: Michael Rans <rans@email.com>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
hdx/database/__init__.py,sha256=KS5VOdLv9P-YDTE_2ZUtVm6QNwezNpXMSd7SvMYU4EM,11655
|
|
2
|
-
hdx/database/_version.py,sha256=
|
|
2
|
+
hdx/database/_version.py,sha256=FcYWgM5oYgqvidiF8nHnDFf0uLGibSe_Bdaq7MY6S4U,411
|
|
3
3
|
hdx/database/dburi.py,sha256=rw8RuLpU85vxYl5-Zk1SdZRAz-tqre_ot5aEnkjhxAQ,2977
|
|
4
4
|
hdx/database/no_timezone.py,sha256=Lw087G3qOf8H70o8Hq_VvOMZ3ANei-lIA_sUlpFU_Uo,1130
|
|
5
5
|
hdx/database/postgresql.py,sha256=i5s_CJQZagMTuzgmnLakCOnSnvczpgJ26Q1CV6lz2_A,2646
|
|
6
6
|
hdx/database/utils.py,sha256=6lLymWriMFCq8BZgrDt4V5z14GR3PbvG_WXZeBc99Ws,415
|
|
7
|
-
hdx/database/views.py,sha256=
|
|
7
|
+
hdx/database/views.py,sha256=U4BN9tbjlr93qKkeNbZNo_PCIwGsng09mQ2xFqh5CH0,1636
|
|
8
8
|
hdx/database/with_timezone.py,sha256=GUUylmTwQHp22yedmCVKpVJzvjWgdS9lg9KeqciNJkY,235
|
|
9
|
-
hdx_python_database-1.3.
|
|
10
|
-
hdx_python_database-1.3.
|
|
11
|
-
hdx_python_database-1.3.
|
|
12
|
-
hdx_python_database-1.3.
|
|
9
|
+
hdx_python_database-1.3.5.dist-info/METADATA,sha256=7aChW3Z69gXHOYG1fITGuN1dssWgCu7z2_VP4Lx1hao,2691
|
|
10
|
+
hdx_python_database-1.3.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
11
|
+
hdx_python_database-1.3.5.dist-info/licenses/LICENSE,sha256=wc-4GpMn-ODs-U_bTe1YCiPVgvcjzrpYOx2wPuyAeII,1079
|
|
12
|
+
hdx_python_database-1.3.5.dist-info/RECORD,,
|
{hdx_python_database-1.3.4.dist-info → hdx_python_database-1.3.5.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|