Documentation ¶
Index ¶
- Constants
- Variables
- func Exec(conn Conn, query string, args ...interface{}) (err error)
- func Exec2(conn Conn, query string, args ...interface{}) (int64, error)
- func Query(conn Conn, query string, args ...interface{}) (pgx.Rows, error)
- func QueryObject(conn Conn, obj Object, query string, args ...interface{}) error
- func QueryObjects(conn Conn, objs Objects, query string, args ...interface{}) error
- func QueryRow(conn Conn, query string, args ...interface{}) pgx.Row
- func QuoteIdentifier(s string) string
- func QuoteString(s string) string
- func TakeAdvisoryTxLock(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 ( DefaultPoolSize = 5 DefaultConnectionAcquisitionTimeout = 5000 // milliseconds )
View Source
const AdvisoryLockId1 uint32 = 0x0100
View Source
const (
AdvisoryLockId2Migrations uint32 = 0x0001
)
View Source
const MigrationVersionLayout = "20060102T150405Z"
Variables ¶
View Source
var (
ErrNoConnectionAvailable = errors.New("no connection available")
)
Functions ¶
func QueryObjects ¶
func QuoteIdentifier ¶
func QuoteString ¶
func TakeAdvisoryTxLock ¶
Types ¶
type Client ¶
type Client struct { Cfg ClientCfg Log *log.Logger Pool *pgxpool.Pool // contains filtered or unexported fields }
func (*Client) UpdateSchema ¶
type ClientCfg ¶
type ClientCfg struct { Log *log.Logger `json:"-"` InfluxClient *influx.Client `json:"-"` Name string `json:"-"` URI string `json:"uri"` ApplicationName string `json:"application_name,omitempty"` PoolSize int `json:"pool_size,omitempty"` ConnectionAcquisitionTimeout int `json:"connection_acquisition_timeout,omitempty"` // milliseconds SchemaDirectory string `json:"schema_directory"` SchemaNames []string `json:"schema_names"` }
func (*ClientCfg) ValidateJSON ¶
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.