pyrqlite icon indicating copy to clipboard operation
pyrqlite copied to clipboard

If transactions are implemented in rqlite add support

Open otoolep opened this issue 6 years ago • 3 comments

The plan right now is to implement transaction support in rqlite 5.0. If this work completes, this library should be updated to take advantage of. See https://github.com/rqlite/rqlite/issues/266 for details of the proposed design.

When a cursor is first created, and assuming the system is not in autocommit mode, a transaction should be started (hit the proposed API on the rqlite node). Store the transaction ID on the cursor, which will prevent other cursors from writing within that transaction. The connection can commit or rollback the transaction at anytime, by hitting the same endpoint. Whether that call should supply the transaction ID is TBD.

It would be worth studying the behavior of the mainstream SQLite DB API 2.0 driver, to learn its behaviour.

otoolep avatar Apr 25 '18 17:04 otoolep

The new code may also have to deal with code like so (from the Django SQLite backend):

self.cursor().execute("BEGIN")

otoolep avatar Apr 25 '18 18:04 otoolep

I'm assuming there hasn't been any progress on this issue as of yet. How can I help?

thedrow avatar Jan 28 '21 09:01 thedrow

No, there hasn't been any progress yet. Transactions support -- as it's usually defined -- doesn't yet exist in rqlite.

otoolep avatar Jan 28 '21 12:01 otoolep