Export Transaction type for atomic multi-operation support
Add Transaction type alias to both internal/beads and public beads packages. This allows extensions like VC to use RunInTransaction() with the proper Transaction interface type for atomic issue creation. bd-m73k 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
4
beads.go
4
beads.go
@@ -17,6 +17,10 @@ import (
|
|||||||
// Storage is the interface for beads storage operations
|
// Storage is the interface for beads storage operations
|
||||||
type Storage = beads.Storage
|
type Storage = beads.Storage
|
||||||
|
|
||||||
|
// Transaction provides atomic multi-operation support within a database transaction.
|
||||||
|
// Use Storage.RunInTransaction() to obtain a Transaction instance.
|
||||||
|
type Transaction = beads.Transaction
|
||||||
|
|
||||||
// NewSQLiteStorage creates a new SQLite storage instance at the given path
|
// NewSQLiteStorage creates a new SQLite storage instance at the given path
|
||||||
func NewSQLiteStorage(ctx context.Context, dbPath string) (Storage, error) {
|
func NewSQLiteStorage(ctx context.Context, dbPath string) (Storage, error) {
|
||||||
return beads.NewSQLiteStorage(ctx, dbPath)
|
return beads.NewSQLiteStorage(ctx, dbPath)
|
||||||
|
|||||||
@@ -112,6 +112,10 @@ const (
|
|||||||
// Storage provides the minimal interface for extension orchestration
|
// Storage provides the minimal interface for extension orchestration
|
||||||
type Storage = storage.Storage
|
type Storage = storage.Storage
|
||||||
|
|
||||||
|
// Transaction provides atomic multi-operation support within a database transaction.
|
||||||
|
// Use Storage.RunInTransaction() to obtain a Transaction instance.
|
||||||
|
type Transaction = storage.Transaction
|
||||||
|
|
||||||
// NewSQLiteStorage opens a bd SQLite database for programmatic access.
|
// NewSQLiteStorage opens a bd SQLite database for programmatic access.
|
||||||
// Most extensions should use this to query ready work and update issue status.
|
// Most extensions should use this to query ready work and update issue status.
|
||||||
func NewSQLiteStorage(ctx context.Context, dbPath string) (Storage, error) {
|
func NewSQLiteStorage(ctx context.Context, dbPath string) (Storage, error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user