databricks-sql-go
databricks-sql-go copied to clipboard
[PECOBLR-1156] Add foundational structures for transaction support
Summary
Implement foundational infrastructure for Multi-Statement Transaction (MST) support in the Go driver, adding core structures and error constants needed for transaction implementation.
Changes
- Add
autoCommit boolfield toconnstruct for client-side state caching - Create
txstruct withconn *connfield implementingdriver.Txinterface - Add 5 transaction error constants:
-
ErrTransactionBegin- "failed to begin transaction" -
ErrTransactionCommit- "failed to commit transaction" -
ErrTransactionRollback- "failed to rollback transaction" -
ErrTransactionNested- "transaction already in progress" -
ErrUnsupportedIsolation- "unsupported transaction isolation level"
-
- Initialize
autoCommit = truein connector (default state)
Testing
- ✅ Code compiles successfully (
go build ./...) - ✅ Static analysis passes (
go vet ./...) - ✅ Pre-commit hooks passed
- Note: No functional tests in this ticket (foundational structures only)
- Full testing will be implemented in PECOBLR-1160 and PECOBLR-1161
JIRA
Closes PECOBLR-1156 Part of Story: PECOBLR-1155 Part of Epic: PECOBLR-1144
Design Document
See DESIGN_MULTI_STATEMENT_TRANSACTIONS.md for complete technical design.
This implementation follows Section 3.1 (tx struct), Section 4.1 (autoCommit field), Section 4.2 (initialization), and Section 5.1 (error constants).
Implementation Notes
- Follows JDBC implementation pattern (PR #1060) with client-side autocommit caching
- No user-facing changes in this ticket (structures only)
- Ready for PECOBLR-1157 (BeginTx implementation)
🤖 Generated with Claude Code
Co-Authored-By: Claude [email protected]