Documentation
¶
Index ¶
- Variables
- func AppendEscapedAliasedValue(sb []byte, value string, quote byte) []byte
- func AppendEscapedReference(sb []byte, value string, quote byte) []byte
- func AppendEscapedRelation(sb []byte, value string, quote byte) []byte
- func ExpandNamedPlaceholders(sql string, values map[string]any, nextPlaceholder func() string) (string, []interface{}, error)
- func ExpandPositionalPlaceholders(sql string, expectedCount int, nextPlaceholder func() string) (string, error)
- func InlinePlaceholders(sql string, args []interface{}) (string, error)
- func RelationSelectReference(value string) string
- type ParsedReference
Constants ¶
This section is empty.
Variables ¶
View Source
var AsRegexp = regexp.MustCompile(`(?i)\s+as\s+`)
AsRegexp matches case-insensitive " AS " with optional whitespace.
Functions ¶
func AppendEscapedAliasedValue ¶ added in v0.1.0
func AppendEscapedReference ¶ added in v0.1.0
func AppendEscapedRelation ¶ added in v0.1.0
func ExpandNamedPlaceholders ¶ added in v0.1.0
func ExpandNamedPlaceholders(sql string, values map[string]any, nextPlaceholder func() string) (string, []interface{}, error)
ExpandNamedPlaceholders replaces named placeholders found outside SQL literals/comments while preserving appearance order and avoiding prefix collisions.
func ExpandPositionalPlaceholders ¶ added in v0.1.0
func ExpandPositionalPlaceholders(sql string, expectedCount int, nextPlaceholder func() string) (string, error)
ExpandPositionalPlaceholders replaces positional placeholders found outside SQL literals/comments using the supplied placeholder factory.
func InlinePlaceholders ¶ added in v0.1.0
InlinePlaceholders replaces placeholder tokens with their formatted literal values for debugging output.
func RelationSelectReference ¶ added in v0.1.0
Types ¶
type ParsedReference ¶ added in v0.1.0
func ParseAliasedValue ¶ added in v0.1.0
func ParseAliasedValue(value string) (ParsedReference, bool)
func ParseReference ¶ added in v0.1.0
func ParseReference(value string) (ParsedReference, bool)
func ParseRelationReference ¶ added in v0.1.0
func ParseRelationReference(value string) (ParsedReference, bool)
Click to show internal directories.
Click to hide internal directories.