Documentation
¶
Overview ¶
Package postgres implements the migration.Provider for PostgreSQL.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider is the PostgreSQL migration.Provider: it owns the connection pool and knows how to lock, store history and run DDL transactionally.
func Open ¶
Open connects to PostgreSQL and verifies the connection.
It builds the pool from a pq.Connector (via sql.OpenDB) rather than sql.Open("postgres", dsn): lib/pq's Driver does not implement driver.DriverContext, so sql.Open falls back to a path that ignores the context entirely during the TCP dial — a ctx deadline would never actually cut off connecting to an unreachable host. Connector.Connect does honor it.
func (*Provider) DB ¶
DB returns the migration.DB the engine should use. The concrete value also implements migration.TxCapableDB, which NewEngine detects since this provider reports SupportsTransactionalDDL() == true.
func (*Provider) History ¶
func (p *Provider) History() migration.HistoryStore