Skip to content

Implement notransaction option and wrap statement errors - #6

Merged
ftkg merged 1 commit into
masterfrom
ft-impl-notransaction
Jul 23, 2026
Merged

Implement notransaction option and wrap statement errors#6
ftkg merged 1 commit into
masterfrom
ft-impl-notransaction

Conversation

@ftkg

@ftkg ftkg commented Jul 14, 2026

Copy link
Copy Markdown

This addresses some niggles we face in Satori migrations (eg. running CREATE INDEX CONCURRENTLY).

The PlannedMigration.DisableTransaction flag was already parsed and available, this PR branches on it by running their statements directly through the connection.

Also, statement/begin errors returned a bare error with no migration context. This wraps every failure in the existing TxError, carrying the migration id.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for notransaction migrations by executing planned statements directly on the connection (skipping BEGIN/COMMIT), and improves error reporting by consistently attaching migration context via TxError.

Changes:

  • Execute migrations without a surrounding transaction when PlannedMigration.DisableTransaction is set.
  • Wrap statement execution and transaction-begin failures in TxError for better migration-id context.
  • Add parser/tests/docs coverage for notransaction behavior and its non-atomic implications.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
sqlparse/sqlparse_test.go Adds tests ensuring notransaction is parsed correctly for Up vs Down sections.
README.md Documents notransaction semantics, limitations, and interaction with statement blocks.
migrate.go Implements non-transactional execution path and centralizes execution/recording in runMigration.
migrate_test.go Adds integration tests verifying non-transactional behavior (no rollback) and tracking-table recording.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread migrate.go
Comment thread migrate.go
Comment thread migrate.go
@ftkg
ftkg marked this pull request as ready for review July 14, 2026 16:43
@ftkg
ftkg requested a review from zyro July 20, 2026 15:30
@ftkg
ftkg merged commit 797198e into master Jul 23, 2026
2 checks passed
@ftkg
ftkg deleted the ft-impl-notransaction branch July 23, 2026 13:19
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.

3 participants