tigrbl-ops-oltp 0.1.12.dev1__tar.gz → 0.4.0.dev2__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 (16) hide show
  1. {tigrbl_ops_oltp-0.1.12.dev1 → tigrbl_ops_oltp-0.4.0.dev2}/PKG-INFO +10 -1
  2. {tigrbl_ops_oltp-0.1.12.dev1 → tigrbl_ops_oltp-0.4.0.dev2}/README.md +4 -0
  3. {tigrbl_ops_oltp-0.1.12.dev1 → tigrbl_ops_oltp-0.4.0.dev2}/pyproject.toml +10 -2
  4. {tigrbl_ops_oltp-0.1.12.dev1 → tigrbl_ops_oltp-0.4.0.dev2}/tigrbl_ops_oltp/crud/helpers/db.py +24 -5
  5. {tigrbl_ops_oltp-0.1.12.dev1 → tigrbl_ops_oltp-0.4.0.dev2}/tigrbl_ops_oltp/crud/ops.py +1 -1
  6. {tigrbl_ops_oltp-0.1.12.dev1 → tigrbl_ops_oltp-0.4.0.dev2}/tigrbl_ops_oltp/__init__.py +0 -0
  7. {tigrbl_ops_oltp-0.1.12.dev1 → tigrbl_ops_oltp-0.4.0.dev2}/tigrbl_ops_oltp/crud/__init__.py +0 -0
  8. {tigrbl_ops_oltp-0.1.12.dev1 → tigrbl_ops_oltp-0.4.0.dev2}/tigrbl_ops_oltp/crud/bulk.py +0 -0
  9. {tigrbl_ops_oltp-0.1.12.dev1 → tigrbl_ops_oltp-0.4.0.dev2}/tigrbl_ops_oltp/crud/helpers/__init__.py +0 -0
  10. {tigrbl_ops_oltp-0.1.12.dev1 → tigrbl_ops_oltp-0.4.0.dev2}/tigrbl_ops_oltp/crud/helpers/enum.py +0 -0
  11. {tigrbl_ops_oltp-0.1.12.dev1 → tigrbl_ops_oltp-0.4.0.dev2}/tigrbl_ops_oltp/crud/helpers/filters.py +0 -0
  12. {tigrbl_ops_oltp-0.1.12.dev1 → tigrbl_ops_oltp-0.4.0.dev2}/tigrbl_ops_oltp/crud/helpers/model.py +0 -0
  13. {tigrbl_ops_oltp-0.1.12.dev1 → tigrbl_ops_oltp-0.4.0.dev2}/tigrbl_ops_oltp/crud/helpers/normalize.py +0 -0
  14. {tigrbl_ops_oltp-0.1.12.dev1 → tigrbl_ops_oltp-0.4.0.dev2}/tigrbl_ops_oltp/crud/params.py +0 -0
  15. {tigrbl_ops_oltp-0.1.12.dev1 → tigrbl_ops_oltp-0.4.0.dev2}/tigrbl_ops_oltp/fallback.py +0 -0
  16. {tigrbl_ops_oltp-0.1.12.dev1 → tigrbl_ops_oltp-0.4.0.dev2}/tigrbl_ops_oltp/rust_handlers.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tigrbl-ops-oltp
3
- Version: 0.1.12.dev1
3
+ Version: 0.4.0.dev2
4
4
  Summary: OLTP operation implementations for Tigrbl, including CRUD and bulk handlers.
5
5
  License-Expression: Apache-2.0
6
6
  Keywords: tigrbl,sdk,standards,framework,oltp,crud
@@ -18,6 +18,11 @@ Classifier: Programming Language :: Python :: 3 :: Only
18
18
  Requires-Dist: tigrbl-base
19
19
  Requires-Dist: tigrbl-core
20
20
  Requires-Dist: tigrbl-orm
21
+ Project-URL: Discord, https://discord.gg/K4YTAPapjR
22
+ Project-URL: Homepage, https://github.com/tigrbl/tigrbl
23
+ Project-URL: Issues, https://github.com/tigrbl/tigrbl/issues
24
+ Project-URL: Organization, https://github.com/tigrbl
25
+ Project-URL: Repository, https://github.com/tigrbl/tigrbl/tree/master/pkgs/core/tigrbl_ops_oltp
21
26
  Description-Content-Type: text/markdown
22
27
 
23
28
  # tigrbl_ops_oltp
@@ -38,6 +43,10 @@ It is not the authoritative location for repository governance, current target s
38
43
 
39
44
  ## Package identity
40
45
 
46
+ - canonical repository: `https://github.com/tigrbl/tigrbl`
47
+ - organization: `https://github.com/tigrbl`
48
+ - social: `https://discord.gg/K4YTAPapjR`
49
+ - package path: `https://github.com/tigrbl/tigrbl/tree/master/pkgs/core/tigrbl_ops_oltp`
41
50
  - workspace path: `pkgs/core/tigrbl_ops_oltp`
42
51
  - workspace class: core Python package
43
52
  - implementation layout: `tigrbl_ops_oltp/`
@@ -16,6 +16,10 @@ It is not the authoritative location for repository governance, current target s
16
16
 
17
17
  ## Package identity
18
18
 
19
+ - canonical repository: `https://github.com/tigrbl/tigrbl`
20
+ - organization: `https://github.com/tigrbl`
21
+ - social: `https://discord.gg/K4YTAPapjR`
22
+ - package path: `https://github.com/tigrbl/tigrbl/tree/master/pkgs/core/tigrbl_ops_oltp`
19
23
  - workspace path: `pkgs/core/tigrbl_ops_oltp`
