MCPcopy Index your code
hub / github.com/sqlc-dev/sqlc / FetchMerge

Method FetchMerge

internal/sql/named/param_set.go:52–64  ·  view source on GitHub ↗

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

(idx int, mergeP Param)

Source from the content-addressed store, hash-verified

50// FetchMerge fetches an indexed parameter, and merges `mergeP` into it
51// Returns: the merged parameter and whether it was a named parameter
52func (p *ParamSet) FetchMerge(idx int, mergeP Param) (param Param, isNamed bool) {
53 name, exists := p.positionToName[idx]
54 if !exists || name == "" {
55 return mergeP, false
56 }
57
58 param, ok := p.namedParams[name]
59 if !ok {
60 return mergeP, false
61 }
62
63 return mergeParam(param, mergeP), true
64}
65
66// NewParamSet creates a set of parameters with the given list of already used positions
67func NewParamSet(positionsUsed map[int]bool, hasNamedSupport bool) *ParamSet {

Callers 1

resolveCatalogRefsMethod · 0.80

Calls 1

mergeParamFunction · 0.85

Tested by

no test coverage detected