named

package
v1.26.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 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

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

func NewInferredParam(name string, notNull bool) Param

NewInferredParam builds a new params with inferred nullability

func NewParam

func NewParam(name string) Param

NewParam builds a new params with unspecified nullability

func NewSqlcSlice

func NewSqlcSlice(name string) Param

NewSqlcSlice is a sqlc.slice() parameter.

func NewUserNullableParam

func NewUserNullableParam(name string) Param

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

func (Param) IsSqlcSlice

func (p Param) IsSqlcSlice() bool

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

func (Param) Name

func (p Param) Name() string

Name is the user defined name to use for this parameter

func (Param) NotNull

func (p Param) NotNull() bool

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

type ParamSet

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

ParamSet represents a set of parameters for a single query

func NewParamSet

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

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

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

func (*ParamSet) NameFor added in v1.23.0

func (p *ParamSet) NameFor(idx int) (string, bool)

Return the name for a given parameter number and a boolean indicating if it was found.

Jump to

Keyboard shortcuts

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