func CompleteSelectQuery(query string, scanner *Scan) string { if scanner.Table == nil { return query } return sql.CompleteSelectQuery(scanner.Table.SQLName, []string{}, query) }
func TestCompleteSelectQuery(t *testing.T) { assert.Equal(t, sql.CompleteSelectQuery("yolo", []string{"foo", "bar"}, ""), "SELECT foo,bar FROM yolo") assert.Equal(t, sql.CompleteSelectQuery("yolo", []string{}, "ORDER BY name"), "SELECT * FROM yolo ORDER BY name") }