canonical / dqlite

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

Support the RETURNING clause #527

Open cole-miller opened 1 year ago

cole-miller commented 1 year ago

We already have support for QUERY requests that modify the database, but the codepath that executes those requests assumes that all modifications are propagated to the WAL after the first call to sqlite3_step, which is not the case for a statement like DELETE FROM tab RETURNING col. Copying my comment from #472:

the "database changes occur during the first sqlite3_step" statement does not mean the changes will get flushed to the WAL at that point, they might remain in cache up until autocommit happens just before the sqlite3_step call that returns SQLITE_DONE. That makes things a bit difficult for us, since we want to VfsPoll and raft_apply before yielding any rows to the client. We could buffer all the rows up in memory, but that pretty much defeats the purpose of sending them to the client in batches. Alternatively, we could force a cache flush immediately after the first sqlite3_step.

nginx-nickc commented 1 year ago

hi, just wondering what's the current plan for this?

MathieuBordere commented 1 year ago

hi @nginx-nickc it's currently not very high on the priority list, no ETA at the moment.