You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
512 B
Python
22 lines
512 B
Python
2 years ago
|
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()
|