Skip to content

feat: add noTransaction parameter to tables.create() and columns.crea…#1049

Open
7ttp wants to merge 1 commit intosupabase:masterfrom
7ttp:feat/no-transaction-parameter
Open

feat: add noTransaction parameter to tables.create() and columns.crea…#1049
7ttp wants to merge 1 commit intosupabase:masterfrom
7ttp:feat/no-transaction-parameter

Conversation

@7ttp
Copy link

@7ttp 7ttp commented Mar 3, 2026

Summary

Adds optional noTransaction parameter to tables.create() and columns.create() that skips BEGIN...COMMIT wrappers when set to true, enabling atomic multi-operation transactions.

Problem

Each create() call wraps SQL in its own transaction.

Solution

Added noTransaction parameter (defaults to false for BC) that conditionally wraps SQL.

Related

@7ttp 7ttp requested review from a team, avallete and soedirgo as code owners March 3, 2026 15:49
@coderabbitai
Copy link

coderabbitai bot commented Mar 3, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Cache: Disabled due to Reviews > Disable Cache setting

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 5b6537d and 7fe7a09.

📒 Files selected for processing (3)
  • src/lib/PostgresMetaColumns.ts
  • src/lib/PostgresMetaTables.ts
  • src/lib/types.ts

📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Added optional non-transactional mode for creating database tables and columns, enabling operations to execute without transaction wrapping when needed.

Walkthrough

This PR adds a noTransaction boolean parameter to the PostgresMetaColumns.create() and PostgresMetaTables.create() methods, with a default value of false. The parameter controls whether the generated SQL statements are wrapped in a transaction. When noTransaction is true, the SQL executes without BEGIN/COMMIT. When false (default), operations remain wrapped in a transaction as before. The corresponding type definitions in PostgresColumnCreate and PostgresTableCreate are updated to include this optional field.

Assessment against linked issues

Objective Addressed Explanation
Make table creation atomic so that if a column creation fails, the entire table creation is rolled back [#42089] This PR adds infrastructure to control transaction wrapping at the library level, but the default behavior (noTransaction: false) remains unchanged. It's unclear whether this flag will be used by higher-level callers to group table and column operations into a single atomic transaction, which would be necessary to address the atomicity requirement stated in the issue.

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

Table Editor allows partial creation and remains open on SQL error

1 participant