package sqlserver
import "github.com/golang-migrate/migrate/v4/database/sqlserver"
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)
Variables ¶
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.") )
var DefaultMigrationsTable = "schema_migrations"
DefaultMigrationsTable is the name of the migrations table in the database
Functions ¶
func WithInstance ¶
WithInstance returns a database instance from an already created database connection.
Note that the deprecated `mssql` driver is not supported. Please use the newer `sqlserver` driver.
Types ¶
type Config ¶
Config for database
type SQLServer ¶
type SQLServer struct {
// contains filtered or unexported fields
}
SQL Server connection
func (*SQLServer) Close ¶
Close the database connection
func (*SQLServer) Drop ¶
Drop all tables from the database.
func (*SQLServer) Lock ¶
Lock creates an advisory local on the database to prevent multiple migrations from running at the same time.
func (*SQLServer) Open ¶
Open a connection to the database.
func (*SQLServer) Run ¶
Run the migrations for the database
func (*SQLServer) SetVersion ¶
SetVersion for the current database
func (*SQLServer) Unlock ¶
Unlock froms the migration lock from the database
func (*SQLServer) Version ¶
Version of the current database state
Source Files ¶
- Version
- v4.18.2 (latest)
- Published
- Jan 27, 2025
- Platform
- js/wasm
- Imports
- 13 packages
- Last checked
- 1 week ago –
Tools for package owners.