From 4844f7dad0275800916e3f2c7a7b6373b065087b Mon Sep 17 00:00:00 2001 From: Jaremy Creechley Date: Fri, 20 Oct 2023 16:18:18 -0700 Subject: [PATCH] updates --- config.nims | 2 ++ datastore/sql.nim | 9 +++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/config.nims b/config.nims index ed3a531..c9ad156 100644 --- a/config.nims +++ b/config.nims @@ -3,6 +3,8 @@ --styleCheck:usages --styleCheck:error +--d:"datastoreUseAsync=false" + when (NimMajor, NimMinor) == (1, 2): switch("hint", "Processing:off") switch("hint", "XDeclaredButNotUsed:off") diff --git a/datastore/sql.nim b/datastore/sql.nim index ab0490a..6ecf7d7 100644 --- a/datastore/sql.nim +++ b/datastore/sql.nim @@ -78,17 +78,14 @@ else: type SQLiteDatastore* = ref object of Datastore readOnly: bool - db: SQLiteDsDb + db: SQLiteDsDb[string, seq[byte]] proc path*(self: SQLiteDatastore): string = - self.db.dbPath + $self.db.dbPath proc `readOnly=`*(self: SQLiteDatastore): bool {.error: "readOnly should not be assigned".} - proc timestamp*(t = epochTime()): int64 = - (t * 1_000_000).int64 - method has*(self: SQLiteDatastore, key: Key): Future[?!bool] {.async.} = var exists = false @@ -129,7 +126,7 @@ else: bytes: seq[byte] proc onData(s: RawStmtPtr) = - bytes = self.db.getDataCol() + bytes = dataCol[seq[byte]](self.db.getDataCol) if err =? self.db.getStmt.query((key.id), onData).errorOption: return failure(err)