gomigratesqlitex

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: MIT Imports: 11 Imported by: 0

README

Go Migrate SqliteX Driver

sqlitex://path/to/database?query

This is a SQLite driver for Golang-Migrate. It uses the crawshaw/sqlite package (and generally the sqlitex sub-package commands) to connect to the DB.

This is generally an adaptation of the existing sqlite3 implementation in the golang-migrate package.

It also uses the same additional query parameters, which are optional.

URL Query WithInstance Config Description
x-migrations-table MigrationsTable Name of the migrations table. Defaults to schema_migrations.

Notes

Unlike the sqlite3 implementation, the migrations are not wrapped in a transaction or savepoint.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultMigrationsTable = "schema_migrations"
View Source
var (
	//ErrDatabaseDirty  = fmt.Errorf("database is dirty")
	ErrNilConfig = fmt.Errorf("no config")
)

Functions

func WithInstance

func WithInstance(pool *sqlitex.Pool, config *Config) (database.Driver, error)

Types

type Config

type Config struct {
	MigrationsTable string
	DatabaseName    string
}

type SqlitexDriver

type SqlitexDriver struct {
	// contains filtered or unexported fields
}

func (*SqlitexDriver) Close

func (s *SqlitexDriver) Close() error

func (*SqlitexDriver) Drop

func (s *SqlitexDriver) Drop() error

func (*SqlitexDriver) Lock

func (s *SqlitexDriver) Lock() error

func (*SqlitexDriver) Open

func (s *SqlitexDriver) Open(url string) (database.Driver, error)

func (*SqlitexDriver) Run

func (s *SqlitexDriver) Run(migration io.Reader) error

func (*SqlitexDriver) SetVersion

func (s *SqlitexDriver) SetVersion(version int, dirty bool) error

func (*SqlitexDriver) Unlock

func (s *SqlitexDriver) Unlock() error

func (*SqlitexDriver) Version

func (s *SqlitexDriver) Version() (int, bool, error)

Jump to

Keyboard shortcuts

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