mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 11:27:33 +00:00
multiple tries
This commit is contained in:
36
backend/v3/storage/database/tx.go
Normal file
36
backend/v3/storage/database/tx.go
Normal file
@@ -0,0 +1,36 @@
|
||||
package database
|
||||
|
||||
import "context"
|
||||
|
||||
type Transaction interface {
|
||||
Commit(ctx context.Context) error
|
||||
Rollback(ctx context.Context) error
|
||||
End(ctx context.Context, err error) error
|
||||
|
||||
Begin(ctx context.Context) (Transaction, error)
|
||||
|
||||
QueryExecutor
|
||||
}
|
||||
|
||||
type Beginner interface {
|
||||
Begin(ctx context.Context, opts *TransactionOptions) (Transaction, error)
|
||||
}
|
||||
|
||||
type TransactionOptions struct {
|
||||
IsolationLevel IsolationLevel
|
||||
AccessMode AccessMode
|
||||
}
|
||||
|
||||
type IsolationLevel uint8
|
||||
|
||||
const (
|
||||
IsolationLevelSerializable IsolationLevel = iota
|
||||
IsolationLevelReadCommitted
|
||||
)
|
||||
|
||||
type AccessMode uint8
|
||||
|
||||
const (
|
||||
AccessModeReadWrite AccessMode = iota
|
||||
AccessModeReadOnly
|
||||
)
|
Reference in New Issue
Block a user