Class tigrbl.session.base.TigrblSessionBase
tigrbl.session.base.TigrblSessionBase
dataclass
TigrblSessionBase(_spec=None)
Bases: SessionABC
Common session behavior
- Tracks SessionSpec
- Tracks transaction state (_open) and write intent (_dirty)
- Queues accidentally-async add() work and resolves on flush/commit
- Enforces read-only both on write calls and at commit
apply_spec
apply_spec(spec)
Source code in tigrbl/session/base.py
30 31 |
|
run_sync
async
run_sync(fn)
Default async marker: run the callback against this session. Subclasses may override to pass the native handle.
Source code in tigrbl/session/base.py
33 34 35 36 37 38 39 40 41 |
|
begin
async
begin()
Source code in tigrbl/session/base.py
44 45 46 |
|
commit
async
commit()
Source code in tigrbl/session/base.py
48 49 50 51 52 53 54 55 |
|
rollback
async
rollback()
Source code in tigrbl/session/base.py
57 58 59 60 61 62 63 64 65 66 67 |
|
in_transaction
in_transaction()
Source code in tigrbl/session/base.py
69 70 |
|
add
add(obj)
Source code in tigrbl/session/base.py
73 74 75 76 77 78 79 80 81 82 83 84 |
|
delete
async
delete(obj)
Source code in tigrbl/session/base.py
86 87 88 89 90 |
|
flush
async
flush()
Source code in tigrbl/session/base.py
92 93 94 95 96 97 98 99 |
|
refresh
async
refresh(obj)
Source code in tigrbl/session/base.py
101 102 |
|
get
async
get(model, ident)
Source code in tigrbl/session/base.py
104 105 |
|
execute
async
execute(stmt)
Source code in tigrbl/session/base.py
107 108 |
|
close
async
close()
Source code in tigrbl/session/base.py
110 111 112 113 114 115 116 117 |
|