sqlite

package
v11.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2025 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAlreadyCommitted      = errors.New("already committed")
	ErrUnexpectedSessionType = errors.New("unexpected session type")
)

Functions

This section is empty.

Types

type DB

type DB struct {
	Logger *zap.SugaredLogger
	DB     *sqlx.DB
}

func New

func New(logger *zap.SugaredLogger, migrationsFS fs.FS, dbPath string, dbName string) (*DB, error)

func (*DB) Abort

func (s *DB) Abort(session Session)

func (*DB) Close

func (s *DB) Close() error

func (*DB) Commit

func (s *DB) Commit(session Session) error

func (*DB) NewSession

func (s *DB) NewSession(ctx context.Context) (*SQLxTxSession, error)

type DBConfig

type DBConfig struct {
	DBPath string
}

type SQLxTxSession

type SQLxTxSession struct {
	*sqlx.Tx
	// contains filtered or unexported fields
}

func (*SQLxTxSession) Abort

func (s *SQLxTxSession) Abort() error

func (*SQLxTxSession) Commit

func (s *SQLxTxSession) Commit() error

func (*SQLxTxSession) SQLxTx

func (s *SQLxTxSession) SQLxTx() *sqlx.Tx

type SQLxTxer

type SQLxTxer interface {
	SQLxTx() *sqlx.Tx
}

type Session

type Session interface {
	Commit() error
	Abort() error
}

Jump to

Keyboard shortcuts

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