Created
July 22, 2017 13:01
-
-
Save fgoinai/43726311482ce1455b51e62d38a4a2de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//以下是SQL Builder... | |
type stmtOption interface{} | |
type stdOption struct{ | |
stmtOption | |
params []string | |
} | |
type selectB stdOption | |
... | |
type joinB { | |
stmtOption | |
param map[string][]string | |
} | |
... | |
type SqlBuilder struct { | |
opQueue []stmtOption //Javaer在此微笑 | |
} | |
func (b *SqlBuilder) Select(xs ...string) *SqlBuilder { | |
b.opQueue = append(b.opQueue, selectB{params: xs}) //来,都排好队,build时才一次过处理 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment