sqlite

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagStatus = iota // 当前计划状态
	PlanAutoBackup

	FlagMax
)

Variables

This section is empty.

Functions

func SQLiteBackup

func SQLiteBackup(master, slave *sqlite3.SQLiteConn, step, delay int) error

func SQLiteCount

func SQLiteCount(db *SQLiteDB, tbl_name string) (int64, error)

func SQLiteSync

func SQLiteSync(master, slave *sql.DB, dir string) (int64, error)

Types

type Option

type Option func(c *options)

func WithBackup

func WithBackup(path string, args ...int) Option

type SQLiteDB

type SQLiteDB struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewSQLiteDB

func NewSQLiteDB(opts ...Option) *SQLiteDB

func (*SQLiteDB) Backup

func (this *SQLiteDB) Backup() error

func (*SQLiteDB) Close

func (this *SQLiteDB) Close()

func (*SQLiteDB) CreateTable

func (this *SQLiteDB) CreateTable(name, structure string, flags ...bool) bool

func (*SQLiteDB) GetConn

func (this *SQLiteDB) GetConn(flags ...bool) (conn *sql.DB, err error)

func (*SQLiteDB) StartBackup

func (this *SQLiteDB) StartBackup(auto bool) (int64, error)

Jump to

Keyboard shortcuts

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