dbhydra 2.3.4__tar.gz → 2.3.6__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.
Files changed (31) hide show
  1. {dbhydra-2.3.4 → dbhydra-2.3.6}/PKG-INFO +1 -1
  2. {dbhydra-2.3.4 → dbhydra-2.3.6}/dbhydra/src/abstract_table.py +13 -3
  3. {dbhydra-2.3.4 → dbhydra-2.3.6}/dbhydra.egg-info/PKG-INFO +1 -1
  4. {dbhydra-2.3.4 → dbhydra-2.3.6}/setup.py +1 -1
  5. {dbhydra-2.3.4 → dbhydra-2.3.6}/LICENSE +0 -0
  6. {dbhydra-2.3.4 → dbhydra-2.3.6}/README.md +0 -0
  7. {dbhydra-2.3.4 → dbhydra-2.3.6}/dbhydra/__init__.py +0 -0
  8. {dbhydra-2.3.4 → dbhydra-2.3.6}/dbhydra/dbhydra_core.py +0 -0
  9. {dbhydra-2.3.4 → dbhydra-2.3.6}/dbhydra/src/__init__.py +0 -0
  10. {dbhydra-2.3.4 → dbhydra-2.3.6}/dbhydra/src/abstract_db.py +0 -0
  11. {dbhydra-2.3.4 → dbhydra-2.3.6}/dbhydra/src/bigquery_db.py +0 -0
  12. {dbhydra-2.3.4 → dbhydra-2.3.6}/dbhydra/src/errors/__init__.py +0 -0
  13. {dbhydra-2.3.4 → dbhydra-2.3.6}/dbhydra/src/errors/exceptions.py +0 -0
  14. {dbhydra-2.3.4 → dbhydra-2.3.6}/dbhydra/src/migrator.py +0 -0
  15. {dbhydra-2.3.4 → dbhydra-2.3.6}/dbhydra/src/mongo_db.py +0 -0
  16. {dbhydra-2.3.4 → dbhydra-2.3.6}/dbhydra/src/mysql_db.py +0 -0
  17. {dbhydra-2.3.4 → dbhydra-2.3.6}/dbhydra/src/postgres_db.py +0 -0
  18. {dbhydra-2.3.4 → dbhydra-2.3.6}/dbhydra/src/sqlserver_db.py +0 -0
  19. {dbhydra-2.3.4 → dbhydra-2.3.6}/dbhydra/src/tables.py +0 -0
  20. {dbhydra-2.3.4 → dbhydra-2.3.6}/dbhydra/src/xlsx_db.py +0 -0
  21. {dbhydra-2.3.4 → dbhydra-2.3.6}/dbhydra/test_migrator.py +0 -0
  22. {dbhydra-2.3.4 → dbhydra-2.3.6}/dbhydra/tests/__init__.py +0 -0
  23. {dbhydra-2.3.4 → dbhydra-2.3.6}/dbhydra/tests/test_cases.py +0 -0
  24. {dbhydra-2.3.4 → dbhydra-2.3.6}/dbhydra/tests/test_mongo.py +0 -0
  25. {dbhydra-2.3.4 → dbhydra-2.3.6}/dbhydra/tests/test_mysql_ddl.py +0 -0
  26. {dbhydra-2.3.4 → dbhydra-2.3.6}/dbhydra/tests/test_sql.py +0 -0
  27. {dbhydra-2.3.4 → dbhydra-2.3.6}/dbhydra.egg-info/SOURCES.txt +0 -0
  28. {dbhydra-2.3.4 → dbhydra-2.3.6}/dbhydra.egg-info/dependency_links.txt +0 -0
  29. {dbhydra-2.3.4 → dbhydra-2.3.6}/dbhydra.egg-info/requires.txt +0 -0
  30. {dbhydra-2.3.4 → dbhydra-2.3.6}/dbhydra.egg-info/top_level.txt +0 -0
  31. {dbhydra-2.3.4 → dbhydra-2.3.6}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dbhydra
3
- Version: 2.3.4
3
+ Version: 2.3.6
4
4
  Summary: Data science friendly ORM combining Python
5
5
  Home-page: https://github.com/DovaX/dbhydra
6
6
  Author: DovaX
@@ -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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dbhydra
3
- Version: 2.3.4
3
+ Version: 2.3.6
4
4
  Summary: Data science friendly ORM combining Python
5
5
  Home-page: https://github.com/DovaX/dbhydra
6
6
  Author: DovaX
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
5
5
 
6
6
  setuptools.setup(
7
7
  name='dbhydra',
8
- version='2.3.4',
8
+ version='2.3.6',
9
9
  author='DovaX',
10
10
  author_email='dovax.ai@gmail.com',
11
11
  description='Data science friendly ORM combining Python',
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