sqlite

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2022 License: ISC Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSQLiteStore

func NewSQLiteStore(db *sqlx.DB) *sqliteStore

NewSQLiteStore will setup and return a sql list data store.

func WithTxContext

func WithTxContext(ctx context.Context) context.Context

WithTxContext will add a new empty transaction to the provided context.

Types

type Transacter

type Transacter struct {
}

Transacter is used to implement the DBTransacter interface for managing db transactions in other layers.

func (*Transacter) Commit

func (t *Transacter) Commit(ctx context.Context) error

Commit will commit a distributed transaction.

func (*Transacter) Rollback

func (t *Transacter) Rollback(ctx context.Context) error

Rollback will revert the tx and rollback any changes.

func (*Transacter) WithTx

func (t *Transacter) WithTx(ctx context.Context) context.Context

WithTx will add a TX to the provided context.

type Tx

type Tx struct {
	*sqlx.Tx
}

Tx wraps the transaction used in context.

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext will return a context based transaction if found.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL