Documentation
¶
Index ¶
- Constants
- func Exec(conn Conn, query string, args ...interface{}) error
- func Exec2(conn Conn, query string, args ...interface{}) (int64, error)
- func Exec2Context(ctx context.Context, conn Conn, query string, args ...interface{}) (int64, error)
- func ExecContext(ctx context.Context, conn Conn, query string, args ...interface{}) error
- func QueryObject(conn Conn, obj Object, query string, args ...interface{}) error
- func QueryObjectContext(ctx context.Context, conn Conn, obj Object, query string, args ...interface{}) error
- func QueryObjects(conn Conn, objs Objects, query string, args ...interface{}) error
- func QueryObjectsContext(ctx context.Context, conn Conn, objs Objects, query string, ...) error
- func QuoteIdentifier(s string) string
- func QuoteString(s string) string
- func TakeAdvisoryLock(conn Conn, id1, id2 uint32) error
- func ValidateMigrationVersion(s string) (err error)
- type Client
- type ClientCfg
- type Conn
- type Migration
- type Migrations
- type Object
- type Objects
Constants ¶
View Source
const AdvisoryLockId1 uint32 = 0x00ff
Advisory locks are identified by two 32 bit integers. We arbitrarily reserve a value for the first one for all locks taken by go-daemon.
View Source
const (
AdvisoryLockId2Migrations uint32 = 0x0001
)
View Source
const MigrationVersionLayout = "20060102T150405Z"
Variables ¶
This section is empty.
Functions ¶
func Exec2Context ¶
func ExecContext ¶
func QueryObjectContext ¶
func QueryObjects ¶
func QueryObjectsContext ¶
func QuoteIdentifier ¶
func QuoteString ¶
func TakeAdvisoryLock ¶
Types ¶
type Client ¶
func (*Client) UpdateSchema ¶
type ClientCfg ¶
type Conn ¶
type Conn interface { Begin(context.Context) (pgx.Tx, error) BeginFunc(context.Context, func(pgx.Tx) error) error Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error) Query(context.Context, string, ...interface{}) (pgx.Rows, error) QueryRow(context.Context, string, ...interface{}) pgx.Row QueryFunc(context.Context, string, []interface{}, []interface{}, func(pgx.QueryFuncRow) error) (pgconn.CommandTag, error) }
type Migrations ¶
type Migrations []*Migration
func (*Migrations) LoadDirectory ¶
func (pms *Migrations) LoadDirectory(schema, dirPath string) error
func (*Migrations) RejectVersions ¶
func (pms *Migrations) RejectVersions(versions map[string]struct{})
func (Migrations) Sort ¶
func (ms Migrations) Sort()
Click to show internal directories.
Click to hide internal directories.