Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: Add multi-statement transaction support#704

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
jayantsing-db wants to merge2 commits intomain
base:main
Choose a base branch
Loading
frommst-pysql

Conversation

@jayantsing-db
Copy link
Contributor

What type of PR is this?

  • Refactor
  • Feature
  • Bug Fix
  • Other

Description

Implement PEP 249-compliant transaction control with extensions for manual commit/rollback operations. This enables atomic multi-table operations with REPEATABLE_READ isolation semantics.

Core API additions:

  • connection.autocommit property for enabling/disabling auto-commit mode
  • connection.commit() to commit active transactions
  • connection.rollback() to rollback active transactions
  • connection.get_transaction_isolation() returns current isolation level
  • connection.set_transaction_isolation() validates isolation level
  • TransactionError exception for transaction-specific failures

Implementation details:

  • Added autocommit state caching in Session with optional server query
  • Added TRANSACTION_ISOLATION_LEVEL_REPEATABLE_READ constant
  • All transaction operations include proper error handling and telemetry
  • Supports fetch_autocommit_from_server connection parameter

Testing:

  • Unit tests covering all transaction methods and error scenarios
  • e2e integration tests validating transaction behavior including multi-table atomicity, sequential transactions, and isolation semantics

Documentation:

  • Comprehensive TRANSACTIONS.md guide with examples and best practices
  • Updated README.md with basic usage and reference to detailed docs

Requires MST-enabled Databricks SQL warehouse and Delta tables with 'delta.feature.catalogOwned-preview' table property.

How is this tested?

  • Unit tests
  • E2E Tests
  • Manually
  • N/A

Related Tickets & Documents

Implement PEP 249-compliant transaction control with extensions formanual commit/rollback operations. This enables atomic multi-tableoperations with REPEATABLE_READ isolation semantics.Core API additions:- connection.autocommit property for enabling/disabling auto-commit mode- connection.commit() to commit active transactions- connection.rollback() to rollback active transactions- connection.get_transaction_isolation() returns current isolation level- connection.set_transaction_isolation() validates isolation level- TransactionError exception for transaction-specific failuresImplementation details:- Added autocommit state caching in Session with optional server query- Added TRANSACTION_ISOLATION_LEVEL_REPEATABLE_READ constant- All transaction operations include proper error handling and telemetry- Supports fetch_autocommit_from_server connection parameterTesting:- Unit tests covering all transaction methods and error scenarios- e2e integration tests validating transaction behavior including  multi-table atomicity, sequential transactions, and isolation semanticsDocumentation:- Comprehensive TRANSACTIONS.md guide with examples and best practices- Updated README.md with basic usage and reference to detailed docsRequires MST-enabled Databricks SQL warehouse and Delta tables with'delta.feature.catalogOwned-preview' table property.
@github-actions
Copy link

Thanks for your contribution! To satisfy the DCO policy in ourcontributing guide every commit message must include a sign-off message. One or more of your commits is missing this message. You can reword previous commit messages with an interactive rebase (git rebase -i main).

@github-actions
Copy link

Thanks for your contribution! To satisfy the DCO policy in ourcontributing guide every commit message must include a sign-off message. One or more of your commits is missing this message. You can reword previous commit messages with an interactive rebase (git rebase -i main).

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@jayantsing-db

[8]ページ先頭

©2009-2025 Movatter.jp