Skip to content

Add scoped query discovery - #22

Merged
fsistemas merged 1 commit into
masterfrom
linear/fra-247-query-discovery-api
Jun 23, 2026
Merged

Add scoped query discovery#22
fsistemas merged 1 commit into
masterfrom
linear/fra-247-query-discovery-api

Conversation

@fsistemas

Copy link
Copy Markdown
Owner

Summary

Adds agent-friendly discovery for connection-scoped queries while preserving legacy public API behavior.

  • --list-queries now returns a scoped discovery object with global and per-connection query names.
  • --list-queries legacy keeps 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

@fsistemas
fsistemas merged commit 646d65b into master Jun 23, 2026
6 checks passed
@fsistemas
fsistemas deleted the linear/fra-247-query-discovery-api branch June 23, 2026 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant