interpolate

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do(query string, q QueryVars) (*sqlf.Query, error)

Do creates a sqlf.Query from the given query string and QueryVars.

If the query doesn't use interpolation, returns nil, &QueryDoesntUseInterpolationError{}.

func MustDo added in v0.2.0

func MustDo(query string, q QueryVars) *sqlf.Query

MustDo creates a sqlf.Query from the given query string and QueryVars.

Panics if the query doesn't use interpolation.

Types

type QueryDoesntUseInterpolationError

type QueryDoesntUseInterpolationError struct{}

func (*QueryDoesntUseInterpolationError) Error

type QueryVars added in v0.2.0

type QueryVars interface {
	// FormatArgs returns 1 element per interpolation
	FormatArgs() []any
}

Jump to

Keyboard shortcuts

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