Skip to content

Don't create extensions inside a transaction#349

Merged
rsslldnphy merged 1 commit into
mainfrom
fix/extensions-outside-transaction
May 3, 2026
Merged

Don't create extensions inside a transaction#349
rsslldnphy merged 1 commit into
mainfrom
fix/extensions-outside-transaction

Conversation

@rsslldnphy
Copy link
Copy Markdown
Member

Summary

  • Moves CREATE SCHEMA and CREATE EXTENSION statements outside the transaction in db push
  • Extensions created inside a transaction don't make their objects (functions, types, etc.) available to subsequent statements, causing failures when tables reference extension-provided defaults like uuid_generate_v4()
  • Both statements use IF NOT EXISTS so they're safe to run outside a transaction

Closes #332

Test plan

  • Run db push with a config that uses extensions (e.g. uuid-ossp) and verify tables with extension-provided defaults are created successfully

🤖 Generated with Claude Code

Extensions created inside a transaction don't make their objects
(functions, types, etc.) available to subsequent statements in
that transaction, which causes `db push` to fail when tables
reference extension-provided defaults like `uuid_generate_v4()`.

Move schema and extension creation before the transaction so their
objects are available when tables are created.

Closes #332

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 9, 2026

Coverage Report

  • orm-cli: 96.85%
  • orm-migrate: 94.02%
  • orm: 98.47%
  • sql: 97.03%
  • toolbox: 100%

@rsslldnphy rsslldnphy merged commit 550f1a5 into main May 3, 2026
14 checks passed
@rsslldnphy rsslldnphy deleted the fix/extensions-outside-transaction branch May 3, 2026 11:18
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.

Don't create extensions inside a transaction

1 participant