2016-04-13 15:51:58 +02:00
|
|
|
package boil
|
|
|
|
|
2016-04-19 04:02:32 +02:00
|
|
|
import "database/sql"
|
|
|
|
|
2016-04-13 15:51:58 +02:00
|
|
|
type where struct {
|
|
|
|
clause string
|
|
|
|
args []interface{}
|
|
|
|
}
|
|
|
|
|
|
|
|
type Query struct {
|
2016-04-16 09:25:00 +02:00
|
|
|
executor Executor
|
2016-04-19 04:02:32 +02:00
|
|
|
delete bool
|
|
|
|
update map[string]interface{}
|
2016-04-16 09:25:00 +02:00
|
|
|
selectCols []string
|
|
|
|
from string
|
|
|
|
joins []string
|
|
|
|
where []where
|
|
|
|
groupBy []string
|
|
|
|
orderBy []string
|
|
|
|
having []string
|
|
|
|
limit int
|
2016-04-13 15:51:58 +02:00
|
|
|
}
|
|
|
|
|
2016-04-19 04:02:32 +02:00
|
|
|
func SetDelete(q *Query, flag bool) {
|
|
|
|
q.delete = flag
|
|
|
|
}
|
|
|
|
|
|
|
|
func SetUpdate(q *Query, cols map[string]interface{}) {
|
|
|
|
q.update = cols
|
|
|
|
}
|
|
|
|
|
|
|
|
func SetExecutor(q *Query, exec Executor) {
|
|
|
|
q.executor = exec
|
|
|
|
}
|
|
|
|
|
|
|
|
func SetSelect() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
func SetFrom() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
func SetJoins() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
func SetWhere() {
|
|
|
|
|
2016-04-13 15:51:58 +02:00
|
|
|
}
|
|
|
|
|
2016-04-19 04:02:32 +02:00
|
|
|
func SetGroupBy() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
func SetOrderBy() {
|
|
|
|
|
2016-04-16 07:17:25 +02:00
|
|
|
}
|
|
|
|
|
2016-04-19 04:02:32 +02:00
|
|
|
func SetHaving() {
|
2016-04-13 15:51:58 +02:00
|
|
|
|
2016-04-19 04:02:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func SetLimit() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
func ExecQuery(q *Query) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func ExecQueryOne(q *Query) (*sql.Row, error) {
|
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func ExecQueryAll(q *Query) (*sql.Rows, error) {
|
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func buildQuery(q *Query) string {
|
|
|
|
return ""
|
2016-04-13 15:51:58 +02:00
|
|
|
}
|