20
24
  - workspace class: core Python package
21
25
  - implementation layout: `tigrbl_ops_oltp/`
@@ -1,10 +1,9 @@
1
1
  [project]
2
2
  name = "tigrbl-ops-oltp"
3
- version = "0.1.12.dev1"
3
+ version = "0.4.0.dev2"
4
4
  description = "OLTP operation implementations for Tigrbl, including CRUD and bulk handlers."
5
5
  license = "Apache-2.0"
6
6
  readme = "README.md"
7
- repository = "http://github.com/swarmauri/swarmauri-sdk"
8
7
  requires-python = ">=3.10,<3.14"
9
8
  classifiers = [
10
9
  "Development Status :: 1 - Planning",
@@ -17,6 +16,7 @@ classifiers = [
17
16
  "Programming Language :: Python :: 3 :: Only",
18
17
  ]
19
18
  authors = [{ name = "Jacob Stewart", email = "jacob@swarmauri.com" }]
19
+
20
20
  dependencies = [
21
21
  "tigrbl-orm",
22
22
  "tigrbl-base",
@@ -24,6 +24,14 @@ dependencies = [
24
24
  ]
25
25
  keywords = ["tigrbl", "sdk", "standards", "framework", "oltp", "crud"]
26
26
 
27
+
28
+ [project.urls]
29
+ Organization = "https://github.com/tigrbl"
30
+ Discord = "https://discord.gg/K4YTAPapjR"
31
+ Homepage = "https://github.com/tigrbl/tigrbl"
32
+ Repository = "https://github.com/tigrbl/tigrbl/tree/master/pkgs/core/tigrbl_ops_oltp"
33
+ Issues = "https://github.com/tigrbl/tigrbl/issues"
34
+
27
35
  [tool.uv.sources]
28
36
  "tigrbl-orm" = { workspace = true }
29
37
  "tigrbl-base" = { workspace = true }
@@ -24,10 +24,17 @@ def _is_async_db(db: Any) -> bool:
24
24
  return result
25
25
 
26
26
 
27
+ def _is_awaitable_result(value: Any) -> bool:
28
+ return value is not None and callable(getattr(type(value), "__await__", None))
29
+
30
+
27
31
  async def _maybe_get(db: Union[Session, AsyncSession], model: type, pk_value: Any):
28
32
  logger.debug("_maybe_get model=%s pk_value=%s", model, pk_value)
29
33
  result = db.get(model, pk_value) # type: ignore[attr-defined]
30
- if inspect.isawaitable(result):
34
+ if _is_async_db(db):
35
+ if inspect.isawaitable(result):
36
+ result = await result
37
+ elif _is_awaitable_result(result):
31
38
  result = await result
32
39
  logger.debug("_maybe_get returning %s", result)
33
40
  return result
@@ -36,7 +43,10 @@ async def _maybe_get(db: Union[Session, AsyncSession], model: type, pk_value: An
36
43
  async def _maybe_execute(db: Union[Session, AsyncSession], stmt: Any):
37
44
  logger.debug("_maybe_execute stmt=%s", stmt)
38
45
  result = db.execute(stmt) # type: ignore[attr-defined]
39
- if inspect.isawaitable(result):
46
+ if _is_async_db(db):
47
+ if inspect.isawaitable(result):
48
+ result = await result
49
+ elif _is_awaitable_result(result):
40
50
  result = await result
41
51
  logger.debug("_maybe_execute returning %s", result)
42
52
  return result
@@ -45,7 +55,10 @@ async def _maybe_execute(db: Union[Session, AsyncSession], stmt: Any):
45
55
  async def _maybe_flush(db: Union[Session, AsyncSession]) -> None:
46
56
  logger.debug("_maybe_flush called")
47
57
  result = db.flush() # type: ignore[attr-defined]
48
- if inspect.isawaitable(result):
58
+ if _is_async_db(db):
59
+ if inspect.isawaitable(result):
60
+ await result
61
+ elif _is_awaitable_result(result):
49
62
  await result
50
63
  logger.debug("_maybe_flush completed")
51
64
 
@@ -56,7 +69,10 @@ async def _maybe_rollback(db: Union[Session, AsyncSession]) -> None:
56
69
  logger.debug("_maybe_rollback skipping rollback; no attribute")
57
70
  return
58
71
  result = db.rollback() # type: ignore[attr-defined]
59
- if inspect.isawaitable(result):
72
+ if _is_async_db(db):
73
+ if inspect.isawaitable(result):
74
+ await result
75
+ elif _is_awaitable_result(result):
60
76
  await result
61
77
  logger.debug("_maybe_rollback completed")
62
78
 
@@ -67,7 +83,10 @@ async def _maybe_delete(db: Union[Session, AsyncSession], obj: Any) -> None:
67
83
  logger.debug("_maybe_delete skipping delete; no attribute")
68
84
  return
69
85
  result = db.delete(obj) # type: ignore[attr-defined]
70
- if inspect.isawaitable(result):
86
+ if _is_async_db(db):
87
+ if inspect.isawaitable(result):
88
+ await result
89
+ elif _is_awaitable_result(result):
71
90
  await result
72
91
  logger.debug("_maybe_delete completed for obj=%s", obj)
73
92
 
@@ -124,7 +124,7 @@ async def create(
124
124
  ) -> Any:
125
125
  """
126
126
  Insert a single row. Returns the persisted model instance.
127
- Flush-only (commit happens later in END_TX).
127
+ Flush-only (commit happens later in TX_COMMIT).
128
128
  """
129
129
  logger.debug("create called with model=%s data=%s", model, data)
130
130
  _ensure_model_mapped(model)