Skip to content

Commit a42350d

Browse files
committed
支持SQL查询部分拼接
1 parent 51cd267 commit a42350d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sqlbuilder/builder.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import (
66
)
77

88
// NewQuery new 实例
9-
func NewQuery(querySQL string) *Query {
9+
func NewQuery(querySQL string, args ...interface{}) *Query {
1010
return &Query{
11-
query: querySQL,
11+
query: fmt.Sprintf(querySQL, args...),
1212
whereStmt: []string{},
1313
whereArgs: []interface{}{},
1414
limitArgs: []interface{}{},

0 commit comments

Comments
 (0)