mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-python
synced 2026-01-15 18:03:31 +01:00
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>
12 lines
180 B
Python
12 lines
180 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
import abc
|
|
|
|
class Session(abc.ABC): # export
|
|
|
|
def __init__(self, db):
|
|
self.__db = db
|
|
|
|
@property
|
|
def db(self):
|
|
return self.__db
|