From 61c14e487ca4de5acee92e0d8ee8983ee887420c Mon Sep 17 00:00:00 2001 From: Jaremy Creechley Date: Thu, 28 Sep 2023 18:24:31 -0700 Subject: [PATCH] reorg --- datastore/fsds.nim | 2 +- datastore/sql.nim | 5 ++--- datastore/threads/backend.nim | 3 ++- tests/datastore/testsql.nim | 1 - tests/datastore/threads/testthreadproxyds.nim | 1 - 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/datastore/fsds.nim b/datastore/fsds.nim index 8e9703a..40e7c03 100644 --- a/datastore/fsds.nim +++ b/datastore/fsds.nim @@ -56,7 +56,7 @@ method close*(self: FSDatastore): Future[?!void] {.async.} = proc new*( T: type FSDatastore, root: string, - tp: Taskpool, + tp: Taskpool = Taskpool.new(4), depth = 2, caseSensitive = true, ignoreProtected = false diff --git a/datastore/sql.nim b/datastore/sql.nim index 5946ba6..6f64df8 100644 --- a/datastore/sql.nim +++ b/datastore/sql.nim @@ -14,7 +14,7 @@ import ./threads/sqlbackend import ./threads/threadproxy import ./datastore -export datastore, keys, query, Taskpool, Memory +export datastore, keys, query, Taskpool, Memory, DbExt push: {.upraises: [].} @@ -63,11 +63,10 @@ method query*(self: SQLiteDatastore, proc new*( T: type SQLiteDatastore, path: string, - tp: Taskpool, + tp: Taskpool = Taskpool.new(4), readOnly = false): ?!SQLiteDatastore = let backend = ? newSQLiteBackend[KeyId, DataBuffer](path, readOnly) db = ? ThreadProxy.new(backend, tp = tp) success SQLiteDatastore(db: db) - diff --git a/datastore/threads/backend.nim b/datastore/threads/backend.nim index f6e3c81..2faf9b7 100644 --- a/datastore/threads/backend.nim +++ b/datastore/threads/backend.nim @@ -5,8 +5,9 @@ import pkg/questionable/results import ./databuffer import ../types +import ../key -export databuffer, types, SortOrder +export databuffer, types, key, SortOrder ## Types for datastore backends. ## diff --git a/tests/datastore/testsql.nim b/tests/datastore/testsql.nim index a8c8ef8..d17b55f 100644 --- a/tests/datastore/testsql.nim +++ b/tests/datastore/testsql.nim @@ -25,7 +25,6 @@ suite "Test Basic SQLiteDatastore": basicStoreTests(ds, key, bytes, otherBytes) - suite "Test Read Only SQLiteDatastore": let path = currentSourcePath() # get this file's name diff --git a/tests/datastore/threads/testthreadproxyds.nim b/tests/datastore/threads/testthreadproxyds.nim index 75e3d85..c3ef153 100644 --- a/tests/datastore/threads/testthreadproxyds.nim +++ b/tests/datastore/threads/testthreadproxyds.nim @@ -33,7 +33,6 @@ var for i in 1..N: suite "Test Basic ThreadDatastore with SQLite " & $i: - var ds: SQLiteDatastore key = Key.init("/a/b").tryGet()