Skip to content

refactor!: move to the pdbcore API hygiene release - #133

Merged
archlemon merged 4 commits into
mainfrom
refactor/pdbcore-b15
Nov 24, 2026
Merged

archlemon merged 4 commits into
mainfrom
refactor/pdbcore-b15

Conversation

@archlemon

@archlemon archlemon commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Moves pdbq to the pdbcore changes in suprbdev/pdbcore PRs 89 (shared smart-tag checks), 93 (API hygiene) and 92 (schema order, env and duration checks). It pins the tagged release pdbcore v0.19.0, which contains all three.

Rebased on main, which gained the audit fixes from PR 134 (SETOF list limits and pricing, APQ authentication before registration and the byte-bounded store, per-field savepoint rerun, server.request_timeout of at least 1s, EWKT SRID mismatch as invalid_argument, /schema.graphql auth). Only CHANGELOG.md conflicted; both sides' entries are kept in the Unreleased sections. Everything else merged cleanly: the SRID check sits next to the new postgis.OutputSQL calls, and config validation has the request_timeout check and the new persisted_queries keys alongside RemovedKeys and ValidateDatabase.

Shared smart-tag checks

  • internal/omit and smart_comments drop their local copies of the PR 127 logic and use pdbcore's.
  • smarttags.Omits now maps -filterBy / -orderBy and the deprecated -filter / -order.
  • smartcomments/catalog.Check reports unknown @omit actions and unknown or deprecated @behavior tokens. pdbq passes its own vocabulary: its @omit actions plus the aggregates @behavior tokens.
  • The warnings and their tests are unchanged, and pdbr now reports the same ones.

Config (user-visible, in CHANGELOG.md and docs/upgrading.md)

  • transactions.mutations and plugins.settings.nested_mutations.force_transactions are now reported as unknown key …: removed: <reason>, from the new RemovedKeys map.
  • PDBQ_ROLES__ALLOWED-style variables, with a doubled underscore after the section, are errors with a did-you-mean hint. They used to be ignored silently.
  • New validation, through the new confx.ValidateDatabase and the extended shared validators:
    • database.connect_timeout must be positive
    • database.max_conns and database.statement_timeout must not be negative
    • auth.jwt.jwks_cache_ttl must be positive when a JWKS URL is set
    • watch.poll_interval must be positive when the watch is on
  • transactions.isolation errors name the accepted values.
  • The reference config keeps pdbq's wording for the shared doc tags through confx.WithDoc. Only the new constraint notes on database.max_conns, connect_timeout and watch.poll_interval change in examples/pdbq.example.yaml.

Embedding API

pdbq.LoadConfig(path, flags) takes map[string]any. cliflags.Changed from pdbcore/confx/cliflags builds that map from a pflag set.

Internal

  • Error messages come from pgexec.Classify.
  • PostGIS output uses postgis.OutputSQL(ref, Output{…}), and Ops(), Deriveds() and RasterAccessors() are accessor calls.
  • The watcher is built with watch.New and gets Run's context in OnChange.
  • Contract views report an unknown policy.
  • The SQL goldens are unchanged (checked with go test ./internal/compile/ -update).

Tests

  • go test -race ./..., go vet, golangci-lint, act lint-test
  • DB e2e (./test/) on PostGIS 18 with pgvector
  • FuzzFilter / FuzzSpatial, 10s each

- The omit and behavior smart-tag checks use pdbcore's shared
  vocabulary (smarttags.Check via smartcomments/catalog.Check), so pdbq
  and pdbr warn about the same comments; omit.Hides reads the v5
  spellings from smarttags.Omits.
- LoadConfig and config.Load take command-line values as a map
  (cliflags.Changed builds it); removed keys name the reason they were
  removed.
- Doubled underscores after a section in PDBQ_* variables are errors,
  and database.connect_timeout, max_conns, statement_timeout and
  watch.poll_interval are validated.
- Error messages come from pgexec.Classify; postgis output uses
  OutputSQL with options; the watcher is built with watch.New.
- The reference config keeps pdbq's wording for the shared doc tags.
@archlemon
archlemon force-pushed the refactor/pdbcore-b15 branch from 7a429d8 to 2f68177 Compare November 24, 2026 02:02
@archlemon
archlemon merged commit 78e74cc into main Nov 24, 2026
4 checks passed
@archlemon
archlemon deleted the refactor/pdbcore-b15 branch November 24, 2026 02:11
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