mirror of
https://github.com/neilotoole/sq.git
synced 2024-12-22 15:41:35 +03:00
9a1c6a7d09
- Implement --arg feature - Refactor sqlbuilder package (now called "render"). - Bug fixes, especially around expressions.
17 lines
403 B
Go
17 lines
403 B
Go
package render
|
|
|
|
import (
|
|
"github.com/neilotoole/sq/libsq/ast"
|
|
"github.com/neilotoole/sq/libsq/core/errz"
|
|
)
|
|
|
|
func doFromTable(rc *Context, tblSel *ast.TblSelectorNode) (string, error) {
|
|
tblName, _ := tblSel.SelValue()
|
|
if tblName == "" {
|
|
return "", errz.Errorf("selector has empty table name: {%s}", tblSel.Text())
|
|
}
|
|
|
|
clause := "FROM " + rc.Dialect.Enquote(tblSel.TblName())
|
|
return clause, nil
|
|
}
|