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

Method convertParam

internal/engine/sqlite/convert.go:849–875  ·  view source on GitHub ↗
(n *parser.Expr_bindContext)

Source from the content-addressed store, hash-verified

847}
848
849func (c *cc) convertParam(n *parser.Expr_bindContext) ast.Node {
850 if n.NUMBERED_BIND_PARAMETER() != nil {
851 // Parameter numbers start at one
852 c.paramCount += 1
853
854 text := n.GetText()
855 number := c.paramCount
856 if len(text) > 1 {
857 number, _ = strconv.Atoi(text[1:])
858 }
859 return &ast.ParamRef{
860 Number: number,
861 Location: n.GetStart().GetStart(),
862 Dollar: len(text) > 1,
863 }
864 }
865
866 if n.NAMED_BIND_PARAMETER() != nil {
867 return &ast.A_Expr{
868 Name: &ast.List{Items: []ast.Node{&ast.String{Str: "@"}}},
869 Rexpr: &ast.String{Str: n.GetText()[1:]},
870 Location: n.GetStart().GetStart(),
871 }
872 }
873
874 return todo("convertParam", n)
875}
876
877func (c *cc) convertInSelectNode(n *parser.Expr_in_selectContext) ast.Node {
878 // Check if this is EXISTS or NOT EXISTS

Callers 1

convertMethod · 0.95

Calls 5

GetTextMethod · 0.80
GetStartMethod · 0.80
NAMED_BIND_PARAMETERMethod · 0.80
todoFunction · 0.70

Tested by

no test coverage detected