Updated CRUDkit
This commit is contained in:
parent
f1fa1f2407
commit
571583bcf4
6 changed files with 186 additions and 24 deletions
|
|
@ -2,6 +2,7 @@ from __future__ import annotations
|
|||
from typing import Type, Optional
|
||||
from sqlalchemy import create_engine
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
from .backend import make_backend_info, BackendInfo
|
||||
from .config import Config, get_config
|
||||
from ._sqlite import apply_sqlite_pragmas
|
||||
|
||||
|
|
@ -41,3 +42,9 @@ class CRUDKitRuntime:
|
|||
if self._config and self._engine:
|
||||
self._session_factory = build_sessionmaker(self._config, self._engine)
|
||||
return self._session_factory
|
||||
|
||||
@property
|
||||
def backend(self) -> BackendInfo:
|
||||
if not hasattr(self, "_backend_info") or self._backend_info is None:
|
||||
self._backend_info = make_backend_info(self.engine)
|
||||
return self._backend_info
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue