db.Session: Add

Add database session API to db. This is a breaking change, because
from this commit on, a session object has to be passed to every
query.

This commit also removes any reference to Cmds / App objects. An
instantiated database object can be worked with outside of an App.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2025-03-10 18:44:39 +01:00
commit 495cebd769
5 changed files with 56 additions and 31 deletions

View file

@ -0,0 +1,12 @@
# -*- coding: utf-8 -*-
import abc
class Session(abc.ABC): # export
def __init__(self, db):
self.__db = db
@property
def db(self):
return self.__db