Documentation
¶
Index ¶
- Constants
- Variables
- func GetRaisedException(err error) string
- func IsCheckViolation(err error) bool
- func IsExclusionViolation(err error) bool
- func IsForeignKeyViolation(err error, violatedConstraints ...string) bool
- func IsIntegrityConstraintViolationClass(err error) bool
- func IsNotNullViolation(err error) bool
- func IsPLPGSQLErrorClass(err error) bool
- func IsQueryCanceled(err error) bool
- func IsRaisedException(err error) bool
- func IsRestrictViolation(err error) bool
- func IsUniqueViolation(err error) bool
- func MustNew(ctx context.Context, config *sqldb.Config) sqldb.Connection
- func New(ctx context.Context, config *sqldb.Config) (sqldb.Connection, error)
Constants ¶
View Source
const (
Driver = "postgres"
)
Variables ¶
View Source
var ( ListenerMinReconnectInterval = time.Second * 10 ListenerMaxReconnectInterval = time.Second * 60 ListenerPingInterval = time.Second * 90 )
View Source
var ListenerEventLogger sqldb.Logger
ListenerEventLogger will log all subscribed channel listener events if not nil
Functions ¶
func GetRaisedException ¶
GetRaisedException returns the message of an PL/pgSQL exception or and empty string if the error is nil or not an exception.
func IsCheckViolation ¶
func IsExclusionViolation ¶
func IsForeignKeyViolation ¶
func IsNotNullViolation ¶
func IsPLPGSQLErrorClass ¶
func IsQueryCanceled ¶
IsQueryCanceled indicates if the passed error was caused by a user cancellation of a query. The pq error might not unwrap to context.Canceled even when it was caused by a context cancellation.
func IsRaisedException ¶
func IsRestrictViolation ¶
func IsUniqueViolation ¶
func MustNew ¶
MustNew creates a new sqldb.Connection using the passed sqldb.Config and github.com/lib/pq as driver implementation. The connection is pinged with the passed context, and only returned when there was no error from the ping. Errors are paniced.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.