Add scoped query discovery - #22
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.
Summary
Adds agent-friendly discovery for connection-scoped queries while preserving legacy public API behavior.
--list-queriesnow returns a scoped discovery object with global and per-connection query names.--list-queries legacykeeps the previous flat global-query list output available.list_queries(config_path)keeps returning global query names by default.list_queries(config_path, scoped=True)returns global and connection-specific discovery.list_queries(config_path, connection="...")returns effective query names for a connection with scoped names de-duplicated over globals.Verification
.venv/bin/python -m pytest tests/test_cli.py::TestListQueries tests/test_sql2json.py::test_list_queries_keeps_legacy_global_query_list_by_default tests/test_sql2json.py::test_list_queries_can_return_scoped_discovery_shape tests/test_sql2json.py::test_list_queries_can_return_effective_query_names_for_a_connection -q— 7 passed.venv/bin/python -m pytest -q— 138 passed, 12 deselected.venv/bin/black --check sql2json tests— passed.venv/bin/flake8 sql2json tests— passed.venv/bin/python -m mypy sql2json— passed