mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-30 06:24:21 +01:00
This PR make it possible to do 2 pretty crazy things with turso-db: 1. Now we can mix WAL frames inserts with SQL execution within same transaction. This will allow sync engine to execute rebase of local changes within atomically over main database file (the operation first require us to push new frames to physically revert local changes and then we need to replay local logical changes on top of the modified DB state) 2. Under `conn_raw_api` Cargo feature turso-db now expose method which allow caller to specify WAL file path. This dangerous capability exposed for sync-engine which maintain 2 databases: main one and "revert"-DB which shares same DB file but has it's own separate WAL. As sync-engine has full control over checkpoint - it can guarantee that DB file will be consistent with both main and "revert" DB WALs. Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com> Closes #2716