sqlite

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: May 3, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Backup added in v0.0.7

func Backup(ctx context.Context, db *sql.DB, w io.Writer) error

func Connector added in v0.1.0

func Connector(id string) (*ha.Connector, error)

func DB added in v0.1.0

func DB(id string) (*sql.DB, error)

func Databases added in v0.1.0

func Databases() []string

func Drop added in v0.6.3

func Drop(ctx context.Context, id string) (string, error)

func IdFromDSN added in v0.6.3

func IdFromDSN(dsn string) string

func Load added in v0.1.0

func Load(ctx context.Context, dsn string, cfg LoadConfig) error

Types

type LoadConfig added in v0.11.4

type LoadConfig struct {
	Dir                string
	MemDB              bool
	FromLatestSnapshot bool
	DeliverPolicy      string
	MaxConns           int
	ProxiedDBConfig    ProxiedDBConfig
	Options            []ha.Option
}

type ProxiedDBConfig added in v0.11.4

type ProxiedDBConfig struct {
	PgDSN             string
	PgPublicationName string
	PgSlotName        string

	MysqlDSN        string
	MysqlInclude    string
	MysqlExclude    string
	MysqlID         string
	MysqlDumpBin    string
	MysqlDumpDB     string
	MysqlDumpTables []string

	LocalDB         string
	UseSchema       bool
	DisableRedirect bool
}

type Request

type Request struct {
	Sql    string         `json:"sql"`
	Params map[string]any `json:"params"`
}

type Response

type Response struct {
	Columns      []string `json:"columns"`
	Rows         [][]any  `json:"rows"`
	RowsAffected int64    `json:"-"`
	NoReturning  bool     `json:"-"`
}

func Exec

func Exec(ctx context.Context, eq execerQuerier, stmt *ha.Statement, params map[string]any) (*Response, error)

func Transaction

func Transaction(ctx context.Context, db *sql.DB, queries []Request) ([]*Response, error)

Jump to

Keyboard shortcuts

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