Versions in this module Expand all Collapse all v4 v4.0.12 Feb 21, 2024 Changes in this version + var DefaultMigrationsTable = "schema_migrations" + var DefaultMultiStatementMaxSize = 10 * 1 << 20 + var ErrDatabaseDirty = fmt.Errorf("database is dirty") + var ErrNilConfig = fmt.Errorf("no config") + var ErrNoDatabaseName = fmt.Errorf("no database name") + var ErrNoSchema = fmt.Errorf("no schema") + func WithInstance(instance *sql.DB, config *Config) (database.Driver, error) + type Config struct + DatabaseName string + MigrationsTable string + MigrationsTableQuoted bool + MultiStatementEnabled bool + MultiStatementMaxSize int + SchemaName string + StatementTimeout time.Duration + type Postgres struct + func WithConnection(ctx context.Context, conn *sql.Conn, config *Config) (*Postgres, error) + func (p *Postgres) Close() error + func (p *Postgres) Drop() (err 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) SetVersion(version int, dirty bool) error + func (p *Postgres) Unlock() error + func (p *Postgres) Version() (version int, dirty bool, err error)