dbhydra 2.2.1__tar.gz → 2.2.3__tar.gz
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-2.2.1 → dbhydra-2.2.3}/PKG-INFO +1 -1
- {dbhydra-2.2.1 → dbhydra-2.2.3}/dbhydra/src/abstract_table.py +9 -7
- {dbhydra-2.2.1 → dbhydra-2.2.3}/dbhydra.egg-info/PKG-INFO +1 -1
- {dbhydra-2.2.1 → dbhydra-2.2.3}/setup.py +1 -1
- {dbhydra-2.2.1 → dbhydra-2.2.3}/LICENSE +0 -0
- {dbhydra-2.2.1 → dbhydra-2.2.3}/README.md +0 -0
- {dbhydra-2.2.1 → dbhydra-2.2.3}/dbhydra/__init__.py +0 -0
- {dbhydra-2.2.1 → dbhydra-2.2.3}/dbhydra/dbhydra_core.py +0 -0
- {dbhydra-2.2.1 → dbhydra-2.2.3}/dbhydra/src/__init__.py +0 -0
- {dbhydra-2.2.1 → dbhydra-2.2.3}/dbhydra/src/abstract_db.py +0 -0
- {dbhydra-2.2.1 → dbhydra-2.2.3}/dbhydra/src/bigquery_db.py +0 -0
- {dbhydra-2.2.1 → dbhydra-2.2.3}/dbhydra/src/errors/__init__.py +0 -0
- {dbhydra-2.2.1 → dbhydra-2.2.3}/dbhydra/src/errors/exceptions.py +0 -0
- {dbhydra-2.2.1 → dbhydra-2.2.3}/dbhydra/src/migrator.py +0 -0
- {dbhydra-2.2.1 → dbhydra-2.2.3}/dbhydra/src/mongo_db.py +0 -0
- {dbhydra-2.2.1 → dbhydra-2.2.3}/dbhydra/src/mysql_db.py +0 -0
- {dbhydra-2.2.1 → dbhydra-2.2.3}/dbhydra/src/postgres_db.py +0 -0
- {dbhydra-2.2.1 → dbhydra-2.2.3}/dbhydra/src/sqlserver_db.py +0 -0
- {dbhydra-2.2.1 → dbhydra-2.2.3}/dbhydra/src/tables.py +0 -0
- {dbhydra-2.2.1 → dbhydra-2.2.3}/dbhydra/src/xlsx_db.py +0 -0
- {dbhydra-2.2.1 → dbhydra-2.2.3}/dbhydra/test_migrator.py +0 -0
- {dbhydra-2.2.1 → dbhydra-2.2.3}/dbhydra/tests/__init__.py +0 -0
- {dbhydra-2.2.1 → dbhydra-2.2.3}/dbhydra/tests/test_cases.py +0 -0
- {dbhydra-2.2.1 → dbhydra-2.2.3}/dbhydra/tests/test_mongo.py +0 -0
- {dbhydra-2.2.1 → dbhydra-2.2.3}/dbhydra/tests/test_sql.py +0 -0
- {dbhydra-2.2.1 → dbhydra-2.2.3}/dbhydra.egg-info/SOURCES.txt +0 -0
- {dbhydra-2.2.1 → dbhydra-2.2.3}/dbhydra.egg-info/dependency_links.txt +0 -0
- {dbhydra-2.2.1 → dbhydra-2.2.3}/dbhydra.egg-info/requires.txt +0 -0
- {dbhydra-2.2.1 → dbhydra-2.2.3}/dbhydra.egg-info/top_level.txt +0 -0
- {dbhydra-2.2.1 → dbhydra-2.2.3}/setup.cfg +0 -0
|
@@ -102,7 +102,7 @@ class AbstractSelectable:
|
|
|
102
102
|
return (results)
|
|
103
103
|
|
|
104
104
|
|
|
105
|
-
def select(self, query, flattening_of_results=False):
|
|
105
|
+
def select(self, query, flattening_of_results=False, debug_mode = False):
|
|
106
106
|
"""given SELECT query returns Python list"""
|
|
107
107
|
"""Columns give the number of selected columns"""
|
|
108
108
|
|
|
@@ -113,7 +113,8 @@ class AbstractSelectable:
|
|
|
113
113
|
return(self) #to enable chaining
|
|
114
114
|
|
|
115
115
|
else:
|
|
116
|
-
|
|
116
|
+
if debug_mode:
|
|
117
|
+
print(query)
|
|
117
118
|
self.db1.cursor.execute(query)
|
|
118
119
|
|
|
119
120
|
columns_count=len(self._get_selected_columns(query))
|
|
@@ -131,18 +132,18 @@ class AbstractSelectable:
|
|
|
131
132
|
return(rows)
|
|
132
133
|
|
|
133
134
|
|
|
134
|
-
def select_all(self):
|
|
135
|
+
def select_all(self, debug_mode = False):
|
|
135
136
|
quote = self.db1.identifier_quote
|
|
136
137
|
all_cols_query = ""
|
|
137
138
|
for col in self.columns:
|
|
138
139
|
all_cols_query = all_cols_query + quote + col + quote + ","
|
|
139
140
|
if all_cols_query[-1] == ",":
|
|
140
141
|
all_cols_query = all_cols_query[:-1]
|
|
141
|
-
list1 = self.select(f"SELECT {all_cols_query} FROM {quote}{self.name}{quote};")
|
|
142
|
+
list1 = self.select(f"SELECT {all_cols_query} FROM {quote}{self.name}{quote};", debug_mode = debug_mode)
|
|
142
143
|
return (list1)
|
|
143
144
|
|
|
144
|
-
def select_to_df(self):
|
|
145
|
-
rows = self.select_all()
|
|
145
|
+
def select_to_df(self, debug_mode = False):
|
|
146
|
+
rows = self.select_all(debug_mode = debug_mode)
|
|
146
147
|
if self.query_building_enabled:
|
|
147
148
|
self.to_df()
|
|
148
149
|
df=None
|
|
@@ -314,7 +315,8 @@ class AbstractTable(AbstractJoinable, abc.ABC):
|
|
|
314
315
|
raise AttributeError(f"Unknown column type '{column_type}'")
|
|
315
316
|
|
|
316
317
|
column_value_string = column_value_string.rstrip(", ")
|
|
317
|
-
|
|
318
|
+
quote = self.db1.identifier_quote
|
|
319
|
+
sql_query = f"UPDATE {quote}{self.name}{quote} SET {column_value_string}"
|
|
318
320
|
|
|
319
321
|
if where_column is not None and where_value is not None:
|
|
320
322
|
sql_query += f" WHERE {where_column} = {where_value};"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|