mirror of
https://github.com/neilotoole/sq.git
synced 2024-12-18 21:52:28 +03:00
9a1c6a7d09
- Implement --arg feature - Refactor sqlbuilder package (now called "render"). - Bug fixes, especially around expressions.
17 lines
293 B
Go
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
|
|
}
|