esuls 0.1.4__tar.gz → 0.1.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: esuls
3
- Version: 0.1.4
3
+ Version: 0.1.6
4
4
  Summary: Utility library for async database operations, HTTP requests, and parallel execution
5
5
  Author-email: IperGiove <ipergiove@gmail.com>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "esuls"
7
- version = "0.1.4"
7
+ version = "0.1.6"
8
8
  description = "Utility library for async database operations, HTTP requests, and parallel execution"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.14"
@@ -98,6 +98,8 @@ class AsyncDB(Generic[SchemaType]):
98
98
  sql_type = "INTEGER"
99
99
  elif field_type in (float,):
100
100
  sql_type = "REAL"
101
+ elif field_type == bytes:
102
+ sql_type = "BLOB"
101
103
  elif field_type in (str, enum.EnumType):
102
104
  sql_type = "TEXT"
103
105
  elif field_type in (datetime,):
@@ -176,6 +178,8 @@ class AsyncDB(Generic[SchemaType]):
176
178
  """Fast value serialization with type-based optimization."""
177
179
  if value is None or isinstance(value, (int, float, bool, str)):
178
180
  return value
181
+ if isinstance(value, bytes):
182
+ return value
179
183
  if isinstance(value, datetime):
180
184
  return value.isoformat()
181
185
  if isinstance(value, enum.Enum):
@@ -191,6 +195,18 @@ class AsyncDB(Generic[SchemaType]):
191
195
 
192
196
  field_type = self._type_hints.get(field_name)
193
197
 
198
+ # Handle bytes fields - keep as bytes
199
+ if field_type == bytes:
200
+ if isinstance(value, bytes):
201
+ return value
202
+ # If somehow stored as string, convert back
203
+ if isinstance(value, str):
204
+ import ast
205
+ try:
206
+ return ast.literal_eval(value)
207
+ except:
208
+ return value.encode('utf-8')
209
+
194
210
  # Handle string fields - ensure phone numbers are strings
195
211
  if field_type is str or (hasattr(field_type, '__origin__') and field_type.__origin__ is Union and str in getattr(field_type, '__args__', ())):
196
212
  return str(value)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: esuls
3
- Version: 0.1.4
3
+ Version: 0.1.6
4
4
  Summary: Utility library for async database operations, HTTP requests, and parallel execution
5
5
  Author-email: IperGiove <ipergiove@gmail.com>
6
6
  License: MIT
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes