sqlphilosophy 0.1.3__tar.gz → 0.1.4__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.
Potentially problematic release.
This version of sqlphilosophy might be problematic. Click here for more details.
- {sqlphilosophy-0.1.3/src/sqlphilosophy.egg-info → sqlphilosophy-0.1.4}/PKG-INFO +1 -1
- sqlphilosophy-0.1.4/src/sqlphilosophy/VERSION +1 -0
- {sqlphilosophy-0.1.3 → sqlphilosophy-0.1.4}/src/sqlphilosophy/sql.py +14 -4
- {sqlphilosophy-0.1.3 → sqlphilosophy-0.1.4}/src/sqlphilosophy/sync/repository.py +5 -8
- {sqlphilosophy-0.1.3 → sqlphilosophy-0.1.4/src/sqlphilosophy.egg-info}/PKG-INFO +1 -1
- sqlphilosophy-0.1.3/src/sqlphilosophy/VERSION +0 -1
- {sqlphilosophy-0.1.3 → sqlphilosophy-0.1.4}/LICENSE +0 -0
- {sqlphilosophy-0.1.3 → sqlphilosophy-0.1.4}/MANIFEST.in +0 -0
- {sqlphilosophy-0.1.3 → sqlphilosophy-0.1.4}/README.md +0 -0
- {sqlphilosophy-0.1.3 → sqlphilosophy-0.1.4}/pyproject.toml +0 -0
- {sqlphilosophy-0.1.3 → sqlphilosophy-0.1.4}/setup.cfg +0 -0
- {sqlphilosophy-0.1.3 → sqlphilosophy-0.1.4}/src/sqlphilosophy/__init__.py +0 -0
- {sqlphilosophy-0.1.3 → sqlphilosophy-0.1.4}/src/sqlphilosophy/aio/__init__.py +0 -0
- {sqlphilosophy-0.1.3 → sqlphilosophy-0.1.4}/src/sqlphilosophy/aio/protocols.py +0 -0
- {sqlphilosophy-0.1.3 → sqlphilosophy-0.1.4}/src/sqlphilosophy/aio/query.py +0 -0
- {sqlphilosophy-0.1.3 → sqlphilosophy-0.1.4}/src/sqlphilosophy/aio/repository.py +0 -0
- {sqlphilosophy-0.1.3 → sqlphilosophy-0.1.4}/src/sqlphilosophy/audit/__init__.py +0 -0
- {sqlphilosophy-0.1.3 → sqlphilosophy-0.1.4}/src/sqlphilosophy/audit/context.py +0 -0
- {sqlphilosophy-0.1.3 → sqlphilosophy-0.1.4}/src/sqlphilosophy/audit/fields.py +0 -0
- {sqlphilosophy-0.1.3 → sqlphilosophy-0.1.4}/src/sqlphilosophy/audit/listener.py +0 -0
- {sqlphilosophy-0.1.3 → sqlphilosophy-0.1.4}/src/sqlphilosophy/audit/model.py +0 -0
- {sqlphilosophy-0.1.3 → sqlphilosophy-0.1.4}/src/sqlphilosophy/py.typed +0 -0
- {sqlphilosophy-0.1.3 → sqlphilosophy-0.1.4}/src/sqlphilosophy/sorting.py +0 -0
- {sqlphilosophy-0.1.3 → sqlphilosophy-0.1.4}/src/sqlphilosophy/sync/__init__.py +0 -0
- {sqlphilosophy-0.1.3 → sqlphilosophy-0.1.4}/src/sqlphilosophy/sync/protocols.py +0 -0
- {sqlphilosophy-0.1.3 → sqlphilosophy-0.1.4}/src/sqlphilosophy/sync/query.py +0 -0
- {sqlphilosophy-0.1.3 → sqlphilosophy-0.1.4}/src/sqlphilosophy/types.py +0 -0
- {sqlphilosophy-0.1.3 → sqlphilosophy-0.1.4}/src/sqlphilosophy.egg-info/SOURCES.txt +0 -0
- {sqlphilosophy-0.1.3 → sqlphilosophy-0.1.4}/src/sqlphilosophy.egg-info/dependency_links.txt +0 -0
- {sqlphilosophy-0.1.3 → sqlphilosophy-0.1.4}/src/sqlphilosophy.egg-info/requires.txt +0 -0
- {sqlphilosophy-0.1.3 → sqlphilosophy-0.1.4}/src/sqlphilosophy.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sqlphilosophy
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.4
|
|
4
4
|
Summary: Portable SQLAlchemy repository kit: sync and async CRUD, statement builders, sort/pagination, and SQL helpers.
|
|
5
5
|
Author-email: Josh Martin <denverprogrammer@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.1.4
|
|
@@ -49,10 +49,20 @@ def sql_table(table_name: str, *column_names: str) -> SqlTable:
|
|
|
49
49
|
|
|
50
50
|
def get_column_value(entity: object) -> ApiObject:
|
|
51
51
|
"""Return mapped column values for an ORM entity instance."""
|
|
52
|
-
|
|
53
|
-
if
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
instance_state = sa_inspect(entity, raiseerr=False)
|
|
53
|
+
if instance_state is not None and hasattr(instance_state, "mapper"):
|
|
54
|
+
mapper = instance_state.mapper
|
|
55
|
+
else:
|
|
56
|
+
from sqlphilosophy.sync.repository import BaseRepository
|
|
57
|
+
|
|
58
|
+
try:
|
|
59
|
+
insp = BaseRepository.inspect_model(type(entity))
|
|
60
|
+
except Exception as exc:
|
|
61
|
+
raise TypeError(f"{type(entity)!r} is not a mapped SQLAlchemy entity") from exc
|
|
62
|
+
if not hasattr(insp, "mapper"):
|
|
63
|
+
raise TypeError(f"{type(entity)!r} is not a mapped SQLAlchemy entity")
|
|
64
|
+
mapper = insp.mapper
|
|
65
|
+
return {attr.key: getattr(entity, attr.key) for attr in mapper.column_attrs}
|
|
56
66
|
|
|
57
67
|
|
|
58
68
|
def row_mapping(row: object) -> RowMapping:
|
|
@@ -14,7 +14,6 @@ from sqlalchemy.orm import Session
|
|
|
14
14
|
from sqlalchemy.orm.interfaces import LoaderOption
|
|
15
15
|
from sqlphilosophy.sorting import ListQuery
|
|
16
16
|
from sqlphilosophy.sorting import SortConfig
|
|
17
|
-
from sqlphilosophy.sql import apply_mappings_page
|
|
18
17
|
from sqlphilosophy.sql import delete_by_ids_model
|
|
19
18
|
from sqlphilosophy.sql import partial_update_model
|
|
20
19
|
from sqlphilosophy.sql import rows_mapping
|
|
@@ -114,13 +113,11 @@ class BaseRepository[T: DeclarativeBase]:
|
|
|
114
113
|
params: RowMapping | None = None,
|
|
115
114
|
) -> list[RowMapping]:
|
|
116
115
|
"""Execute ``stmt`` with limit/offset; return normalized row mappings."""
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
params=params,
|
|
123
|
-
)
|
|
116
|
+
if limit < 0:
|
|
117
|
+
raise ValueError("limit must be >= 0")
|
|
118
|
+
if offset < 0:
|
|
119
|
+
raise ValueError("offset must be >= 0")
|
|
120
|
+
return self.fetch_statement_mappings(stmt.limit(limit).offset(offset), params)
|
|
124
121
|
|
|
125
122
|
def fetch_sorted_mappings(
|
|
126
123
|
self,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sqlphilosophy
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.4
|
|
4
4
|
Summary: Portable SQLAlchemy repository kit: sync and async CRUD, statement builders, sort/pagination, and SQL helpers.
|
|
5
5
|
Author-email: Josh Martin <denverprogrammer@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0.1.3
|
|
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
|