Skip to content

Bound PostgreSQL schema suggestion queries - #32

Draft
joe-thom wants to merge 1 commit into
mainfrom
joe-thom/clo2-222-bound-schema-suggestion-queries
Draft

Bound PostgreSQL schema suggestion queries#32
joe-thom wants to merge 1 commit into
mainfrom
joe-thom/clo2-222-bound-schema-suggestion-queries

Conversation

@joe-thom

@joe-thom joe-thom commented Sep 8, 2026

Copy link
Copy Markdown

What changed

PostgreSQL schema suggestions can now check only whether a table contains data. Interactive schema prompts keep exact row counts by default, while automated callers can stop after the first row.

Why

The agent schema check runs against production read replicas. Full-table counts can run for more than two minutes and then fail when PostgreSQL recovery removes old row versions.

Since August 31, Datadog retained 310 matching production failures across 57 Repls. One newly reported Repl produced 26 retained failures of about 126 to 131 seconds each.

References CLO2-222
Project: DB Sprint
Support thread: Cloud support request

Validation

  • pnpm --dir drizzle-kit exec vitest run tests/pgSuggestions.test.ts
  • pnpm --filter @drizzle-team/drizzle-kit tsc
  • pnpm lint

The JavaScript and declaration build completed. The final local attw package check crashed while reading an undefined filename.

Rollout

Publish @drizzle-team/drizzle-kit@0.32.3 after merge. Then update pid2 to request the new exists mode for agent schema checks.

A revert is safe. Exact counts remain the default, and this PR writes no database state.

~ written by Zerg 馃懢 (wp-cc5da088)
Linear project: DB Sprint

@joe-thom joe-thom added the zergling-authored Authored by a Zerg zergling label Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

zergling-authored Authored by a Zerg zergling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant