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-02-05 19:15:50 +00:00
import eth/trie/backends/sqlite_backend as database_backend
elif dbBackend == rocksdb:
2019-02-05 19:15:50 +00:00
import eth/trie/backends/rocksdb_backend as database_backend
elif dbBackend == lmdb:
2019-02-05 19:15:50 +00:00
import eth/trie/backends/lmdb_backend as database_backend
2018-12-27 02:59:06 +00:00
export database_backend