Documentation ¶
Index ¶
- Variables
- func WithInstance(instance *sql.DB, config *Config) (database.Driver, error)
- type Config
- type SQLServer
- func (ss *SQLServer) Close() error
- func (ss *SQLServer) Drop() error
- func (ss *SQLServer) Lock() error
- func (ss *SQLServer) Open(url string) (database.Driver, error)
- func (ss *SQLServer) Run(migration io.Reader) error
- func (ss *SQLServer) SetVersion(version int, dirty bool) error
- func (ss *SQLServer) Unlock() error
- func (ss *SQLServer) Version() (version int, dirty bool, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNilConfig = fmt.Errorf("no config") ErrNoDatabaseName = fmt.Errorf("no database name") ErrNoSchema = fmt.Errorf("no schema") ErrDatabaseDirty = fmt.Errorf("database is dirty") )
View Source
var DefaultMigrationsTable = "schema_migrations"
DefaultMigrationsTable is the name of the migrations table in the database
Functions ¶
Types ¶
type SQLServer ¶
type SQLServer struct {
// contains filtered or unexported fields
}
SQL Server connection
func (*SQLServer) Lock ¶
Lock creates an advisory local on the database to prevent multiple migrations from running at the same time.
func (*SQLServer) SetVersion ¶
SetVersion for the current database
Click to show internal directories.
Click to hide internal directories.