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

Function isNotNull

internal/engine/postgresql/utils.go:14–30  ·  view source on GitHub ↗
(n *nodes.ColumnDef)

Source from the content-addressed store, hash-verified

12}
13
14func isNotNull(n *nodes.ColumnDef) bool {
15 if n.IsNotNull {
16 return true
17 }
18 for _, c := range n.Constraints {
19 switch inner := c.Node.(type) {
20 case *nodes.Node_Constraint:
21 if inner.Constraint.Contype == nodes.ConstrType_CONSTR_NOTNULL {
22 return true
23 }
24 if inner.Constraint.Contype == nodes.ConstrType_CONSTR_PRIMARY {
25 return true
26 }
27 }
28 }
29 return false
30}
31
32func IsNamedParamFunc(node *nodes.Node) bool {
33 fun, ok := node.Node.(*nodes.Node_FuncCall)

Callers 1

translateFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected