sanitize

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EscapeLike

func EscapeLike(s string) string

EscapeLike escapes LIKE pattern special characters (% and _)

func EscapeSQL

func EscapeSQL(s string) string

EscapeSQL escapes a string for safe use in SQL string literals. This doubles single quotes and removes null bytes.

func ParseRelativeTime

func ParseRelativeTime(s string) string

ParseRelativeTime converts "2h", "24h", "7d" to DuckDB interval strings. Returns empty string if invalid.

func SQLCondition

func SQLCondition(column, value string) string

SQLCondition safely builds a SQL equality condition after validation

func SQLInCondition

func SQLInCondition(column string, values []string) string

SQLInCondition safely builds a SQL IN condition

func SQLLikeCondition

func SQLLikeCondition(column, value string) string

SQLLikeCondition safely builds a SQL LIKE condition

func ValidateID

func ValidateID(id string) error

ValidateID checks that an ID matches the safe pattern

func ValidateTag

func ValidateTag(tag string) error

ValidateTag checks that a tag matches the safe pattern

func ValidateType

func ValidateType(t string) error

ValidateType checks that a type string matches the safe pattern

Types

This section is empty.

Jump to

Keyboard shortcuts

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