Documentation ¶
Index ¶
- func QuoteID(parts ...string) string
- func Rollback(ctx context.Context, errMsg string, tx *sql.Tx)
- func RollbackContext(ctx context.Context, errMsg string, tx Tx)
- func SplitQuery(query string) []string
- type BoolArray
- type Error
- type IntArray
- type Listener
- type NullTime
- type NullUUID
- type NullUUIDArray
- type StringArray
- type Tx
- type UUIDArray
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Rollback ¶ added in v0.31.0
Rollback will roll back the transaction, logging any potential errors other than ErrTxDone and ErrConnDone, which are expected.
Primarily, it's intended to be used with defer as an alternative to calling defer tx.Rollback() which ignores ALL errors.
func RollbackContext ¶ added in v0.31.0
RollbackContext provides the same functionality as Rollback, but for a pgx.Tx.
func SplitQuery ¶ added in v0.32.0
SplitQuery will split a SQL query into individual queries.
It will split on semicolons, but will ignore semicolons inside of $$ blocks.
Types ¶
type Error ¶
type Error struct { Code string Message string Detail string Hint string TableName string ConstraintName string Where string ColumnName string Position int // contains filtered or unexported fields }
Error represents a driver-agnostic SQL error.
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
Listener will listen for NOTIFY commands on a set of channels.
func NewListener ¶
func NewListener(ctx context.Context, logger *log.Logger, db *sql.DB, channels ...string) (*Listener, error)
NewListener will create and initialize a Listener which will automatically reconnect and listen to the provided channels.
func (*Listener) Notifications ¶
func (l *Listener) Notifications() <-chan *pgconn.Notification
Notifications returns the notification channel for this listener. Nil values will not be returned until the listener is closed.
type NullUUIDArray ¶ added in v0.28.0
func (*NullUUIDArray) Scan ¶ added in v0.28.0
func (s *NullUUIDArray) Scan(src interface{}) error
type StringArray ¶
type StringArray []string
func (*StringArray) Scan ¶
func (s *StringArray) Scan(src interface{}) error