2019-01-06 22:06:26 +00:00
|
|
|
import strutils
|
2018-12-27 02:59:06 +00:00
|
|
|
|
2019-01-06 22:06:26 +00:00
|
|
|
type DbBackend = enum
|
|
|
|
sqlite,
|
|
|
|
rocksdb,
|
|
|
|
lmdb
|
|
|
|
|
|
|
|
const
|
|
|
|
nimbus_db_backend* {.strdefine.} = "rocksdb"
|
|
|
|
dbBackend = parseEnum[DbBackend](nimbus_db_backend)
|
|
|
|
|
|
|
|
when dbBackend == sqlite:
|
2018-12-27 02:59:06 +00:00
|
|
|
import ./backends/sqlite_backend as database_backend
|
2019-01-06 22:06:26 +00:00
|
|
|
elif dbBackend == rocksdb:
|
2018-12-27 02:59:06 +00:00
|
|
|
import ./backends/rocksdb_backend as database_backend
|
2019-01-06 22:06:26 +00:00
|
|
|
elif dbBackend == lmdb:
|
2018-12-27 02:59:06 +00:00
|
|
|
import ./backends/lmdb_backend as database_backend
|
|
|
|
|
|
|
|
export database_backend
|