Begin implementing DB framework
This commit is contained in:
21
core/db/storage.py
Normal file
21
core/db/storage.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from django.conf import settings
|
||||
|
||||
|
||||
def get_db():
|
||||
if settings.DB_BACKEND == "DRUID":
|
||||
from core.db.druid import DruidBackend
|
||||
|
||||
return DruidBackend()
|
||||
elif settings.DB_BACKEND == "OPENSEARCH":
|
||||
from core.db.opensearch import OpensearchBackend
|
||||
|
||||
return OpensearchBackend()
|
||||
elif settings.DB_BACKEND == "MANTICORE":
|
||||
from core.db.manticore import ManticoreBackend
|
||||
|
||||
return ManticoreBackend()
|
||||
else:
|
||||
raise Exception("Invalid DB backend")
|
||||
|
||||
|
||||
db = get_db()
|
||||
Reference in New Issue
Block a user