database

package
v0.0.0-...-56aa9b5 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Clone from https://raw.githubusercontent.com/golang-migrate/migrate/master/database/sqlite3/sqlite3.go and only changed db driver

Index

Constants

This section is empty.

Variables

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

Functions

func GetTestDbConnections

func GetTestDbConnections() []connectionData

func MigrateInternalSqliteDb

func MigrateInternalSqliteDb(db *sql.DB) error

func WithSqliteMigrateInstance

func WithSqliteMigrateInstance(instance *sql.DB, config *SqliteMigrateConfig) (database.Driver, error)

Types

type ConnectorFactory

type ConnectorFactory interface {
	NewConnector(dataSource string) (*sql.DB, error)
}

func NewConnectorFactory

func NewConnectorFactory() ConnectorFactory

type CustomSqliteMigrate

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

func (*CustomSqliteMigrate) Close

func (m *CustomSqliteMigrate) Close() error

func (*CustomSqliteMigrate) Drop

func (m *CustomSqliteMigrate) Drop() (err error)

func (*CustomSqliteMigrate) Lock

func (m *CustomSqliteMigrate) Lock() error

func (*CustomSqliteMigrate) Open

func (*CustomSqliteMigrate) Run

func (m *CustomSqliteMigrate) Run(migration io.Reader) error

func (*CustomSqliteMigrate) SetVersion

func (m *CustomSqliteMigrate) SetVersion(version int, dirty bool) error

func (*CustomSqliteMigrate) Unlock

func (m *CustomSqliteMigrate) Unlock() error

func (*CustomSqliteMigrate) Version

func (m *CustomSqliteMigrate) Version() (version int, dirty bool, err error)

type DbType

type DbType string
const (
	Sqlite3  DbType = "sqlite"
	Postgres DbType = "pgx"
	MySql    DbType = "mysql"
	MsSql    DbType = "sqlserver"
)

func (DbType) String

func (c DbType) String() string

type SqliteMigrateConfig

type SqliteMigrateConfig struct {
	MigrationsTable string
	DatabaseName    string
	NoTxWrap        bool
}

Jump to

Keyboard shortcuts

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