29 Commits

Author SHA1 Message Date
Dmitriy Ryajov
acd77c5385
rename and cleanup fs store tests 2022-09-16 21:14:02 -06:00
Dmitriy Ryajov
2390839406
rename and cleanup fs store 2022-09-16 21:13:25 -06:00
Dmitriy Ryajov
f0f979539f
cleanup key tests 2022-09-16 21:13:03 -06:00
Dmitriy Ryajov
b150b2f922
cleanup key 2022-09-16 21:12:49 -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
d5d986c014 revise order of definitions in datastore/sqlite.nim
in some complex builds, e.g. `make testAll` of nim-codex, the previous order
resulted in compilation errors
2022-07-27 15:24:43 -05:00
Michael Bradley, Jr
249f63a589 add basic query implementation 2022-07-21 13:20:43 -05:00
Michael Bradley, Jr
fb5ce62532 switch to sqlite3_prepare_v3 and supply default prepFlags
for long-lived prepared statements in datastore/sqlite_datastore.nim use
`prepFlags = SQLITE_PREPARE_PERSISTENT`

closes #13
2022-07-20 17:11:48 -05:00
Michael Bradley, Jr
96695fed47
implement sqlite3_column_text_not_null in datastore/sqlite.nim
consolidate calls re: `SQLiteDatastore.new` and `idCol`
2022-07-15 11:11:56 -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
18df425b09
include SQL statement in error messages of checkColMetadata 2022-07-15 11:11:50 -05:00
Michael Bradley, Jr
a73c58c632
do not need to check dataLen re: OOM error (and the check was incorrect anyway) 2022-07-15 11:11:47 -05:00
Michael Bradley, Jr
a68c4caa8e
define and use constants for column indexes re: methods contains and get 2022-07-15 11:11:43 -05:00
Michael Bradley, Jr
0df3e2424d
export ColName constants 2022-07-15 11:11:40 -05:00
Michael Bradley, Jr
aee7f7b57c
remove ColIndex constants and default values for index parameters in id/data/timestampCol 2022-07-15 11:11:37 -05:00
Michael Bradley, Jr
a62fffcb3f
convert checkColMetadata from a template to a proc 2022-07-15 11:11:33 -05:00
Michael Bradley, Jr
89051a38ea
refactor repeated "check column metadata" code into a template 2022-07-15 11:11:30 -05:00
Michael Bradley, Jr
9131323747
improve error message for mismatch between index and column metadata 2022-07-15 11:11:27 -05:00
Michael Bradley, Jr
ca8ab350c4 ci: suppress overly verbose hints/warnings at compile-time 2022-07-15 10:56:45 -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
f634c2f5ae check for out-of-memory errors re: sqlite3_column_text/blob/bytes
closes #2
2022-07-15 10:56:45 -05:00
Michael Bradley, Jr
1a1a1ac642 ci: speedup the Tests workflow in GitHub Actions
Don't build with Nim v1.4, building with v1.2 and v1.6 should be enough.

Don't manually run `brew update` because `brew` will automatically do that on
an as-needed basis when running `brew install`.
2022-07-04 23:06:09 -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
3237e87130 improve bindParam handling of empty blobs
Per SQLite's docs, `sqlite3_bind_blob(s, n.cint, nil, 0.cint, nil)` is
equivalent to `sqlite3_bind_null(s, n.cint)` but the intent of the latter is
clearer.
2022-06-22 16:07:18 -05:00
Michael Bradley, Jr
b9eef2a5b4 improve bindParam handling of uint and float types 2022-06-22 16:07:18 -05:00
Michael Bradley, Jr
a9b00efbd6 initial implementation 2022-06-22 13:16:43 -05:00
Michael Bradley, Jr
45ddb0e3b7
first commit 2022-05-11 10:50:42 -05:00