Documentation ¶
Index ¶
- Constants
- type Txn
- func (t *Txn) Conn() *sqlite3.SQLiteConn
- func (t *Txn) DryRun(v bool)
- func (t *Txn) Frames(begin bool, frames *sqlite3.ReplicationFramesParams) error
- func (t *Txn) ID() uint64
- func (t *Txn) IsLeader() bool
- func (t *Txn) IsZombie() bool
- func (t *Txn) Resurrect(state fsm.State)
- func (t *Txn) State() fsm.State
- func (t *Txn) String() string
- func (t *Txn) Undo() error
- func (t *Txn) Zombie(state fsm.State)
Constants ¶
const ( Pending = fsm.State("pending") // Initial state right after creation. Writing = fsm.State("writing") // After the frames hook has been executed. Written = fsm.State("written") // After a final frames hook has been executed. Undone = fsm.State("undone") // After the undo hook has been executed. Doomed = fsm.State("doomed") // The transaction has errored. )
Possible transaction states. Most states are associated with SQLite replication hooks that are invoked upon transitioning from one lifecycle state to the next.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Txn ¶
type Txn struct {
// contains filtered or unexported fields
}
Txn captures information about an active WAL write transaction that has been started on a SQLite connection configured to be in either leader or replication mode.
func (*Txn) Conn ¶
func (t *Txn) Conn() *sqlite3.SQLiteConn
Conn returns the sqlite connection that started this write transaction.
func (*Txn) DryRun ¶
DryRun makes this transaction only transition between states, without actually invoking the relevant SQLite APIs. This should only be used by tests.
func (*Txn) IsLeader ¶
IsLeader returns true if the underlying connection is in leader replication mode.
func (*Txn) Resurrect ¶
Resurrect a zombie transaction, to be re-used after a leader that lost leadership was re-elected right away.