Documentation ¶
Index ¶
- func IsPostgreSQLErrorCode(err error, code PostgreSQLErrorCode) (*pgconn.PgError, bool)
- func QuoteBytes(buf []byte) string
- func QuoteIdentifier(s string) string
- func QuoteString(str string) string
- func RetryOnErrorCode(code PostgreSQLErrorCode, codes ...PostgreSQLErrorCode) func(context.Context, error) bool
- type PostgreSQLErrorCode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsPostgreSQLErrorCode ¶
func IsPostgreSQLErrorCode(err error, code PostgreSQLErrorCode) (*pgconn.PgError, bool)
func QuoteBytes ¶
copy-pasta from pgx internals, see https://github.com/jackc/pgx/blob/master/internal/sanitize/sanitize.go
func QuoteIdentifier ¶
copy-pasta from pgx internals, see https://github.com/jackc/pgx/blob/master/conn.go#L341 and https://github.com/jackc/pgx/issues/202
func QuoteString ¶
copy-pasta from pgx internals, see https://github.com/jackc/pgx/blob/master/internal/sanitize/sanitize.go
func RetryOnErrorCode ¶
func RetryOnErrorCode(code PostgreSQLErrorCode, codes ...PostgreSQLErrorCode) func(context.Context, error) bool
Types ¶
type PostgreSQLErrorCode ¶
type PostgreSQLErrorCode string
var ( SerializationFailure PostgreSQLErrorCode = "40001" // InvalidCatalogName often indicates attempting to connect to a database that // does not exist InvalidCatalogName PostgreSQLErrorCode = "3D000" // CannotConnectNow often indicates the server is still starting up CannotConnectNow PostgreSQLErrorCode = "57P03" DeadlockDetected PostgreSQLErrorCode = "40P01" )
Click to show internal directories.
Click to hide internal directories.