canonical / dqlite

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

Support QUERY and QUERY_SQL that modify the database #477

Closed cole-miller closed 1 year ago

cole-miller commented 1 year ago

Closes #471. This is based on #476, I'll rebase onto master once that merges.

As suggested by @freeekanayaka, we don't support modifying statements that also return rows (for now). Modifying statements submitted with QUERY or QUERY_SQL go through exactly the same codepath as if submitted with EXEC or EXEC_SQL, respectively, except that we send an empty ROWS response instead of a RESULT response.

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

codecov[bot] commented 1 year ago

Codecov Report

Merging #477 (d564cfd) into master (e9b38ad) will increase coverage by 0.12%. The diff coverage is 54.00%.

@@            Coverage Diff             @@
##           master     #477      +/-   ##
==========================================
+ Coverage   58.73%   58.85%   +0.12%     
==========================================
  Files          33       33              
  Lines        5869     5916      +47     
  Branches     1762     1778      +16     
==========================================
+ Hits         3447     3482      +35     
  Misses       1358     1358              
- Partials     1064     1076      +12     
Impacted Files Coverage Δ
src/gateway.c 43.00% <54.00%> (+0.82%) :arrow_up:
src/transport.c 51.29% <0.00%> (+5.19%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

cole-miller commented 1 year ago

Rebased and ready for review.