Skip to content

fix(graphile): qualify built-in plugin SQL - #1748

Draft
Zetazzz wants to merge 1 commit into
test/performance-harness-corefrom
agent/graphile-sql-qualification
Draft

fix(graphile): qualify built-in plugin SQL#1748
Zetazzz wants to merge 1 commit into
test/performance-harness-corefrom
agent/graphile-sql-qualification

Conversation

@Zetazzz

@Zetazzz Zetazzz commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Implements F07 from constructive-io/constructive-planning#1693 on top of the shared performance harness in #1716.

What changed

  • Quotes catalog-derived identifiers in graphile-bulk-mutations.
  • Resolves i18n base/translation tables by exact service, schema, and physical resource identity.
  • Binds graphile-llm RAG chunk SQL to the exact table and pgvector namespace.
  • Qualifies ltree helper functions, casts, and operators using the introspected extension identity.
  • Qualifies PostGIS types and infix operators using the exact extension namespace.
  • Gathers per-service pg_trgm/pgvector namespaces for graphile-search and qualifies trigram, vector, and BM25 SQL.
  • Fails closed when required service/schema identity is missing, inconsistent, or ambiguous.

This removes search_path-dependent resolution and prevents hostile catalog identifiers from changing generated SQL.

Architecture boundary

This PR is intentionally limited to F07:

  • no cache ownership or lifecycle changes (F08)
  • no request-context or pgSettings changes (F13)
  • no storage snapshot changes (F14)
  • no unrelated formatting-only changes

Existing module/closure cache ownership remains unchanged.

Validation

  • frozen lockfile install
  • shared perf harness: 5 suites / 7 tests; CJS and ESM build
  • graphile-ltree: 2 suites / 17 tests
  • graphile-postgis: 15 suites / 253 tests
  • graphile-i18n: 2 suites / 7 tests
  • graphile-search: 6 suites / 83 tests
  • graphile-bulk-mutations F07 identifier tests: 2 tests
  • graphile-llm without the explicitly real-Ollama suites: 4 suites / 57 tests (11 real-Ollama tests skipped)
  • CJS and ESM builds for all six affected packages
  • ESLint on all changed TypeScript files
  • Prettier check on all new files
  • git diff --check
  • verified no modified file disappears under an ignore-all-space diff

Known environment/baseline limitations:

  • The existing graphile-bulk-mutations integration fixture fails with permission denied for schema bulk_test because its seed creates the schema without granting the execution role; the new identifier tests pass independently.
  • The two suites explicitly requiring a live local Ollama instance were excluded; all non-Ollama LLM tests, including the new RAG qualification tests, pass.

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