named

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 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

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 NewUserNullableParam

func NewUserNullableParam(name string) Param

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

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

Jump to

Keyboard shortcuts

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