mirror of
https://github.com/logos-storage/nim-datastore.git
synced 2026-03-28 06:53:09 +00:00
cleanup
This commit is contained in:
parent
c67b61aa50
commit
e2b6005918
@ -28,7 +28,7 @@ suite "Test Open SQLite Datastore DB":
|
||||
|
||||
test "Should create and open datastore DB":
|
||||
let
|
||||
dsDb = SQLiteDsDb.open(
|
||||
dsDb = SQLiteDsDb[string, seq[byte]].open(
|
||||
path = dbPathAbs,
|
||||
flags = SQLITE_OPEN_READWRITE or SQLITE_OPEN_CREATE).tryGet()
|
||||
|
||||
@ -40,7 +40,7 @@ suite "Test Open SQLite Datastore DB":
|
||||
|
||||
test "Should open existing DB":
|
||||
let
|
||||
dsDb = SQLiteDsDb.open(
|
||||
dsDb = SQLiteDsDb[string, seq[byte]].open(
|
||||
path = dbPathAbs,
|
||||
flags = SQLITE_OPEN_READWRITE or SQLITE_OPEN_CREATE).tryGet()
|
||||
|
||||
@ -55,7 +55,7 @@ suite "Test Open SQLite Datastore DB":
|
||||
fileExists(dbPathAbs)
|
||||
|
||||
let
|
||||
dsDb = SQLiteDsDb.open(
|
||||
dsDb = SQLiteDsDb[string, seq[byte]].open(
|
||||
path = dbPathAbs,
|
||||
flags = SQLITE_OPEN_READONLY).tryGet()
|
||||
|
||||
@ -66,7 +66,7 @@ suite "Test Open SQLite Datastore DB":
|
||||
removeDir(basePathAbs)
|
||||
check:
|
||||
not fileExists(dbPathAbs)
|
||||
SQLiteDsDb.open(path = dbPathAbs).isErr
|
||||
SQLiteDsDb[string, seq[byte]].open(path = dbPathAbs).isErr
|
||||
|
||||
suite "Test SQLite Datastore DB operations":
|
||||
let
|
||||
@ -81,19 +81,19 @@ suite "Test SQLite Datastore DB operations":
|
||||
otherData = "some other data".toBytes
|
||||
|
||||
var
|
||||
dsDb: SQLiteDsDb
|
||||
readOnlyDb: SQLiteDsDb
|
||||
dsDb: SQLiteDsDb[string, seq[byte]]
|
||||
readOnlyDb: SQLiteDsDb[string, seq[byte]]
|
||||
|
||||
setupAll:
|
||||
removeDir(basePathAbs)
|
||||
require(not dirExists(basePathAbs))
|
||||
createDir(basePathAbs)
|
||||
|
||||
dsDb = SQLiteDsDb.open(
|
||||
dsDb = SQLiteDsDb[string, seq[byte]].open(
|
||||
path = dbPathAbs,
|
||||
flags = SQLITE_OPEN_READWRITE or SQLITE_OPEN_CREATE).tryGet()
|
||||
|
||||
readOnlyDb = SQLiteDsDb.open(
|
||||
readOnlyDb = SQLiteDsDb[string, seq[byte]].open(
|
||||
path = dbPathAbs,
|
||||
flags = SQLITE_OPEN_READONLY).tryGet()
|
||||
|
||||
@ -114,7 +114,7 @@ suite "Test SQLite Datastore DB operations":
|
||||
|
||||
var bytes: seq[byte]
|
||||
proc onData(s: RawStmtPtr) =
|
||||
bytes = dataCol(dsDb.getDataCol)
|
||||
bytes = dataCol[seq[byte]](dsDb.getDataCol)
|
||||
|
||||
check:
|
||||
dsDb.getStmt.query((key.id), onData).tryGet()
|
||||
@ -130,7 +130,7 @@ suite "Test SQLite Datastore DB operations":
|
||||
|
||||
var bytes: seq[byte]
|
||||
proc onData(s: RawStmtPtr) =
|
||||
bytes = dataCol(dsDb.getDataCol)
|
||||
bytes = dataCol[seq[byte]](dsDb.getDataCol)
|
||||
|
||||
check:
|
||||
dsDb.getStmt.query((key.id), onData).tryGet()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user