sq/libsq/ast/render/where.go
Neil O'Toole 9a1c6a7d09
Feature/173 args (#183)
- Implement --arg feature
- Refactor sqlbuilder package (now called "render").
- Bug fixes, especially around expressions.
2023-04-07 02:00:49 -06:00

17 lines
293 B
Go

package render
import "github.com/neilotoole/sq/libsq/ast"
func doWhere(rc *Context, where *ast.WhereNode) (string, error) {
if where == nil {
return "", nil
}
sql, err := rc.Renderer.Expr(rc, where.Expr())
if err != nil {
return "", err
}
sql = "WHERE " + sql
return sql, nil
}