sqlite

package
v1.2.17-prerelease01 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PluginName = "sqlite"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	*mysql.DB
}

DB contains methods for managing objects in a sqlite database It inherits methods from the mysql.DB to reuse the implementation of the methods sqlplugin.ErrorChecker is customized for sqlite

func NewDB

func NewDB(xdbs []*sqlx.DB, tx *sqlx.Tx, dbShardID int, numDBShards int) (*DB, error)

NewDB returns an instance of DB, which contains a new created mysql.DB with sqlite specific methods

func (*DB) BeginTX

func (mdb *DB) BeginTX(ctx context.Context, dbShardID int) (sqlplugin.Tx, error)

BeginTX starts a new transaction and returns a new Tx

func (*DB) IsDupEntryError

func (mdb *DB) IsDupEntryError(err error) bool

IsDupEntryError verify if the error is a duplicate entry error

func (*DB) IsNotFoundError

func (mdb *DB) IsNotFoundError(err error) bool

IsNotFoundError verify if the error is a not found error

func (*DB) IsThrottlingError

func (mdb *DB) IsThrottlingError(err error) bool

IsThrottlingError verify if the error is a throttling error

func (*DB) IsTimeoutError

func (mdb *DB) IsTimeoutError(err error) bool

IsTimeoutError verify if the error is a timeout error

func (*DB) PluginName

func (mdb *DB) PluginName() string

PluginName returns the name of the plugin

Jump to

Keyboard shortcuts

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