dqlite icon indicating copy to clipboard operation
dqlite copied to clipboard

Support the RETURNING clause

Open cole-miller opened this issue 1 year ago • 2 comments

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.

cole-miller avatar Jul 22 '23 14:07 cole-miller

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

nginx-nickc avatar Aug 29 '23 21:08 nginx-nickc

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

MathieuBordere avatar Aug 30 '23 11:08 MathieuBordere