sqlphilosophy 0.3.3__tar.gz → 0.3.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.
Files changed (34) hide show
  1. {sqlphilosophy-0.3.3/src/sqlphilosophy.egg-info → sqlphilosophy-0.3.4}/PKG-INFO +15 -5
  2. {sqlphilosophy-0.3.3 → sqlphilosophy-0.3.4}/README.md +12 -2
  3. {sqlphilosophy-0.3.3 → sqlphilosophy-0.3.4}/pyproject.toml +3 -3
  4. sqlphilosophy-0.3.4/src/sqlphilosophy/VERSION +1 -0
  5. {sqlphilosophy-0.3.3 → sqlphilosophy-0.3.4}/src/sqlphilosophy/strict.py +17 -4
  6. {sqlphilosophy-0.3.3 → sqlphilosophy-0.3.4}/src/sqlphilosophy/types.py +1 -1
  7. {sqlphilosophy-0.3.3 → sqlphilosophy-0.3.4/src/sqlphilosophy.egg-info}/PKG-INFO +15 -5
  8. {sqlphilosophy-0.3.3 → sqlphilosophy-0.3.4}/src/sqlphilosophy.egg-info/requires.txt +2 -2
  9. sqlphilosophy-0.3.3/src/sqlphilosophy/VERSION +0 -1
  10. {sqlphilosophy-0.3.3 → sqlphilosophy-0.3.4}/LICENSE +0 -0
  11. {sqlphilosophy-0.3.3 → sqlphilosophy-0.3.4}/MANIFEST.in +0 -0
  12. {sqlphilosophy-0.3.3 → sqlphilosophy-0.3.4}/setup.cfg +0 -0
  13. {sqlphilosophy-0.3.3 → sqlphilosophy-0.3.4}/src/sqlphilosophy/__init__.py +0 -0
  14. {sqlphilosophy-0.3.3 → sqlphilosophy-0.3.4}/src/sqlphilosophy/_repository_shared.py +0 -0
  15. {sqlphilosophy-0.3.3 → sqlphilosophy-0.3.4}/src/sqlphilosophy/aio/__init__.py +0 -0
  16. {sqlphilosophy-0.3.3 → sqlphilosophy-0.3.4}/src/sqlphilosophy/aio/protocols.py +0 -0
  17. {sqlphilosophy-0.3.3 → sqlphilosophy-0.3.4}/src/sqlphilosophy/aio/query.py +0 -0
  18. {sqlphilosophy-0.3.3 → sqlphilosophy-0.3.4}/src/sqlphilosophy/aio/repository.py +0 -0
  19. {sqlphilosophy-0.3.3 → sqlphilosophy-0.3.4}/src/sqlphilosophy/audit/__init__.py +0 -0
  20. {sqlphilosophy-0.3.3 → sqlphilosophy-0.3.4}/src/sqlphilosophy/audit/context.py +0 -0
  21. {sqlphilosophy-0.3.3 → sqlphilosophy-0.3.4}/src/sqlphilosophy/audit/fields.py +0 -0
  22. {sqlphilosophy-0.3.3 → sqlphilosophy-0.3.4}/src/sqlphilosophy/audit/listener.py +0 -0
  23. {sqlphilosophy-0.3.3 → sqlphilosophy-0.3.4}/src/sqlphilosophy/audit/model.py +0 -0
  24. {sqlphilosophy-0.3.3 → sqlphilosophy-0.3.4}/src/sqlphilosophy/py.typed +0 -0
  25. {sqlphilosophy-0.3.3 → sqlphilosophy-0.3.4}/src/sqlphilosophy/sorting.py +0 -0
  26. {sqlphilosophy-0.3.3 → sqlphilosophy-0.3.4}/src/sqlphilosophy/sql.py +0 -0
  27. {sqlphilosophy-0.3.3 → sqlphilosophy-0.3.4}/src/sqlphilosophy/sync/__init__.py +0 -0
  28. {sqlphilosophy-0.3.3 → sqlphilosophy-0.3.4}/src/sqlphilosophy/sync/protocols.py +0 -0
  29. {sqlphilosophy-0.3.3 → sqlphilosophy-0.3.4}/src/sqlphilosophy/sync/query.py +0 -0
  30. {sqlphilosophy-0.3.3 → sqlphilosophy-0.3.4}/src/sqlphilosophy/sync/repository.py +0 -0
  31. {sqlphilosophy-0.3.3 → sqlphilosophy-0.3.4}/src/sqlphilosophy/trusted_sql.py +0 -0
  32. {sqlphilosophy-0.3.3 → sqlphilosophy-0.3.4}/src/sqlphilosophy.egg-info/SOURCES.txt +0 -0
  33. {sqlphilosophy-0.3.3 → sqlphilosophy-0.3.4}/src/sqlphilosophy.egg-info/dependency_links.txt +0 -0
  34. {sqlphilosophy-0.3.3 → sqlphilosophy-0.3.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.3.3
3
+ Version: 0.3.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
@@ -20,7 +20,7 @@ Classifier: Typing :: Typed
20
20
  Requires-Python: <4.0,>=3.12
21
21
  Description-Content-Type: text/markdown
22
22
  License-File: LICENSE
23
- Requires-Dist: servicephilosophy>=0.1.0
23
+ Requires-Dist: servicephilosophy<0.2,>=0.1.2
24
24
  Requires-Dist: sqlalchemy<3,>=2.0
25
25
  Provides-Extra: async
26
26
  Requires-Dist: greenlet>=3.0; extra == "async"
@@ -30,7 +30,7 @@ Requires-Dist: pytest-asyncio>=0.24; extra == "dev"
30
30
  Requires-Dist: pytest-cov>=6; extra == "dev"
31
31
  Requires-Dist: aiosqlite>=0.20; extra == "dev"
32
32
  Requires-Dist: greenlet>=3.0; extra == "dev"
33
- Requires-Dist: build>=1.2; extra == "dev"
33
+ Requires-Dist: build<2,>=1.6.1; extra == "dev"
34
34
  Requires-Dist: twine>=5; extra == "dev"
35
35
  Requires-Dist: ruff>=0.15; extra == "dev"
36
36
  Requires-Dist: mypy>=1.11; extra == "dev"
@@ -183,10 +183,20 @@ See [RELEASING.md](./RELEASING.md) for GitHub + PyPI trusted publishing. See [CH
183
183
 
184
184
  MIT — see [LICENSE](./LICENSE).
185
185
 
186
- ## Expression lookups and scope overrides (0.3.1)
186
+ ## Expression lookups and scope overrides (0.3+)
187
187
 
188
188
  Both repository bases provide `find_entity(criteria=..., lock=False)`, `find_row(criteria=..., columns=..., lock=False)` and `count_scoped(criteria=...)`. Criteria must not be empty; projected lookups also require columns. Entity lookups return a mapped object, projected lookups return RowMapping, and absence returns None. These methods never commit.
189
189
 
190
190
  Override `apply_scope(statement)` for additional predicates on these helpers. It runs after projection initialization, because `select_columns`/`select_entity` reset the builder's SELECT. This hook does not implicitly scope existing CRUD helpers or arbitrary builder calls: keep ownership checks in named application repository methods. Existing `first`, `get_by_id`, `count` and statement APIs remain available and unchanged.
191
191
 
192
- The 0.3.1 artifact is a local candidate until separately published. Dependent candidate packages use a vendored wheel during validation; publish sqlPhilosophy first before replacing their local sources with registry-only dependencies.
192
+ Published 0.3.3 provides these lookup APIs. The 0.3.4 source prepares compatible
193
+ strict-decoder, documentation and build-metadata fixes. Use a named application
194
+ repository method to own each model-specific projection, ordering and policy;
195
+ compose its query with `statement()` or these lookup helpers instead of
196
+ scattering `select()` calls through controllers/services. Core SQL helpers remain
197
+ available for explicit SQL boundaries; a repository does not supply authorization.
198
+
199
+ The supported dependency range remains SQLAlchemy 2.x. DeliveryPlus native's
200
+ 2.0.49 constraint and RuleAtlas's separate 2.1.5 minimum are host decisions;
201
+ upgrading this package does not silently change either host lock. Coordinated
202
+ candidate verification exercises both SQLAlchemy versions before release.
@@ -143,10 +143,20 @@ See [RELEASING.md](./RELEASING.md) for GitHub + PyPI trusted publishing. See [CH
143
143
 
144
144
  MIT — see [LICENSE](./LICENSE).
145
145
 
146
- ## Expression lookups and scope overrides (0.3.1)
146
+ ## Expression lookups and scope overrides (0.3+)
147
147
 
148
148
  Both repository bases provide `find_entity(criteria=..., lock=False)`, `find_row(criteria=..., columns=..., lock=False)` and `count_scoped(criteria=...)`. Criteria must not be empty; projected lookups also require columns. Entity lookups return a mapped object, projected lookups return RowMapping, and absence returns None. These methods never commit.
149
149
 
150
150
  Override `apply_scope(statement)` for additional predicates on these helpers. It runs after projection initialization, because `select_columns`/`select_entity` reset the builder's SELECT. This hook does not implicitly scope existing CRUD helpers or arbitrary builder calls: keep ownership checks in named application repository methods. Existing `first`, `get_by_id`, `count` and statement APIs remain available and unchanged.
151
151
 
152
- The 0.3.1 artifact is a local candidate until separately published. Dependent candidate packages use a vendored wheel during validation; publish sqlPhilosophy first before replacing their local sources with registry-only dependencies.
152
+ Published 0.3.3 provides these lookup APIs. The 0.3.4 source prepares compatible
153
+ strict-decoder, documentation and build-metadata fixes. Use a named application
154
+ repository method to own each model-specific projection, ordering and policy;
155
+ compose its query with `statement()` or these lookup helpers instead of
156
+ scattering `select()` calls through controllers/services. Core SQL helpers remain
157
+ available for explicit SQL boundaries; a repository does not supply authorization.
158
+
159
+ The supported dependency range remains SQLAlchemy 2.x. DeliveryPlus native's
160
+ 2.0.49 constraint and RuleAtlas's separate 2.1.5 minimum are host decisions;
161
+ upgrading this package does not silently change either host lock. Coordinated
162
+ candidate verification exercises both SQLAlchemy versions before release.
@@ -1,5 +1,5 @@
1
1
  [build-system]
2
- requires = ["setuptools>=69", "wheel"]
2
+ requires = ["setuptools>=84.2.1,<85", "wheel>=0.46,<1"]
3
3
  build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
@@ -24,7 +24,7 @@ classifiers = [
24
24
  ]
25
25
  dynamic = ["version"]
26
26
  dependencies = [
27
- "servicephilosophy>=0.1.0",
27
+ "servicephilosophy>=0.1.2,<0.2",
28
28
  "sqlalchemy>=2.0,<3",
29
29
  ]
30
30
 
@@ -38,7 +38,7 @@ dev = [
38
38
  "pytest-cov>=6",
39
39
  "aiosqlite>=0.20",
40
40
  "greenlet>=3.0",
41
- "build>=1.2",
41
+ "build>=1.6.1,<2",
42
42
  "twine>=5",
43
43
  "ruff>=0.15",
44
44
  "mypy>=1.11",
@@ -0,0 +1 @@
1
+ 0.3.4
@@ -6,7 +6,7 @@ from collections.abc import Callable, Mapping
6
6
  from datetime import date, datetime
7
7
  from enum import Enum
8
8
  from math import isfinite
9
- from typing import TypeGuard
9
+ from typing import TypeGuard, cast
10
10
  from uuid import UUID
11
11
 
12
12
  from sqlphilosophy.types import JSONValue
@@ -99,9 +99,21 @@ def strict_row_enum[EnumT: Enum](row: Row, key: str, enum_type: type[EnumT]) ->
99
99
  raise _type_error(key, enum_type.__name__, value)
100
100
 
101
101
 
102
+ def _plain_list(value: object) -> list[object] | None:
103
+ if type(value) is not list:
104
+ return None
105
+ # Exact built-in type proof preserves identity without inspecting __class__.
106
+ return cast(list[object], value)
107
+
108
+
109
+ def _is_str_list(value: object) -> TypeGuard[list[str]]:
110
+ items = _plain_list(value)
111
+ return items is not None and all(type(item) is str for item in items)
112
+
113
+
102
114
  def strict_row_str_list(row: Row, key: str) -> list[str]:
103
115
  value = _required(row, key)
104
- if type(value) is not list or not all(type(item) is str for item in value):
116
+ if not _is_str_list(value):
105
117
  raise _type_error(key, "list[str]", value)
106
118
  return value
107
119
 
@@ -111,8 +123,9 @@ def is_strict_json_value(value: object) -> TypeGuard[JSONValue]:
111
123
  return True
112
124
  if type(value) is float:
113
125
  return isfinite(value)
114
- if type(value) is list:
115
- return all(is_strict_json_value(item) for item in value)
126
+ items = _plain_list(value)
127
+ if items is not None:
128
+ return all(is_strict_json_value(item) for item in items)
116
129
  if type(value) is dict:
117
130
  return all(type(key) is str and is_strict_json_value(item) for key, item in value.items())
118
131
  return False
@@ -65,4 +65,4 @@ type OrmModel = type[DeclarativeBase]
65
65
 
66
66
  def cursor_rowcount(result: Result[Any]) -> int:
67
67
  """Return affected row count from a DML ``execute`` result."""
68
- return int(cast(CursorResult[Any], result).rowcount or 0)
68
+ return int(cast("CursorResult[Any]", result).rowcount or 0)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlphilosophy
3
- Version: 0.3.3
3
+ Version: 0.3.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
@@ -20,7 +20,7 @@ Classifier: Typing :: Typed
20
20
  Requires-Python: <4.0,>=3.12
21
21
  Description-Content-Type: text/markdown
22
22
  License-File: LICENSE
23
- Requires-Dist: servicephilosophy>=0.1.0
23
+ Requires-Dist: servicephilosophy<0.2,>=0.1.2
24
24
  Requires-Dist: sqlalchemy<3,>=2.0
25
25
  Provides-Extra: async
26
26
  Requires-Dist: greenlet>=3.0; extra == "async"
@@ -30,7 +30,7 @@ Requires-Dist: pytest-asyncio>=0.24; extra == "dev"
30
30
  Requires-Dist: pytest-cov>=6; extra == "dev"
31
31
  Requires-Dist: aiosqlite>=0.20; extra == "dev"
32
32
  Requires-Dist: greenlet>=3.0; extra == "dev"
33
- Requires-Dist: build>=1.2; extra == "dev"
33
+ Requires-Dist: build<2,>=1.6.1; extra == "dev"
34
34
  Requires-Dist: twine>=5; extra == "dev"
35
35
  Requires-Dist: ruff>=0.15; extra == "dev"
36
36
  Requires-Dist: mypy>=1.11; extra == "dev"
@@ -183,10 +183,20 @@ See [RELEASING.md](./RELEASING.md) for GitHub + PyPI trusted publishing. See [CH
183
183
 
184
184
  MIT — see [LICENSE](./LICENSE).
185
185
 
186
- ## Expression lookups and scope overrides (0.3.1)
186
+ ## Expression lookups and scope overrides (0.3+)
187
187
 
188
188
  Both repository bases provide `find_entity(criteria=..., lock=False)`, `find_row(criteria=..., columns=..., lock=False)` and `count_scoped(criteria=...)`. Criteria must not be empty; projected lookups also require columns. Entity lookups return a mapped object, projected lookups return RowMapping, and absence returns None. These methods never commit.
189
189
 
190
190
  Override `apply_scope(statement)` for additional predicates on these helpers. It runs after projection initialization, because `select_columns`/`select_entity` reset the builder's SELECT. This hook does not implicitly scope existing CRUD helpers or arbitrary builder calls: keep ownership checks in named application repository methods. Existing `first`, `get_by_id`, `count` and statement APIs remain available and unchanged.
191
191
 
192
- The 0.3.1 artifact is a local candidate until separately published. Dependent candidate packages use a vendored wheel during validation; publish sqlPhilosophy first before replacing their local sources with registry-only dependencies.
192
+ Published 0.3.3 provides these lookup APIs. The 0.3.4 source prepares compatible
193
+ strict-decoder, documentation and build-metadata fixes. Use a named application
194
+ repository method to own each model-specific projection, ordering and policy;
195
+ compose its query with `statement()` or these lookup helpers instead of
196
+ scattering `select()` calls through controllers/services. Core SQL helpers remain
197
+ available for explicit SQL boundaries; a repository does not supply authorization.
198
+
199
+ The supported dependency range remains SQLAlchemy 2.x. DeliveryPlus native's
200
+ 2.0.49 constraint and RuleAtlas's separate 2.1.5 minimum are host decisions;
201
+ upgrading this package does not silently change either host lock. Coordinated
202
+ candidate verification exercises both SQLAlchemy versions before release.
@@ -1,4 +1,4 @@
1
- servicephilosophy>=0.1.0
1
+ servicephilosophy<0.2,>=0.1.2
2
2
  sqlalchemy<3,>=2.0
3
3
 
4
4
  [async]
@@ -10,7 +10,7 @@ pytest-asyncio>=0.24
10
10
  pytest-cov>=6
11
11
  aiosqlite>=0.20
12
12
  greenlet>=3.0
13
- build>=1.2
13
+ build<2,>=1.6.1
14
14
  twine>=5
15
15
  ruff>=0.15
16
16
  mypy>=1.11
@@ -1 +0,0 @@
1
- 0.3.3
File without changes
File without changes
File without changes