mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-25 03:54:21 +01:00
We were incorrectly setting `moved_before` as `false` after checking for unique constraint violation, but the reality is that after the uniqueness check, we are already correctly positioned -- if no match was found, the cursor is positioned at either: a) no row, or b) at the first entry that is greater than the key we are inserting. This means we don't have to move anymore and can just insert.
Integration and regression test suite.
# run all tests
cargo test
# run individual test
cargo test test_sequential_write -- --nocapture