nimbus-eth1/nimbus/db/select_backend.nim

20 lines
463 B
Nim
Raw Normal View History

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