Documentation ¶
Index ¶
- Constants
- func IsPostgresCode(err error, code string) bool
- func IsUniquenessError(err error, constraint string) bool
- func ResetOnMigration(db *DB, log log15.Logger, doneCh chan struct{})
- type Conf
- type DB
- func (db *DB) Begin() (*DBTx, error)
- func (db *DB) Exec(query string, args ...interface{}) error
- func (db *DB) ExecRetry(query string, args ...interface{}) error
- func (db *DB) Listen(channel string, log log15.Logger) (*Listener, error)
- func (db *DB) QueryRow(query string, args ...interface{}) Scanner
- type DBTx
- type Listener
- type Migration
- type Migrations
- type Scanner
- type Step
Constants ¶
View Source
const ( InvalidTextRepresentation = "22P02" CheckViolation = "23514" UniqueViolation = "23505" RaiseException = "P0001" ForeignKeyViolation = "23503" )
Variables ¶
This section is empty.
Functions ¶
func IsPostgresCode ¶
func IsUniquenessError ¶
func ResetOnMigration ¶
Types ¶
type DB ¶
type Listener ¶
type Listener struct { Notify chan *pgx.Notification Err error // contains filtered or unexported fields }
type Migrations ¶
type Migrations []Migration
func NewMigrations ¶
func NewMigrations() *Migrations
func (*Migrations) Add ¶
func (m *Migrations) Add(id int, stmts ...string)
func (*Migrations) AddSteps ¶
func (m *Migrations) AddSteps(id int, steps ...Step)
func (Migrations) Migrate ¶
func (m Migrations) Migrate(db *DB) error
Click to show internal directories.
Click to hide internal directories.