dbhydra 2.3.3__tar.gz → 2.3.5__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 (32) hide show
  1. dbhydra-2.3.5/LICENSE +22 -0
  2. {dbhydra-2.3.3 → dbhydra-2.3.5}/PKG-INFO +1 -1
  3. {dbhydra-2.3.3 → dbhydra-2.3.5}/dbhydra/dbhydra_core.py +4 -0
  4. {dbhydra-2.3.3 → dbhydra-2.3.5}/dbhydra/src/abstract_db.py +1 -0
  5. {dbhydra-2.3.3 → dbhydra-2.3.5}/dbhydra/src/abstract_table.py +6 -3
  6. {dbhydra-2.3.3 → dbhydra-2.3.5}/dbhydra/src/xlsx_db.py +2 -1
  7. {dbhydra-2.3.3 → dbhydra-2.3.5}/dbhydra.egg-info/PKG-INFO +1 -1
  8. {dbhydra-2.3.3 → dbhydra-2.3.5}/setup.py +1 -1
  9. dbhydra-2.3.3/LICENSE +0 -19
  10. {dbhydra-2.3.3 → dbhydra-2.3.5}/README.md +0 -0
  11. {dbhydra-2.3.3 → dbhydra-2.3.5}/dbhydra/__init__.py +0 -0
  12. {dbhydra-2.3.3 → dbhydra-2.3.5}/dbhydra/src/__init__.py +0 -0
  13. {dbhydra-2.3.3 → dbhydra-2.3.5}/dbhydra/src/bigquery_db.py +0 -0
  14. {dbhydra-2.3.3 → dbhydra-2.3.5}/dbhydra/src/errors/__init__.py +0 -0
  15. {dbhydra-2.3.3 → dbhydra-2.3.5}/dbhydra/src/errors/exceptions.py +0 -0
  16. {dbhydra-2.3.3 → dbhydra-2.3.5}/dbhydra/src/migrator.py +0 -0
  17. {dbhydra-2.3.3 → dbhydra-2.3.5}/dbhydra/src/mongo_db.py +0 -0
  18. {dbhydra-2.3.3 → dbhydra-2.3.5}/dbhydra/src/mysql_db.py +0 -0
  19. {dbhydra-2.3.3 → dbhydra-2.3.5}/dbhydra/src/postgres_db.py +0 -0
  20. {dbhydra-2.3.3 → dbhydra-2.3.5}/dbhydra/src/sqlserver_db.py +0 -0
  21. {dbhydra-2.3.3 → dbhydra-2.3.5}/dbhydra/src/tables.py +0 -0
  22. {dbhydra-2.3.3 → dbhydra-2.3.5}/dbhydra/test_migrator.py +0 -0
  23. {dbhydra-2.3.3 → dbhydra-2.3.5}/dbhydra/tests/__init__.py +0 -0
  24. {dbhydra-2.3.3 → dbhydra-2.3.5}/dbhydra/tests/test_cases.py +0 -0
  25. {dbhydra-2.3.3 → dbhydra-2.3.5}/dbhydra/tests/test_mongo.py +0 -0
  26. {dbhydra-2.3.3 → dbhydra-2.3.5}/dbhydra/tests/test_mysql_ddl.py +0 -0
  27. {dbhydra-2.3.3 → dbhydra-2.3.5}/dbhydra/tests/test_sql.py +0 -0
  28. {dbhydra-2.3.3 → dbhydra-2.3.5}/dbhydra.egg-info/SOURCES.txt +0 -0
  29. {dbhydra-2.3.3 → dbhydra-2.3.5}/dbhydra.egg-info/dependency_links.txt +0 -0
  30. {dbhydra-2.3.3 → dbhydra-2.3.5}/dbhydra.egg-info/requires.txt +0 -0
  31. {dbhydra-2.3.3 → dbhydra-2.3.5}/dbhydra.egg-info/top_level.txt +0 -0
  32. {dbhydra-2.3.3 → dbhydra-2.3.5}/setup.cfg +0 -0
dbhydra-2.3.5/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 DovaX
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dbhydra
3
- Version: 2.3.3
3
+ Version: 2.3.5
4
4
  Summary: Data science friendly ORM combining Python
5
5
  Home-page: https://github.com/DovaX/dbhydra
6
6
  Author: DovaX
@@ -26,6 +26,10 @@ class Blob(str):
26
26
  """Store BLOBs up to 16MB."""
27
27
  pass
28
28
 
29
+ class LongText(str):
30
+ """Store long text strings (maps to MySQL LONGTEXT)."""
31
+ pass
32
+
29
33
 
30
34
  class LongText(str):
31
35
  """Marker type for columns that should be mapped to LONGTEXT in SQL backends."""
@@ -59,6 +59,7 @@ class AbstractDb(abc.ABC):
59
59
  'Optional': 'object',
60
60
  'Jsonable': 'Jsonable',
61
61
  'Blob': 'Blob',
62
+ 'LongText': 'LongText',
62
63
  # 'FrozenSet': frozenset,
63
64
  # 'Deque': list,
64
65
  # 'Any': object,
@@ -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,9 @@ class AbstractSelectable:
144
144
 
145
145
  query = f"SELECT {all_cols_query} FROM {quote}{self.name}{quote}"
146
146
 
147
+ if where:
148
+ query+=" WHERE "+where
149
+
147
150
  # Add LIMIT and OFFSET to the query
148
151
  if limit is not None and limit > 0:
149
152
  if offset is not None and offset > 0:
@@ -158,8 +161,8 @@ class AbstractSelectable:
158
161
  list1 = self.select(query, debug_mode = debug_mode)
159
162
  return (list1)
160
163
 
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)
164
+ def select_to_df(self, debug_mode = False, limit: Optional[int] = None, offset: Optional[int] = None, where: Optional[str] = None):
165
+ rows = self.select_all(debug_mode = debug_mode, limit = limit, offset = offset, where = where)
163
166
  if self.query_building_enabled:
164
167
  self.to_df()
165
168
  df=None
@@ -43,7 +43,8 @@ class XlsxDb(AbstractDb):
43
43
  'bool': "bool",
44
44
  'datetime': "datetime",
45
45
  'Jsonable': "str",
46
- 'Blob': "Blob"
46
+ 'Blob': "Blob",
47
+ 'LongText': "str"
47
48
  }
48
49
 
49
50
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dbhydra
3
- Version: 2.3.3
3
+ Version: 2.3.5
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.3',
8
+ version='2.3.5',
9
9
  author='DovaX',
10
10
  author_email='dovax.ai@gmail.com',
11
11
  description='Data science friendly ORM combining Python',
dbhydra-2.3.3/LICENSE DELETED
@@ -1,19 +0,0 @@
1
- Copyright (c) 2020 The Python Packaging Authority
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy
4
- of this software and associated documentation files (the "Software"), to deal
5
- in the Software without restriction, including without limitation the rights
6
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- copies of the Software, and to permit persons to whom the Software is
8
- furnished to do so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in all
11
- copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
- SOFTWARE.
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes