Documentation
¶
Index ¶
- Constants
- Variables
- func ParseIdents(bind binds.Bind, input string) []string
- func ParseIn(bind binds.Bind, input string, args ...any) (string, []any, error)
- func ParseInNamed(bind binds.Bind, input string, args []any) (string, []any, error)
- func ParseNamed(bind binds.Bind, input string) (string, []string)
- func ParseQuery(bind binds.Bind, input string) string
- type Parser
Constants ¶
View Source
const EOF = 0
Variables ¶
View Source
var ErrNoSlices = fmt.Errorf("sqlz: no slices to spread")
ErrNoSlices is used internally to know when to use a previously-parsed query. If there's no slices to spread, means there's no `IN` clause in query.
Functions ¶
func ParseIdents ¶
ParseIdents is like ParseNamed, but only return a slice of ordered identifiers.
func ParseIn ¶
ParseIn is like ParseInNamed, but for non-named queries.
func ParseInNamed ¶
ParseInNamed is like ParseNamed, but also receives a slice of ordered args, the args are spread if they have slices, which are used within `IN` clause. ParseInNamed return a new query replacing named parameters with binds, and the spread args.
func ParseNamed ¶
ParseNamed return a new query replacing named parameters with binds, and a slice of ordered identifiers.
func ParseQuery ¶
ParseQuery is like ParseNamed, but only return the query.
Types ¶
Click to show internal directories.
Click to hide internal directories.