mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-08-03 17:48:17 +00:00
![]() This PR adds support for `DROP TABLE` and addresses issue https://github.com/tursodatabase/limbo/issues/894 It depends on https://github.com/tursodatabase/limbo/pull/785 being merged in because it requires the implementation of `free_page`. EDIT: The PR above has been merged. It adds the following: * an implementation for the `DropTable` AST instruction via a method called `translate_drop_table` * a couple of new instructions - `Destroy` and `DropTable`. The former is to modify physical b-tree pages and the latter is to modify in-memory structures like the schema hash table. * `btree_destroy` on `BTreeCursor` to walk the tree of pages for this table and place it in free list. * state machine traversal for both `btree_destroy` and `clear_overflow_pages` to ensure performant, correct code. * unit & tcl tests * modifies the `Null` instruction to follow SQLite semantics and accept a second register. It will set all registers in this range to null. This is required for `DROP TABLE`. The screenshots below have a comparison of the bytecodes generated via SQLite & Limbo. Limbo has the same instruction set except for the subroutines which involve opening an ephemeral table, copying over the triggers from the `sqlite_schema` table and then re-inserting them back into the `sqlite_schema` table. This is because `OpenEphemeral` is still a WIP and is being tracked at https://github.com/tursodatabase/limbo/pull/768   Reviewed-by: Pere Diaz Bou <pere-altea@homail.com> Closes #897 |
||
---|---|---|
.. | ||
btree.rs | ||
buffer_pool.rs | ||
database.rs | ||
mod.rs | ||
page_cache.rs | ||
pager.rs | ||
sqlite3_ondisk.rs | ||
wal.rs |