Add clause, DB API, model definition

This commit is contained in:
Jinzhu
2020-01-29 19:22:44 +08:00
parent 8eae7e4ab9
commit b9cce2be6a
11 changed files with 769 additions and 1 deletions
+53
View File
@@ -0,0 +1,53 @@
package clause
// Builder builder interface
type BuilderInterface interface {
Write(sql ...string) error
WriteQuoted(field interface{}) error
AddVar(vars ...interface{}) string
Quote(field interface{}) string
}
// Interface clause interface
type Interface interface {
Name() string
Build(builder BuilderInterface)
}
// NegationBuilder negation condition builder
type NegationBuilder interface {
NegationBuild(builder BuilderInterface)
}
// Where where clause
type Where struct {
}
// Select select attrs when querying, updating, creating
type Select struct {
Omit bool
}
// Join join clause
type Join struct {
}
// GroupBy group by clause
type GroupBy struct {
}
// Having having clause
type Having struct {
}
// Order order clause
type Order struct {
}
// Limit limit clause
type Limit struct {
}
// Offset offset clause
type Offset struct {
}