canonical / dqlite

Embeddable, replicated and fault-tolerant SQL engine.
https://dqlite.io
Other
3.8k stars 214 forks source link

Implement dqlite_server API #514

Closed cole-miller closed 1 year ago

cole-miller commented 1 year ago

Finally! Still need to add a test or two, but I have run a sample program through the whole dqlite_server lifecycle successfully on my machine. Progress on #291 -- this contains only the dqliteserver* functions, with the SQLite-like parts of the API left for a separate PR.

Signed-off-by: Cole Miller cole.miller@canonical.com

codecov[bot] commented 1 year ago

Codecov Report

Merging #514 (01397fe) into master (118828d) will increase coverage by 0.29%. The diff coverage is 59.95%.

:exclamation: Current head 01397fe differs from pull request most recent head c499ab1. Consider uploading reports for the commit c499ab1 to get more accurate results

@@            Coverage Diff             @@
##           master     #514      +/-   ##
==========================================
+ Coverage   61.00%   61.30%   +0.29%     
==========================================
  Files          34       34              
  Lines        6350     6809     +459     
  Branches     1888     2024     +136     
==========================================
+ Hits         3874     4174     +300     
- Misses       1293     1346      +53     
- Partials     1183     1289     +106     
Impacted Files Coverage Δ
src/client/protocol.c 44.02% <56.25%> (+1.52%) :arrow_up:
src/server.c 58.72% <60.08%> (+2.42%) :arrow_up:

... and 2 files with indirect coverage changes

freeekanayaka commented 1 year ago

Thanks, diff and commits look definitely more manageable review-wise. I'll wait for the tests before digging deeper.

cole-miller commented 1 year ago

Feel free to suggest a better name than easy for this new functionality :)

cole-miller commented 1 year ago

@freeekanayaka I'll add some tests covering error conditions as well.

freeekanayaka commented 1 year ago

@freeekanayaka I'll add some tests covering error conditions as well.

At first I would probably focus on the most likely error conditions, like the given directory not being there, or a file being missing or corrupted. Even a few tests covering that would be great.

cole-miller commented 1 year ago

Hmm, GHA tests seem to be hanging, but I can't reproduce locally. Looking into it.

cole-miller commented 1 year ago

Fixed!