Documentation ¶
Index ¶
- Variables
- func IsCharacterNotInRepertoire(err error) bool
- func IsErrorClass(err error, class string) bool
- func IsErrorCode(err error, code string) bool
- func IsForeignKeyViolation(err error, constraint ...string) bool
- func IsInvalidTextRepresentation(err error) bool
- func IsQueryCanceled(err error) bool
- func IsSerializationFailure(err error) bool
- func IsUniqueViolation(err error, constraint ...string) bool
- func Iter(q interface{ ... }, iter Iterator, query string, args ...any) error
- func IterContext(ctx context.Context, q interface{ ... }, iter Iterator, query string, ...) error
- func JSON(value any) interface{ ... }
- func Null[T comparable](v *T) interface{ ... }
- func NullInt64(i *int64) interface{ ... }
- func NullString(s *string) interface{ ... }
- func RunInTx(db BeginTxer, opts *TxOptions, fn func(pgx.Tx) error) error
- func RunInTxContext(ctx context.Context, db BeginTxer, opts *TxOptions, fn func(pgx.Tx) error) error
- type BeginTxer
- type Iterator
- type QueryContext
- type Row
- type Rows
- type Scanner
- type TxOptions
Constants ¶
This section is empty.
Variables ¶
var ErrAbortTx = errors.New("pgsql: abort tx")
ErrAbortTx rollbacks transaction and return nil error
Functions ¶
func IsCharacterNotInRepertoire ¶
IsCharacterNotInRepertoire checks is error an character_not_in_repertoire
func IsErrorClass ¶
IsErrorClass checks is error has given class
func IsErrorCode ¶
IsErrorCode checks is error has given code
func IsForeignKeyViolation ¶
IsForeignKeyViolation checks is error an foreign_key_violation
func IsInvalidTextRepresentation ¶
IsInvalidTextRepresentation checks is error an invalid_text_representation
func IsQueryCanceled ¶
IsQueryCanceled checks is error an query_canceled error (pq: canceling statement due to user request)
func IsSerializationFailure ¶
IsSerializationFailure checks is error an serialization_failure error (pq: could not serialize access due to read/write dependencies among transactions)
func IsUniqueViolation ¶
IsUniqueViolation checks is error an unique_violation with given constraint, constraint can be empty to ignore constraint name checks
func IterContext ¶
func NullString ¶
NullString scans null into empty string and convert empty string into sql null
func RunInTxContext ¶
func RunInTxContext(ctx context.Context, db BeginTxer, opts *TxOptions, fn func(pgx.Tx) error) error
RunInTxContext runs fn inside retryable transaction with context. It use Serializable isolation level if tx options isolation is setted to sql.LevelDefault.
RunInTxContext DO NOT handle panic. But when panic, it will rollback the transaction.
Types ¶
type QueryContext ¶
QueryContext interface