2022-09-27 14:15:08 +00:00
|
|
|
from django.conf import settings
|
|
|
|
|
|
|
|
|
|
|
|
def get_db():
|
|
|
|
if settings.DB_BACKEND == "DRUID":
|
|
|
|
from core.db.druid import DruidBackend
|
|
|
|
|
|
|
|
return DruidBackend()
|
2022-11-21 19:20:02 +00:00
|
|
|
elif settings.DB_BACKEND == "ELASTICSEARCH":
|
|
|
|
from core.db.elastic import ElasticSearchBackend
|
2022-09-27 14:15:08 +00:00
|
|
|
|
|
|
|
return OpensearchBackend()
|
|
|
|
elif settings.DB_BACKEND == "MANTICORE":
|
|
|
|
from core.db.manticore import ManticoreBackend
|
|
|
|
|
|
|
|
return ManticoreBackend()
|
|
|
|
else:
|
|
|
|
raise Exception("Invalid DB backend")
|
|
|
|
|
|
|
|
|
|
|
|
db = get_db()
|