50 Commits

Author SHA1 Message Date
Arnaud
d366a9fdef
Apply method name changes
Signed-off-by: Arnaud <arnaud@status.im>
2024-12-06 17:40:49 +01:00
Ben Bierens
90a9053437
Support GCC-14 (#69)
* bump chronos

* bumps asynctest

* fixes asynctest imports

* bumps leveldbstatic

* bumps leveldb again

* pins asynctest version
2024-08-19 11:02:18 +03:00
Ben Bierens
f4989fcce5
LevelDB review (#65)
* Replaces stew-results with results package

* Applies leveldb batch-put

* links in dispose call to leveldb wrapper

* Handles trailing wildcards in leveldb query.

* Fixes tests for leveldb typed-ds.

* Adjusts exception handling in leveldbds to match what can be raised by leveldb iterator callbacks.

* Pulls in leveldbstatic 0.1.4

* Replaces replace with substring in leveldbds query

* Adds cmake to windows CI install
2024-05-23 09:31:49 -07:00
Dmitriy Ryajov
962c08c101
cleanup results import and some warnings (#64)
* cleanup results import and some warnings

* add some more push raises
2024-05-15 10:37:01 -07:00
Ben Bierens
0ee88a2a9b
Adds LevelDB Datastore (#63)
* set up leveldb-datastore

* Adds test for leveldb

* pulls in nim-leveldb by url and hash

* Fixes basic tests for leveldbds

* Implements query iterator

* Fixes include path for defaultImpl

* Review comments by Tomasz
2024-05-14 11:05:58 +02:00
Tomasz Bekas
6136eb608d
Addressing review comments by Dmitriy 2024-05-08 19:23:31 +02:00
Tomasz Bekas
50b480270f
TypedDatastore implementation 2024-05-08 14:14:47 +02:00
Dmitriy Ryajov
d02f2e7380
Proper dispose (#60)
* cleanup error handling

* properly dipose statements and connections

* db should be var now

* autodispose db
2024-01-15 20:00:42 -08:00
Tomasz Bekas
3c4daf4198 Fix review comments 2024-01-10 16:54:14 +01:00
Tomasz Bekas
0d1ca4b2cd
Bump nim to 1.6.16 2023-12-20 15:21:26 +01:00
Tomasz Bekas
a6ab178092 Fix broken tests 2023-12-20 10:16:28 +01:00
Tomasz Bekas
e2e31e07b3
Remove fail() 2023-12-20 09:09:06 +01:00
Tomasz Bekas
673778697f Replace require with check 2023-12-20 08:50:15 +01:00
Tomasz Bekas
3d901cb658
Move modify methods to the Datastore interface 2023-12-19 15:49:44 +01:00
Tomasz Bekas
f41bd9528e
Remove methods taking non-async functions 2023-12-04 13:39:43 +01:00
Tomasz Bekas
4c5ced6633 ModifyGet operations 2023-11-21 19:51:23 +01:00
Tomasz Bekas
52bbe9d429
Concurrent datastore interface & sqlite implementation 2023-11-15 14:28:20 +01:00
Dmitriy Ryajov
78a15b1123
Fix conflicting unit test (#45)
* setup the path correctly

* fix conflicting testing symbols

* don't test for nim 1.2

---------

Co-authored-by: Jaremy Creechley <creechley@gmail.com>
2023-09-11 13:21:01 -07:00
Dmitriy Ryajov
44c198b96a
rework contains to return a bool (#39) 2022-12-02 16:25:44 -06:00
Dmitriy Ryajov
9d49c8016e
Several fixes and missing features (#38)
* shorten lines

* only return data when `query.value == true`

* test `query.value = false`

* close mounted ds

* allow passing dispose to query iter constructor

* fix fs querying

* use currentSourcePath

* remove `dsobj` extensions from directories

* don't return error on missing key delete

* return `DatastoreKeyNotFound` on empty `get`

* return `DatastoreKeyNotFound` on missing sql key
2022-11-22 15:23:23 -06:00
Dmitriy Ryajov
6c06a3b095
Adding batching capabilities (#37)
* adding batch entry

* add batched put and delete

* add batched tests

* adding batching capabilities to remaining stores

* open db in readonly mode

* make naming consistent

* release prepared statements

* don't use deprecated add

* check file exists on test exit

* remove unused var
2022-09-30 08:24:26 -06:00
Dmitriy Ryajov
308b5c08be
Better fsds path sanitization (#31)
* add better path sanytizing

* rebase master

* Bugfixed and moved all checks into path()

* added check for empty basename in order to avoid bug in isValidFilename
* refactored - all filename checks are moved into path() function that constructs this filename

Co-authored-by: Bulat-Ziganshin <bulat.ziganshin@gmail.com>
2022-09-29 11:56:24 -06:00
Dmitriy Ryajov
f5dadd93be
Adding mounted store (#33)
* adding monted store

* misc spelling

* adding mounted store tests to suite

* split out key

* relaxed key initialization

* always mount and lookup by path

* cleaned up and reorged tests

* test lookup by path

* add re-exports

* more re-exports

* fix warnings and re-exports
2022-09-21 18:13:50 -06:00
Dmitriy Ryajov
446de6f978
Fsds query (#32)
* add basic query capabilities to fsds

* rename common tests

* make query tests common

* sanitize key

* check it's possible to query keys at same level
2022-09-20 18:18:33 -06:00
Dmitriy Ryajov
02167bb69e
Add proper sqlite query support (#30)
* Add query support for sqlite backend

* basic tests with in memory ds

* remove `close` default implementation
2022-09-20 14:41:54 -06:00
Dmitriy Ryajov
e6430b6b85
close db 2022-09-20 09:51:28 -06:00
Dmitriy Ryajov
a3781edc6a
remove path sanitization for now, address in upcoming pr 2022-09-20 09:16:56 -06:00
Dmitriy Ryajov
a045aa4ef1
close db 2022-09-19 23:11:57 -06:00
Dmitriy Ryajov
29577b6dd7
paths are already sanitized, removing allowed 2022-09-19 23:01:10 -06:00
Dmitriy Ryajov
9901e71a88
add basic tests to tired ds 2022-09-19 17:23:19 -06:00
Dmitriy Ryajov
39258e5f73
remove null ds 2022-09-19 17:14:15 -06:00
Dmitriy Ryajov
c60ff35bdd
cleanup tired db tests 2022-09-19 17:14:06 -06:00
Dmitriy Ryajov
1f97a923fa
fix query basic test 2022-09-19 17:13:46 -06:00
Dmitriy Ryajov
60e0ea5573
get rid of null datastore 2022-09-19 17:12:52 -06:00
Dmitriy Ryajov
f5c7a3c02b
add common basic tests 2022-09-19 15:54:29 -06:00
Dmitriy Ryajov
86b13495f1
rename tests 2022-09-19 15:54:19 -06:00
Dmitriy Ryajov
36655e318a
cleanup tests 2022-09-19 15:53:38 -06:00
Dmitriy Ryajov
c7df334836
rename sql tests 2022-09-16 21:15:43 -06:00
Dmitriy Ryajov
5d29ad905d
add sql backend tests 2022-09-16 21:15:28 -06:00
Dmitriy Ryajov
77807d8948
wip: rework sql store tests 2022-09-16 21:15:08 -06:00
Dmitriy Ryajov
acd77c5385
rename and cleanup fs store tests 2022-09-16 21:14:02 -06:00
Dmitriy Ryajov
f0f979539f
cleanup key tests 2022-09-16 21:13:03 -06:00
Dmitriy Ryajov
78653d9dd4
wip 2022-09-12 12:30:52 -06:00
Dmitriy Ryajov
ed6842b743
simplify key api 2022-09-10 13:50:05 -06:00
Michael Bradley, Jr
2769ce1de2 refactor Datastore impls so root/basePath creation is user's responsibility 2022-08-08 16:33:54 -05:00
Michael Bradley, Jr
249f63a589 add basic query implementation 2022-07-21 13:20:43 -05:00
Michael Bradley, Jr
bf6724b30a
capitalize AS so as to be consistent with capitalizing SELECT, etc. 2022-07-15 11:11:53 -05:00
Michael Bradley, Jr
ca9ee12aeb check column metadata in id/data/timestampCol
The goal is to detect mismatches between caller-supplied indexes and original
column names, and in that case crash the process by raising Defect. This should
help avoid harder to debug errors for such mismatches.

These helper procs are now higher-order, which allows column metadata checks to
be run only once, i.e. when setting up derivative helpers to be used in an
`onData` callback.

Use compile-time constants for column names and default indexes.

Adjust callback proc annotations to be more precise, and remove unnecessary
annotations.
2022-07-15 10:56:45 -05:00
Michael Bradley, Jr
0c5d805257
refactor base API to be async
and refactor Datastore impls and tests accordingly

Closes #7
2022-07-04 22:28:41 -05:00
Michael Bradley, Jr
a9b00efbd6 initial implementation 2022-06-22 13:16:43 -05:00