This commit is contained in:
Jaremy Creechley 2023-10-20 16:18:18 -07:00
parent a8da4c4f38
commit 4844f7dad0
No known key found for this signature in database
GPG Key ID: 4E66FB67B21D3300
2 changed files with 5 additions and 6 deletions

View File

@ -3,6 +3,8 @@
--styleCheck:usages
--styleCheck:error
--d:"datastoreUseAsync=false"
when (NimMajor, NimMinor) == (1, 2):
switch("hint", "Processing:off")
switch("hint", "XDeclaredButNotUsed:off")

View File

@ -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)