MCPcopy
hub / github.com/sqlc-dev/sqlc / mergeParam

Function mergeParam

internal/sql/named/param.go:118–129  ·  view source on GitHub ↗

mergeParam creates a new param from 2 partially specified params If the parameters have different names, the first is preferred

(a, b Param)

Source from the content-addressed store, hash-verified

116// mergeParam creates a new param from 2 partially specified params
117// If the parameters have different names, the first is preferred
118func mergeParam(a, b Param) Param {
119 name := a.name
120 if name == "" {
121 name = b.name
122 }
123
124 return Param{
125 name: name,
126 nullability: a.nullability | b.nullability,
127 isSqlcSlice: a.isSqlcSlice || b.isSqlcSlice,
128 }
129}

Callers 4

TestMergeParamNameFunction · 0.85
AddMethod · 0.85
FetchMergeMethod · 0.85

Calls

no outgoing calls

Tested by 2

TestMergeParamNameFunction · 0.68