sanitize
v3.6.2+incompatible
github.com/htner/pgx/internal/sanitize
Documentation
pkg.go.dev ↗Functions
QuoteBytes
func QuoteBytes(buf []byte) string
QuoteString
func QuoteString(str string) string
SanitizeSQL
func SanitizeSQL(sql string, args ...interface{}) (string, error)
SanitizeSQL replaces placeholder values with args. It quotes and escapes args as necessary. This function is only safe when standard_conforming_strings is on.
Types
Part
type Part interface{}
Part is either a string or an int. A string is raw SQL. An int is a argument placeholder.
Query
type Query struct {
Parts []Part
}
NewQuery
func NewQuery(sql string) (*Query, error)
Query.Sanitize
func (q *Query) Sanitize(args ...interface{}) (string, error)