mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-25 12:04:21 +01:00
Closes: #1415 ### What this PR does 1. Removes database initialization from the `read_tx` function. 2. Adds checks for database initialization when executing `.schema`, `.indexes`, `.tables` and `.import` commands, as they rely on `sqlite_schema` table. ### About the second issue I think we have another solution for the second issue: create the `sqlite_schema` table in `Schema` only during page1 initialization, rather than during `Schema` initialization. #### Pros This approach has the advantage of unifying the logic for the `sqlite_schema` table with other user tables when running `select` statements #### Cons - we still need to check error codes for commands like `.schema`. - this approach may increase the complexity of the `pager` implementation. I'd like to hear your thoughts and feedback. Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com> Closes #2099