mirror of
ssh://devgit.janware.com/janware/proj/jw-python
synced 2026-06-18 04:46:37 +02: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
|