Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
commit: |
createNodePostgresClient returns kind 'unknown' for every Postgres error except syntax errors (which only match via the SQLite message fallback). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
createNodePostgresClient errors now get a real SqlfuError.kind. The classifier reads the SQLSTATE from the pg error's .code and is picked by client.system, so the SQLite adapters are unchanged. mapSqliteDriverError is renamed mapDriverError since it now covers both. Removes the Errors note from the Postgres guide's Known gaps, adds a kind -> SQLite / SQLSTATE table to docs/errors.md, and ticks the step-three item in tasks/pg.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #156 (
pg-docs). Merge that first.Postgres errors from
createNodePostgresClientnow get a realSqlfuError.kind, mapped from the SQLSTATE. Until now every Postgres error came back askind: 'unknown'.syntax42601missing_table42P01missing_column42703unique_violation23505(primary keys too)not_null_violation23502foreign_key_violation23503check_violation23514transient40001serialization failure,40P01deadlock,55P03lock not availableEverything else stays
'unknown', and the SQLSTATE is still on.cause.code.classifyPostgresErrorinpackages/sqlfu/src/errors.tsmapSqliteDriverError→mapDriverError, picking the classifier bysystemwrapSyncClientErrors/wrapAsyncClientErrorsalready readclient.system.'postgresql'now gets the SQLSTATE classifier, so none of the 12 SQLite adapters change.packages/pg/test/client-errors.test.tsunknowncase, each produced by a real Postgres (the docker-compose one CI already runs for@sqlfu/pg). The transient tests make real lock contention:for update nowaitagainst a held row lock, and a repeatable-read write conflict.docs/errors.md,docs/guides/postgres.md,README.md'unknown'" notes (added in #156). Add a kind → SQLite / SQLSTATE table to the errors page.tasks/pg.md,tasks/complete/2026-10-29-pg-error-kinds.mdDecisions worth a look:
transientmeans lock contention or a serialization conflict, where retrying the transaction usually works, like SQLite's BUSY/LOCKED. Connection-level failures (class08,57P01,53300) stayunknown.permission_denied(42501) for when pg landed. That's left for a follow-up.syntaxtest already passed, but only because the SQLite message fallback matched "syntax error at or near". Postgres errors no longer go through that fallback.Session:
cae4911f-3ee7-4867-864d-076bcf92f7ac🤖 Generated with Claude Code