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) ListAppliedVersions() ([]int, 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) SetSourceDriver(sourceDrv source.Driver) error
- func (ss *SQLServer) SetVersion(version int, dirty bool, forced bool, knownDirection *source.Direction) (*source.Direction, 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") ErrMultipleAuthOptionsPassed = fmt.Errorf("both password and useMsi=true were passed.") )
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) ListAppliedVersions ¶
func (*SQLServer) Lock ¶
Lock creates an advisory local on the database to prevent multiple migrations from running at the same time.
func (*SQLServer) SetSourceDriver ¶
This database driver does not currently support file sourcing.
func (*SQLServer) SetVersion ¶
func (ss *SQLServer) SetVersion(version int, dirty bool, forced bool, knownDirection *source.Direction) (*source.Direction, error)
SetVersion for the current database
Click to show internal directories.
Click to hide internal directories.