dbhydra 2.3.4__py3-none-any.whl → 2.3.6__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/abstract_table.py +13 -3
- {dbhydra-2.3.4.dist-info → dbhydra-2.3.6.dist-info}/METADATA +1 -1
- {dbhydra-2.3.4.dist-info → dbhydra-2.3.6.dist-info}/RECORD +6 -6
- {dbhydra-2.3.4.dist-info → dbhydra-2.3.6.dist-info}/LICENSE +0 -0
- {dbhydra-2.3.4.dist-info → dbhydra-2.3.6.dist-info}/WHEEL +0 -0
- {dbhydra-2.3.4.dist-info → dbhydra-2.3.6.dist-info}/top_level.txt +0 -0
dbhydra/src/abstract_table.py
CHANGED
|
@@ -134,7 +134,7 @@ class AbstractSelectable:
|
|
|
134
134
|
return(rows)
|
|
135
135
|
|
|
136
136
|
|
|
137
|
-
def select_all(self, debug_mode = False, limit: Optional[int] = None, offset: Optional[int] = None):
|
|
137
|
+
def select_all(self, debug_mode = False, limit: Optional[int] = None, offset: Optional[int] = None, where: Optional[str] = None):
|
|
138
138
|
quote = self.db1.identifier_quote
|
|
139
139
|
all_cols_query = ""
|
|
140
140
|
for col in self.columns:
|
|
@@ -144,6 +144,16 @@ class AbstractSelectable:
|
|
|
144
144
|
|
|
145
145
|
query = f"SELECT {all_cols_query} FROM {quote}{self.name}{quote}"
|
|
146
146
|
|
|
147
|
+
if where:
|
|
148
|
+
found_where_operator = None
|
|
149
|
+
for where_operator in [">=", "<=", ">", "<", "=", "LIKE", "IN"]:
|
|
150
|
+
if where_operator in where:
|
|
151
|
+
found_where_operator = where_operator
|
|
152
|
+
where_column = where.split(found_where_operator)[0].strip()
|
|
153
|
+
where_value = where.split(found_where_operator)[1].strip()
|
|
154
|
+
assert found_where_operator is not None
|
|
155
|
+
query+=f" WHERE {quote}{where_column}{quote}{found_where_operator}{where_value}"
|
|
156
|
+
|
|
147
157
|
# Add LIMIT and OFFSET to the query
|
|
148
158
|
if limit is not None and limit > 0:
|
|
149
159
|
if offset is not None and offset > 0:
|
|
@@ -158,8 +168,8 @@ class AbstractSelectable:
|
|
|
158
168
|
list1 = self.select(query, debug_mode = debug_mode)
|
|
159
169
|
return (list1)
|
|
160
170
|
|
|
161
|
-
def select_to_df(self, debug_mode = False, limit: Optional[int] = None, offset: Optional[int] = None):
|
|
162
|
-
rows = self.select_all(debug_mode = debug_mode, limit = limit, offset = offset)
|
|
171
|
+
def select_to_df(self, debug_mode = False, limit: Optional[int] = None, offset: Optional[int] = None, where: Optional[str] = None):
|
|
172
|
+
rows = self.select_all(debug_mode = debug_mode, limit = limit, offset = offset, where = where)
|
|
163
173
|
if self.query_building_enabled:
|
|
164
174
|
self.to_df()
|
|
165
175
|
df=None
|
|
@@ -3,7 +3,7 @@ dbhydra/dbhydra_core.py,sha256=-c_qp-atrOm6BF81fyrcSxlTSNAGBcXe4OS5OZhGqy8,2758
|
|
|
3
3
|
dbhydra/test_migrator.py,sha256=e3Nnb2mCd3CfjhjSexNg1tXVJMjkl5cCoYcuhbfZ4pM,803
|
|
4
4
|
dbhydra/src/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
dbhydra/src/abstract_db.py,sha256=9lhKV8-UAamwQRi9j1-RpgVQrew6eL0k1BfKjUOZhy8,7205
|
|
6
|
-
dbhydra/src/abstract_table.py,sha256=
|
|
6
|
+
dbhydra/src/abstract_table.py,sha256=inpFKRUUH5cJP-PfQpRdMYjD9e4gyhNjZtaD_Pn2w-I,20801
|
|
7
7
|
dbhydra/src/bigquery_db.py,sha256=77XsgvYbANlvYaJnuVve-kz-PNBx_CHoYCL-eYnA8e4,1834
|
|
8
8
|
dbhydra/src/migrator.py,sha256=QzaODEFfraD9_6HN_Osaidaj-nLYQryCYYWwJtUu3n8,18931
|
|
9
9
|
dbhydra/src/mongo_db.py,sha256=mP48zRjI7mXKpm45R8prroZI-Eo7JKf0KJqGX-oTy3w,1922
|
|
@@ -19,8 +19,8 @@ dbhydra/tests/test_cases.py,sha256=eAFGaHaIaab3md3HHm2_ryb_HHfObtcXDAEzLh4qWx8,5
|
|
|
19
19
|
dbhydra/tests/test_mongo.py,sha256=M8TD72M0iQAk7ZcLTWwLmcmmF_zwALnYEGTWjhQlq0s,1979
|
|
20
20
|
dbhydra/tests/test_mysql_ddl.py,sha256=-gncZE_HjTOAI1yxOn8u5TZkoqoRdShLMF469Trbb9U,3531
|
|
21
21
|
dbhydra/tests/test_sql.py,sha256=aPFXyA0jh8o9VG3B5f9fNz7qDbuVPZ9TcE2twn5dAeQ,3126
|
|
22
|
-
dbhydra-2.3.
|
|
23
|
-
dbhydra-2.3.
|
|
24
|
-
dbhydra-2.3.
|
|
25
|
-
dbhydra-2.3.
|
|
26
|
-
dbhydra-2.3.
|
|
22
|
+
dbhydra-2.3.6.dist-info/LICENSE,sha256=4I49wQQa81vKnbbR7_IlUSZQBc-t7K9SJaQb8UaO81Y,1247
|
|
23
|
+
dbhydra-2.3.6.dist-info/METADATA,sha256=zN8td6upDAe3Rg1X-XqhGjpIZWlDT55OVmvk2CZ76YE,2298
|
|
24
|
+
dbhydra-2.3.6.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
25
|
+
dbhydra-2.3.6.dist-info/top_level.txt,sha256=oO4Gf1T8_txIsIlp11GI0k7PtBIMb9GRwb5ObF4MLVg,8
|
|
26
|
+
dbhydra-2.3.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|