MCPcopy Create free account
hub / github.com/PostHog/duckgres / NeedsBooleanPredicateRewrite

Function NeedsBooleanPredicateRewrite

transpiler/boolpredicates.go:18–20  ·  view source on GitHub ↗
(sql string)

Source from the content-addressed store, hash-verified

16var booleanPredicatePattern = regexp.MustCompile(`(?is)(?:\btrue\b|\bfalse\b)[\s)]*(?:=|!=|<>)|(?:=|!=|<>)[\s(]*(?:\btrue\b|\bfalse\b)`)
17
18func NeedsBooleanPredicateRewrite(sql string) bool {
19 return booleanPredicatePattern.MatchString(sql)
20}
21
22func RewriteBooleanPredicates(sql string) (string, bool, error) {
23 sql = strings.TrimSpace(sql)

Callers 3

ClassifyFunction · 0.85
RewriteBooleanPredicatesFunction · 0.85

Calls

no outgoing calls