mtsql 1.11.6__py3-none-any.whl → 1.11.8__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.
- mt/sql/base.py +7 -2
- mt/sql/version.py +1 -1
- {mtsql-1.11.6.dist-info → mtsql-1.11.8.dist-info}/METADATA +1 -1
- mtsql-1.11.8.dist-info/RECORD +12 -0
- mtsql-1.11.6.dist-info/RECORD +0 -12
- {mtsql-1.11.6.dist-info → mtsql-1.11.8.dist-info}/LICENSE +0 -0
- {mtsql-1.11.6.dist-info → mtsql-1.11.8.dist-info}/WHEEL +0 -0
- {mtsql-1.11.6.dist-info → mtsql-1.11.8.dist-info}/top_level.txt +0 -0
mt/sql/base.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"""Base functions dealing with an SQL database."""
|
|
2
2
|
|
|
3
|
+
import re
|
|
3
4
|
import uuid
|
|
4
5
|
import sqlalchemy as sa
|
|
5
6
|
import sqlalchemy.exc as se
|
|
@@ -364,7 +365,9 @@ def table_exists(
|
|
|
364
365
|
return sa.inspect(engine).has_table(table_name, schema=schema)
|
|
365
366
|
|
|
366
367
|
|
|
367
|
-
def create_temp_id_table(
|
|
368
|
+
def create_temp_id_table(
|
|
369
|
+
l_ids: list, conn: sa.engine.Connection, int_type="int"
|
|
370
|
+
) -> str:
|
|
368
371
|
"""Creates a temporary table to containing a list of ids.
|
|
369
372
|
|
|
370
373
|
Parameters
|
|
@@ -373,6 +376,8 @@ def create_temp_id_table(l_ids: list, conn: sa.engine.Connection) -> str:
|
|
|
373
376
|
list of ids to be inserted into the table
|
|
374
377
|
conn : sqlalchemy.engine.Connection
|
|
375
378
|
a connection that has been opened
|
|
379
|
+
int_type : str
|
|
380
|
+
an SQL string representing the int type
|
|
376
381
|
|
|
377
382
|
Returns
|
|
378
383
|
-------
|
|
@@ -382,7 +387,7 @@ def create_temp_id_table(l_ids: list, conn: sa.engine.Connection) -> str:
|
|
|
382
387
|
|
|
383
388
|
table_name = f"tab_{uuid.uuid4().hex}"
|
|
384
389
|
|
|
385
|
-
query_str = f"CREATE TEMP TABLE {table_name}(id
|
|
390
|
+
query_str = f"CREATE TEMP TABLE {table_name}(id {int_type});"
|
|
386
391
|
conn.execute(sa.text(query_str))
|
|
387
392
|
|
|
388
393
|
values = ",".join((f"({id})" for id in l_ids))
|
mt/sql/version.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: mtsql
|
|
3
|
-
Version: 1.11.
|
|
3
|
+
Version: 1.11.8
|
|
4
4
|
Summary: Extra Python modules to deal with the interaction between pandas dataframes and remote SQL servers, for Minh-Tri Pham
|
|
5
5
|
Home-page: https://github.com/inteplus/mtsql
|
|
6
6
|
Author: ['Minh-Tri Pham']
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
mt/sql/__init__.py,sha256=b7zO50apZxt9Hg2eOkJhRLrXgACR8eS5b-Rphdn5qNQ,44
|
|
2
|
+
mt/sql/base.py,sha256=x5A2-1LCZwsE243JrfnSI0O2Iexf5uRk8kB-b_GVvLA,11967
|
|
3
|
+
mt/sql/mysql.py,sha256=n2ENDctdUqZuSaDAcrqZYtPtawq3Wx4dOPCRsCB5Q4w,4894
|
|
4
|
+
mt/sql/psql.py,sha256=tzsIN2XyBJX8t7p0D2yXgEQwUTkTcDzllI4HunCfq3s,66345
|
|
5
|
+
mt/sql/redshift.py,sha256=Nve12tQ6_vO3M6yOpQQn3TkI1r4eDRBLsU0agOLRDvs,17037
|
|
6
|
+
mt/sql/sqlite.py,sha256=T2ak_hhNi_zRfpg_gp8JhNHn7D2kl4i-Ey6-9ANMtz0,8678
|
|
7
|
+
mt/sql/version.py,sha256=awZxTJogFFFGbUfMdR9YYZyg4qUUCVueUJHvdv8aHOA,207
|
|
8
|
+
mtsql-1.11.8.dist-info/LICENSE,sha256=PojkRlQzTT5Eg6Nj03XoIVEefN3u8iiIFf1p4rqe_t4,1070
|
|
9
|
+
mtsql-1.11.8.dist-info/METADATA,sha256=CDKXIg6uKE9EC64ZD91WmO6-fo839LQV58ZL4K518e0,579
|
|
10
|
+
mtsql-1.11.8.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
|
|
11
|
+
mtsql-1.11.8.dist-info/top_level.txt,sha256=WcqGFu9cV7iMZg09iam8eNxUvGpLSKKF2Iubf6SJVOo,3
|
|
12
|
+
mtsql-1.11.8.dist-info/RECORD,,
|
mtsql-1.11.6.dist-info/RECORD
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
mt/sql/__init__.py,sha256=b7zO50apZxt9Hg2eOkJhRLrXgACR8eS5b-Rphdn5qNQ,44
|
|
2
|
-
mt/sql/base.py,sha256=4Sjj-2YImoI8KBlQIg7a-HiFtv8DPNsss4hR7FxtaTs,11861
|
|
3
|
-
mt/sql/mysql.py,sha256=n2ENDctdUqZuSaDAcrqZYtPtawq3Wx4dOPCRsCB5Q4w,4894
|
|
4
|
-
mt/sql/psql.py,sha256=tzsIN2XyBJX8t7p0D2yXgEQwUTkTcDzllI4HunCfq3s,66345
|
|
5
|
-
mt/sql/redshift.py,sha256=Nve12tQ6_vO3M6yOpQQn3TkI1r4eDRBLsU0agOLRDvs,17037
|
|
6
|
-
mt/sql/sqlite.py,sha256=T2ak_hhNi_zRfpg_gp8JhNHn7D2kl4i-Ey6-9ANMtz0,8678
|
|
7
|
-
mt/sql/version.py,sha256=2UVu6Bj77g99h3KZPkWmAdYufnwsIafaR5_fyXIiQi4,207
|
|
8
|
-
mtsql-1.11.6.dist-info/LICENSE,sha256=PojkRlQzTT5Eg6Nj03XoIVEefN3u8iiIFf1p4rqe_t4,1070
|
|
9
|
-
mtsql-1.11.6.dist-info/METADATA,sha256=Xwam1Kae4wvpk5aynTl7AAuKsjbP0u5TCo_cyr8YYPM,579
|
|
10
|
-
mtsql-1.11.6.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
|
|
11
|
-
mtsql-1.11.6.dist-info/top_level.txt,sha256=WcqGFu9cV7iMZg09iam8eNxUvGpLSKKF2Iubf6SJVOo,3
|
|
12
|
-
mtsql-1.11.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|