fix(postgres): auto-name unnamed indexes + release pg client once (1.4.1) - #33
Merged
Merged
Conversation
…4.1) #31: a `postgres.indexes` entry without a `name` generated `CREATE [UNIQUE] INDEX "" ...` -> "zero-length delimited identifier", failing table creation. Derive a name (`<table>_<cols>_idx`, `_key` for unique, truncated to 63 chars) when omitted, mirroring Postgres's own default naming. #32: on any failing statement the pg client was released twice (query/client error handler + the finally block), so pg-pool's throwOnDoubleRelease printed a confusing "Release called on client which has already been released" ahead of the real error. Release exactly once via a guard. Tests: unit test for the derived index name (execution_sql_test); integration tests against real Postgres for the unnamed-index create and for no double-release noise on a failing statement (postgres.spec). Bumps SQLANVIL_VERSION 1.4.0 -> 1.4.1. Closes #31 Closes #32 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Fixes two Postgres adapter bugs found in the 1.4.0 acceptance pass (#17).
#31 (blocker) — a
postgres.indexesentry without anamegeneratedCREATE [UNIQUE] INDEX "" ...-> zero-length delimited identifier, failing table creation. Now derives a name (<table>_<cols>_idx,_keyfor unique, truncated to 63 chars) when omitted, mirroring Postgres's own default naming.#32 — on any failing statement the pg client was released twice (query/client error handler + the
finallyblock), so pg-pool'sthrowOnDoubleReleaseprinted a confusingRelease called on client which has already been releasedahead of the real error. Now released exactly once via a guard.Tests: unit test for the derived index name; integration tests against real Postgres for the unnamed-index create and for no double-release noise on a failing statement.
//cli/api:execution_sql_testand//tests/integration:postgres.specpass.Bumps SQLANVIL_VERSION 1.4.0 -> 1.4.1.
Closes #31
Closes #32