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

Function isNotNull

internal/engine/clickhouse/utils.go:44–59  ·  view source on GitHub ↗
(n *chast.ColumnDeclaration)

Source from the content-addressed store, hash-verified

42}
43
44func isNotNull(n *chast.ColumnDeclaration) bool {
45 if n.Type == nil {
46 return false
47 }
48 // Check if type is wrapped in Nullable()
49 // If it's Nullable, it can be null, so return false
50 // If it's not Nullable, it's NOT NULL by default in ClickHouse
51 if n.Type.Name != "" && strings.ToLower(n.Type.Name) == "nullable" {
52 return false
53 }
54 // Also check if Nullable field is explicitly set
55 if n.Nullable != nil && *n.Nullable {
56 return false
57 }
58 return true
59}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected