parser

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: May 6, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

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

func ParseIdents(bind binds.Bind, input string) []string

ParseIdents is like ParseNamed, but only return a slice of ordered identifiers.

func ParseIn

func ParseIn(bind binds.Bind, input string, args ...any) (string, []any, error)

ParseIn is like ParseInNamed, but for non-named queries.

func ParseInNamed

func ParseInNamed(bind binds.Bind, input string, args []any) (string, []any, error)

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

func ParseNamed(bind binds.Bind, input string) (string, []string)

ParseNamed return a new query replacing named parameters with binds, and a slice of ordered identifiers.

func ParseQuery

func ParseQuery(bind binds.Bind, input string) string

ParseQuery is like ParseNamed, but only return the query.

Types

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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