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

Function convertA_Const

internal/engine/postgresql/convert.go:98–123  ·  view source on GitHub ↗
(n *pg.A_Const)

Source from the content-addressed store, hash-verified

96}
97
98func convertA_Const(n *pg.A_Const) *ast.A_Const {
99 if n == nil {
100 return nil
101 }
102 var val ast.Node
103 if n.Isnull {
104 val = &ast.Null{}
105 } else {
106 switch v := n.Val.(type) {
107 case *pg.A_Const_Boolval:
108 val = convertBoolean(v.Boolval)
109 case *pg.A_Const_Bsval:
110 val = convertBitString(v.Bsval)
111 case *pg.A_Const_Fval:
112 val = convertFloat(v.Fval)
113 case *pg.A_Const_Ival:
114 val = convertInteger(v.Ival)
115 case *pg.A_Const_Sval:
116 val = convertString(v.Sval)
117 }
118 }
119 return &ast.A_Const{
120 Val: val,
121 Location: int(n.Location),
122 }
123}
124
125func convertA_Expr(n *pg.A_Expr) *ast.A_Expr {
126 if n == nil {

Callers 1

convertNodeFunction · 0.85

Calls 5

convertBooleanFunction · 0.85
convertBitStringFunction · 0.85
convertFloatFunction · 0.85
convertIntegerFunction · 0.85
convertStringFunction · 0.85

Tested by

no test coverage detected