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

Method convertLikeExpr

internal/engine/clickhouse/convert.go:636–658  ·  view source on GitHub ↗
(n *chast.LikeExpr)

Source from the content-addressed store, hash-verified

634}
635
636func (c *cc) convertLikeExpr(n *chast.LikeExpr) *ast.A_Expr {
637 kind := ast.A_Expr_Kind(0)
638 opName := "~~"
639 if n.CaseInsensitive {
640 opName = "~~*"
641 }
642 if n.Not {
643 opName = "!~~"
644 if n.CaseInsensitive {
645 opName = "!~~*"
646 }
647 }
648
649 return &ast.A_Expr{
650 Kind: kind,
651 Name: &ast.List{
652 Items: []ast.Node{&ast.String{Str: opName}},
653 },
654 Lexpr: c.convertExpr(n.Expr),
655 Rexpr: c.convertExpr(n.Pattern),
656 Location: n.Pos().Offset,
657 }
658}
659
660func (c *cc) convertSubquery(n *chast.Subquery) *ast.SubLink {
661 return &ast.SubLink{

Callers 1

convertExprMethod · 0.95

Calls 3

convertExprMethod · 0.95
A_Expr_KindTypeAlias · 0.92
PosMethod · 0.65

Tested by

no test coverage detected