mirror of
https://github.com/allankoechke/turso.git
synced 2026-11-30 11:12:58 +00:00
Auto-attaches persisted PostgreSQL schema sidecar databases during tursopg startup. `CREATE SCHEMA` stores non-public schemas as sidecar database files. This change runs the existing schema auto-attach step before dispatching to server, one-shot SQL, stdin, or interactive CLI modes, so schema- qualified queries continue to work after reopening the main database. Adds a CLI regression test that creates a schema/table in one tursopg process and reads it back from a second process using the same file- backed database. Before this change, sidecar schema files persisted on disk, but the regular CLI startup path did not reattach them. Reopening the main database and querying `schema.table` failed with `no such database` until `CREATE SCHEMA` was run again. This makes persisted schema behavior consistent across tursopg startup modes. I used AI for codebase navigation, debugging guidance, and review of the implementation approach and tests. The implementation itself was written and reviewed by me Reviewed-by: Mikaël Francoeur (@LeMikaelF) Closes #8084