Repository navigation
Expose query root and declared tables to the frontend - #1498
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1488
GET /frontend/state(with--frontend) now returns, when ready,{"error": null, "root": "<abs query root>", "tables": [{"name", "columns": [{"name", "type"}]}]}. 503{"error": ...}on config failure is unchanged.POST /queryis unchanged. Implemented once in the Rust core (DirSQL::root(),DirSQL::tables()), so all three CLI distributions share it.Choices
/frontend/staterather than add a route.pragma_table_list+pragma_table_xinfo); no parsers, no walk, no counts.""if untyped); hidden vtab columns omitted._dirsql_*,sqlite_*, virtual tables and their shadows, temp path-tables.root/tables, only the existingerror.Red/green
frontend_state_*and updatedfrontend_*e2e fail on missingtables/root).Manual
Built
dirsql, randirsql server --frontend --port Nin a temp dir:-c .dirsql.toml(tablesposts, and an empty"order"with a"two words"column): 200 with both tables,root/tmp/m1488;POST /querystill[]for an empty select.{"error":null,"root":"/tmp/m1488","tables":[]}.-c missing.toml: 503{"error":"failed to resolve missing.toml: ..."}.E2E Verification
cargo test -p dirsql --features cli --lib --test cli_integration --test cli_e2egreen.pytest tests/e2e/cli_version_test.py query_contract_test.py declared_table_name_test.py on_file_query_test.pygreen (16 passed), receipt committed.pnpm test:e2egreen (18 passed), receipt committed.Changelog / Migrations
packages/rust/changelog.d/packages/rust/migrations.d/