mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-25 12:04:21 +01:00
Closes #1528 . - Modified `translate_select` so that the caller can define if the statement is top-level statement or a subquery. - Refactored `translate_insert` to offload the translation of multi-row VALUES and SELECT statements to `translate_select` - I did not try to change much of `populate_column_registers` as I did not want to break `translate_virtual_table_insert`. Ideally, I would want to unite this remaining logic folding `populate_column_registers` into `populate_columns_multiple_rows` and the `translate_virtual_table_insert` into `translate_insert`. But, I think this may be best suited for a separate PR. ## TODO - ~Tests~ - *Done* - ~Need to emit a temp table when we are selecting and inserting into the Same Table - https://github.com/sqlite/sqlite/blob/master/src/insert.c#L1369~ - *Done* - Optimization when table have the exact same schema - open an Issue about it - Virtual Tables do not benefit yet from this feature - open an Issue about it Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com> Closes #1566
Integration and regression test suite.
# run all tests
cargo test
# run individual test
cargo test test_sequential_write -- --nocapture