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

Method NotNull

internal/sql/named/param.go:86–109  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

84
85// NonNull determines whether this param should be "not null" in its current state
86func (p Param) NotNull() bool {
87 const null = false
88 const notNull = true
89
90 if p.is(notNullable) {
91 return notNull
92 }
93
94 if p.is(nullable) {
95 return null
96 }
97
98 if p.is(inferredNotNull) {
99 return notNull
100 }
101
102 if p.is(inferredNull) {
103 return null
104 }
105
106 // This param is unspecified, so by default we choose nullable
107 // which matches the default behavior of most databases
108 return null
109}
110
111// IsSlice returns whether this param is a sqlc.slice() param.
112func (p Param) IsSqlcSlice() bool {

Callers 2

resolveCatalogRefsMethod · 0.80

Calls 1

isMethod · 0.95

Tested by 1