tigrbl_engine_numpy 0.1.1.dev7__tar.gz → 0.1.1.dev9__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: tigrbl_engine_numpy
3
- Version: 0.1.1.dev7
3
+ Version: 0.1.1.dev9
4
4
  Summary: NumPy engine plugin for tigrbl with array-to-table helpers.
5
5
  Project-URL: Homepage, https://github.com/swarmauri/swarmauri-sdk
6
6
  Author-email: Jacob Stewart <jacob@swarmauri.com>
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "tigrbl_engine_numpy"
7
- version = "0.1.1.dev7"
7
+ version = "0.1.1.dev9"
8
8
  description = "NumPy engine plugin for tigrbl with array-to-table helpers."
9
9
  readme = "README.md"
10
10
  license = { file = "LICENSE" }
@@ -34,4 +34,5 @@ dev = [
34
34
  "pytest>=8.0.0",
35
35
  "pytest-asyncio>=0.24.0",
36
36
  "sqlalchemy>=2.0",
37
+ "ruff>=0.11.0",
37
38
  ]
@@ -2,11 +2,19 @@ from .engine import NumpyEngine, numpy_capabilities, numpy_engine
2
2
  from .session import NumpySession
3
3
 
4
4
 
5
+ class _Registration:
6
+ def build(self, *, mapping, spec, dsn):
7
+ return numpy_engine(mapping=mapping, spec=spec, dsn=dsn)
8
+
9
+ def capabilities(self, *, spec, mapping=None):
10
+ return numpy_capabilities()
11
+
12
+
5
13
  def register() -> None:
6
14
  """Entry-point hook invoked by tigrbl to register this engine."""
7
15
  from tigrbl.engine.registry import register_engine
8
16
 
9
- register_engine("numpy", build=numpy_engine, capabilities=numpy_capabilities)
17
+ register_engine("numpy", _Registration())
10
18
 
11
19
 
12
20
  __all__ = [
@@ -205,6 +205,30 @@ class NumpySession(TigrblSessionBase):
205
205
  out = fn(self)
206
206
  return await out if hasattr(out, "__await__") else out
207
207
 
208
+ async def begin(self) -> None:
209
+ await self._tx_begin_impl()
210
+
211
+ async def commit(self) -> None:
212
+ await self._tx_commit_impl()
213
+
214
+ async def rollback(self) -> None:
215
+ await self._tx_rollback_impl()
216
+
217
+ async def flush(self) -> None:
218
+ await self._flush_impl()
219
+
220
+ async def refresh(self, obj: Any) -> None:
221
+ await self._refresh_impl(obj)
222
+
223
+ async def get(self, model: type, ident: Any) -> Any | None:
224
+ return await self._get_impl(model, ident)
225
+
226
+ async def execute(self, stmt: Any) -> Any:
227
+ return await self._execute_impl(stmt)
228
+
229
+ async def close(self) -> None:
230
+ await self._close_impl()
231
+
208
232
  async def _tx_begin_impl(self) -> None:
209
233
  self._snap = [dict(row) for row in self._engine.catalog.rows]
210
234
  self._snap_ver = self._engine.catalog.table_ver