nimbus-eth1/nimbus/db/select_backend.nim
Ștefan Talpalaru 89044b84e7 update Nimbus header and refine db backend picking
- dynamically generated copyright year interval
- added the db backend to the header
- documented the db-backend-changing define, made it case insensitive
  and ensured wrong values would trigger compilation errors
2019-01-07 01:21:29 +02:00

20 lines
442 B
Nim

import strutils
type DbBackend = enum
sqlite,
rocksdb,
lmdb
const
nimbus_db_backend* {.strdefine.} = "rocksdb"
dbBackend = parseEnum[DbBackend](nimbus_db_backend)
when dbBackend == sqlite:
import ./backends/sqlite_backend as database_backend
elif dbBackend == rocksdb:
import ./backends/rocksdb_backend as database_backend
elif dbBackend == lmdb:
import ./backends/lmdb_backend as database_backend
export database_backend