neptune/core/db/storage.py

22 lines
518 B
Python
Raw Permalink Normal View History

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()
elif settings.DB_BACKEND == "ELASTICSEARCH":
2022-11-21 07:20:29 +00:00
from core.db.elastic import ElasticsearchBackend
2022-09-27 14:15:08 +00:00
2022-11-21 07:20:29 +00:00
return ElasticsearchBackend()
2022-09-27 14:15:08 +00:00
elif settings.DB_BACKEND == "MANTICORE":
from core.db.manticore import ManticoreBackend
return ManticoreBackend()
else:
raise Exception("Invalid DB backend")
db = get_db()