Skip to content

feat(persistence): PostgreSQL composite params + :of-type modifier#119

Open
smunini wants to merge 1 commit into
feat/pg-search-sort-modifiersfrom
feat/pg-search-composite-oftype
Open

feat(persistence): PostgreSQL composite params + :of-type modifier#119
smunini wants to merge 1 commit into
feat/pg-search-sort-modifiersfrom
feat/pg-search-composite-oftype

Conversation

@smunini
Copy link
Copy Markdown
Contributor

@smunini smunini commented Jun 3, 2026

Stacked on #118.

Context

Continues PostgreSQL→SQLite search parity. Before this PR, PostgreSQL returned no condition for composite parameters and ignored the :of-type modifier.

Changes

  • Composite parametersbuild_composite_condition splits the $-separated value, builds a bare column predicate per component (token / string / number / quantity / date) against a single search_index row, and scopes it to the composite parameter name. Mirrors the SQLite handler.
  • :of-type token modifier — matches an Identifier by type-system|type-code|identifier-value using the value_identifier_type_system / value_identifier_type_code columns.

Reachability note

Both are implemented at the backend SQL level. As with SQLite, the shared extractor does not populate composite_group / identifier-type columns during indexing, and the REST layer builds outgoing params with empty components. So these are reachable via the direct backend API (verified by unit tests), not yet end-to-end over HTTP. This is documented in docs/search-spec-assessment.md (composite caveat + roadmap item) and the matrix notes. Wiring composite components through REST is a follow-up that benefits all backends.

Docs

Matrix: PostgreSQL Composite and :of-type ○ → ✓, with a clarifying composite note. Phase 5b status and assessment doc updated.

Tests

query_builder unit tests: composite token+quantity SQL (column refs + param count), the no-components guard returns None, and :of-type identifier SQL. Full PG integration search suite still green; clippy -D warnings clean.

… modifier

Brings the PostgreSQL search backend to near-parity with SQLite.

- Composite parameters: `build_composite_condition` splits the `$`-separated
  value, builds a bare column predicate per component (token / string / number
  / quantity / date) against a single search_index row, and scopes it to the
  composite parameter name — mirroring the SQLite handler.
- `:of-type` token modifier: matches an Identifier by `type-system|type-code|
  identifier-value`, using the value_identifier_type_system/code columns.

Both are implemented at the backend SQL level. As with SQLite, the shared
extractor does not populate composite_group / identifier-type columns and the
REST layer does not yet wire composite component definitions, so these are
reachable via the direct backend API; documented in the assessment.

Matrix: PostgreSQL Composite and :of-type ○ → ✓. Updated the composite note,
Phase 5b status, and search-spec-assessment.md accordingly.

Tests: query_builder unit tests for composite token+quantity SQL, the
no-components guard, and :of-type identifier SQL.
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