dbhydra 2.0.12__py3-none-any.whl → 2.0.13__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.
- dbhydra/src/mysql_db.py +2 -2
- dbhydra/src/tables.py +4 -3
- dbhydra/src/xlsx_db.py +7 -5
- {dbhydra-2.0.12.dist-info → dbhydra-2.0.13.dist-info}/METADATA +1 -1
- {dbhydra-2.0.12.dist-info → dbhydra-2.0.13.dist-info}/RECORD +8 -8
- {dbhydra-2.0.12.dist-info → dbhydra-2.0.13.dist-info}/LICENSE +0 -0
- {dbhydra-2.0.12.dist-info → dbhydra-2.0.13.dist-info}/WHEEL +0 -0
- {dbhydra-2.0.12.dist-info → dbhydra-2.0.13.dist-info}/top_level.txt +0 -0
dbhydra/src/mysql_db.py
CHANGED
|
@@ -57,11 +57,11 @@ class MysqlDb(AbstractDb):
|
|
|
57
57
|
tables = [x[0] for x in rows]
|
|
58
58
|
return (tables)
|
|
59
59
|
|
|
60
|
-
def generate_table_dict(self):
|
|
60
|
+
def generate_table_dict(self, id_column_name = "id"):
|
|
61
61
|
tables = self.get_all_tables()
|
|
62
62
|
table_dict = dict()
|
|
63
63
|
for i, table in enumerate(tables):
|
|
64
|
-
table_dict[table] = MysqlTable.init_all_columns(self, table)
|
|
64
|
+
table_dict[table] = MysqlTable.init_all_columns(self, table, id_column_name)
|
|
65
65
|
return (table_dict)
|
|
66
66
|
|
|
67
67
|
|
dbhydra/src/tables.py
CHANGED
|
@@ -905,9 +905,10 @@ class XlsxTable(AbstractTable):
|
|
|
905
905
|
return(clean_types)
|
|
906
906
|
|
|
907
907
|
|
|
908
|
+
|
|
908
909
|
@classmethod
|
|
909
|
-
def init_all_columns(cls, db1, name):
|
|
910
|
-
temporary_table = cls(db1, name)
|
|
910
|
+
def init_all_columns(cls, db1, name, id_column_name="id"):
|
|
911
|
+
temporary_table = cls(db1, name, id_column_name)
|
|
911
912
|
columns = temporary_table.get_all_columns()
|
|
912
913
|
types = temporary_table.get_all_types()
|
|
913
914
|
|
|
@@ -918,7 +919,7 @@ class XlsxTable(AbstractTable):
|
|
|
918
919
|
types.pop(id_col_index)
|
|
919
920
|
types.insert(0, "int")
|
|
920
921
|
|
|
921
|
-
return (cls(db1, name, columns, types))
|
|
922
|
+
return (cls(db1, name, columns, types, id_column_name=id_column_name))
|
|
922
923
|
|
|
923
924
|
|
|
924
925
|
|
dbhydra/src/xlsx_db.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from dbhydra.src.abstract_db import AbstractDb
|
|
2
2
|
from dbhydra.src.tables import XlsxTable
|
|
3
3
|
|
|
4
|
+
import contextlib
|
|
4
5
|
import threading
|
|
5
6
|
import pathlib
|
|
6
7
|
import os
|
|
@@ -83,9 +84,10 @@ class XlsxDb(AbstractDb):
|
|
|
83
84
|
print("Database directory created")
|
|
84
85
|
except FileExistsError:
|
|
85
86
|
print("Database directory already exists")
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
|
|
88
|
+
@contextlib.contextmanager
|
|
89
|
+
def transaction(self):
|
|
90
|
+
yield None
|
|
89
91
|
|
|
90
92
|
def get_all_tables(self):
|
|
91
93
|
root,dirs,files=next(os.walk(self.db_directory_path))
|
|
@@ -93,11 +95,11 @@ class XlsxDb(AbstractDb):
|
|
|
93
95
|
tables = [x.lower().replace(suffix,"") for x in files]
|
|
94
96
|
return (tables)
|
|
95
97
|
|
|
96
|
-
def generate_table_dict(self):
|
|
98
|
+
def generate_table_dict(self, id_column_name="id"):
|
|
97
99
|
tables = self.get_all_tables()
|
|
98
100
|
table_dict = dict()
|
|
99
101
|
for i, table in enumerate(tables):
|
|
100
|
-
table_dict[table] = XlsxTable.init_all_columns(self, table)
|
|
102
|
+
table_dict[table] = XlsxTable.init_all_columns(self, table, id_column_name)
|
|
101
103
|
return (table_dict)
|
|
102
104
|
|
|
103
105
|
|
|
@@ -15,19 +15,19 @@ dbhydra/src/abstract_table.py,sha256=00f3Hb6LUbexvqZFPDaDwfS37Vll-ONwJfwCV-IVuto
|
|
|
15
15
|
dbhydra/src/bigquery_db.py,sha256=77XsgvYbANlvYaJnuVve-kz-PNBx_CHoYCL-eYnA8e4,1834
|
|
16
16
|
dbhydra/src/migrator.py,sha256=l2MBmiAsv2hv97YmA5IvfbPUK2aAPt46jFulLXBUFHc,4412
|
|
17
17
|
dbhydra/src/mongo_db.py,sha256=mP48zRjI7mXKpm45R8prroZI-Eo7JKf0KJqGX-oTy3w,1922
|
|
18
|
-
dbhydra/src/mysql_db.py,sha256=
|
|
18
|
+
dbhydra/src/mysql_db.py,sha256=SgwXV-OVwM9HHeQ83gHht5CF3znOqRSaEZOPIyRdiEY,2800
|
|
19
19
|
dbhydra/src/postgres_db.py,sha256=L7MaBq_6ArwDSP_5LaEqK58oLxZ1X7FgIokcDOSB7wk,1805
|
|
20
20
|
dbhydra/src/sqlserver_db.py,sha256=9Xi3NAliqM79MTV8fpNQb0nWMH8Bqjl1leJSEqgyT94,3611
|
|
21
|
-
dbhydra/src/tables.py,sha256=
|
|
22
|
-
dbhydra/src/xlsx_db.py,sha256=
|
|
21
|
+
dbhydra/src/tables.py,sha256=v-EOdlRp4XwBfticJ0DPumY_FPXwvutYqN9045mMfN0,44246
|
|
22
|
+
dbhydra/src/xlsx_db.py,sha256=Dg-wWafdfa3gSFVdP5Mtn9rNhU4k4R1T0Wx3JyiQZiM,3436
|
|
23
23
|
dbhydra/src/errors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
24
24
|
dbhydra/src/errors/exceptions.py,sha256=LVpfbTd3NHfQIM-D5TFAU6hOZwGQ3b5DwFD4B6vtf2U,149
|
|
25
25
|
dbhydra/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
26
26
|
dbhydra/tests/test_cases.py,sha256=eAFGaHaIaab3md3HHm2_ryb_HHfObtcXDAEzLh4qWx8,508
|
|
27
27
|
dbhydra/tests/test_mongo.py,sha256=M8TD72M0iQAk7ZcLTWwLmcmmF_zwALnYEGTWjhQlq0s,1979
|
|
28
28
|
dbhydra/tests/test_sql.py,sha256=aPFXyA0jh8o9VG3B5f9fNz7qDbuVPZ9TcE2twn5dAeQ,3126
|
|
29
|
-
dbhydra-2.0.
|
|
30
|
-
dbhydra-2.0.
|
|
31
|
-
dbhydra-2.0.
|
|
32
|
-
dbhydra-2.0.
|
|
33
|
-
dbhydra-2.0.
|
|
29
|
+
dbhydra-2.0.13.dist-info/LICENSE,sha256=k49Yga8CP889JJaHlOpGFzr_be2nqMoep2chYeIDctk,1091
|
|
30
|
+
dbhydra-2.0.13.dist-info/METADATA,sha256=09K_ebuO2xvBibN7gEi1lDm9NGwbruIPoMw-JF0aE5k,2299
|
|
31
|
+
dbhydra-2.0.13.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
|
32
|
+
dbhydra-2.0.13.dist-info/top_level.txt,sha256=oO4Gf1T8_txIsIlp11GI0k7PtBIMb9GRwb5ObF4MLVg,8
|
|
33
|
+
dbhydra-2.0.13.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|