named

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsParamFunc

func IsParamFunc(node ast.Node) bool

IsParamFunc fulfills the astutils.Search

func IsParamSign

func IsParamSign(node ast.Node) bool

Types

type Param added in v1.14.0

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

Param represents a input argument to the query which can be specified using: - positional parameters $1 - named parameter operator @param - named parameter function calls sqlc.arg(param)

func NewInferredParam added in v1.14.0

func NewInferredParam(name string, notNull bool) Param

NewInferredParam builds a new params with inferred nullability

func NewParam added in v1.14.0

func NewParam(name string) Param

NewParam builds a new params with unspecified nullability

func NewSqlcSlice added in v1.18.0

func NewSqlcSlice(name string) Param

NewSqlcSlice is a sqlc.slice() parameter.

func NewUserNullableParam added in v1.14.0

func NewUserNullableParam(name string) Param

NewUserNullableParam is a parameter that has been overridden by the user to be nullable.

func (Param) IsSqlcSlice added in v1.18.0

func (p Param) IsSqlcSlice() bool

IsSlice returns whether this param is a sqlc.slice() param.

func (Param) Name added in v1.14.0

func (p Param) Name() string

Name is the user defined name to use for this parameter

func (Param) NotNull added in v1.14.0

func (p Param) NotNull() bool

NonNull determines whether this param should be "not null" in its current state

type ParamSet added in v1.14.0

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

ParamSet represents a set of parameters for a single query

func NewParamSet added in v1.14.0

func NewParamSet(positionsUsed map[int]bool, hasNamedSupport bool) *ParamSet

NewParamSet creates a set of parameters with the given list of already used positions

func (*ParamSet) Add added in v1.14.0

func (p *ParamSet) Add(param Param) int

Add adds a parameter to this set and returns the numbered location used for it

func (*ParamSet) FetchMerge added in v1.14.0

func (p *ParamSet) FetchMerge(idx int, mergeP Param) (param Param, isNamed bool)

FetchMerge fetches an indexed parameter, and merges `mergeP` into it Returns: the merged parameter and whether it was a named parameter

Jump to

Keyboard shortcuts

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