Documentation ¶
Index ¶
- Variables
- func WithInstance(instance *sql.DB, config *Config) (database.Driver, error)
- type Config
- type Postgres
- func (p *Postgres) Close() error
- func (p *Postgres) Drop() (err error)
- func (p *Postgres) ListAppliedVersions() ([]int, error)
- func (p *Postgres) Lock() error
- func (p *Postgres) Open(url string) (database.Driver, error)
- func (p *Postgres) Run(migration io.Reader) error
- func (p *Postgres) SetSourceDriver(sourceDrv source.Driver) error
- func (p *Postgres) SetVersion(version int, dirty bool, forced bool, knownDirection *source.Direction) (*source.Direction, error)
- func (p *Postgres) Unlock() error
- func (p *Postgres) Version() (version int, dirty bool, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultMigrationsTable = "schema_migrations" DefaultHistoryTable = "schema_migrations_history" DefaultMultiStatementMaxSize = 10 * 1 << 20 // 10 MB )
Functions ¶
Types ¶
type Config ¶
type Config struct { MigrationsTable string MigrationsHistoryTable string MigrationsHistoryEnabled bool MigrationsTableQuoted bool MultiStatementEnabled bool DatabaseName string SchemaName string StatementTimeout time.Duration MultiStatementMaxSize int MigrationsRelativePath string // Optionally specify a path (e.g. ./migrations) where the migration files exist on the given file mount point (i.e. sourceURL) ForceTransactionalMigrations bool // contains filtered or unexported fields }
type Postgres ¶
type Postgres struct {
// contains filtered or unexported fields
}
func WithConnection ¶
func (*Postgres) ListAppliedVersions ¶
func (*Postgres) Lock ¶
https://www.postgresql.org/docs/9.6/static/explicit-locking.html#ADVISORY-LOCKS
func (*Postgres) SetSourceDriver ¶
func (*Postgres) SetVersion ¶
Click to show internal directories.
Click to hide internal directories.