[New Feature] Rest API implementation to showcase the OpenDBM features
This commit is contained in:
20
rest_api/app/services/main.py
Normal file
20
rest_api/app/services/main.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from sqlalchemy.orm import Session
|
||||
from config.db import get_db
|
||||
|
||||
user_db = get_db()
|
||||
|
||||
class DBSessionContext(object):
|
||||
def __init__(self, db: Session):
|
||||
self.db = db
|
||||
|
||||
|
||||
class AppService(DBSessionContext):
|
||||
pass
|
||||
|
||||
|
||||
class AppCRUD(DBSessionContext):
|
||||
pass
|
||||
|
||||
class OpenDBMSessionContext(object):
|
||||
def __init__(self):
|
||||
self.db = user_db
|
||||
Reference in New Issue
Block a user