mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-python
synced 2026-01-15 09:53:32 +01:00
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:
parent
841b5a3391
commit
495cebd769
5 changed files with 56 additions and 31 deletions
12
tools/python/jwutils/db/Session.py
Normal file
12
tools/python/jwutils/db/Session.py
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue