pattern

package
v1.0.0-alpha.24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompileLikeMatch

func CompileLikeMatch(c Compiler, col string, match database.StringMatch, value string, ignoreCase bool)

CompileLikeMatch writes a LIKE comparison of col against the match pattern for value. Ignore-case folds both sides with the database's LOWER: a Go-folded needle can disagree with LOWER(col) on non-ASCII (ASCII-only SQLite LOWER, C-locale postgres) and miss rows. A single fold function means a needle equal to the stored text always matches; characters LOWER cannot fold stay case-sensitive.

func CompileLikePattern

func CompileLikePattern(c Compiler, match database.StringMatch, value string)

CompileLikePattern writes a dialect-agnostic LIKE pattern expression using WriteArg for the escaped value and WriteString for SQL fragments.

func EscapeLikePattern

func EscapeLikePattern(value string) string

EscapeLikePattern escapes %, _, and \ in a LIKE/ILIKE pattern literal.

Types

type Compiler

type Compiler interface {
	WriteString(string)
	WriteArg(any)
}

Compiler is the minimal surface dialect statement compilers need to provide for shared LIKE-pattern SQL generation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL