mirror of
https://github.com/hanzoai/sqlbuilder.git
synced 2026-10-01 00:37:42 +00:00
more tests
This commit is contained in:
@@ -19,6 +19,7 @@ func ExampleDeleteBuilder() {
|
||||
),
|
||||
"modified_at > created_at + "+db.Var(86400), // It's allowed to write arbitrary SQL.
|
||||
)
|
||||
|
||||
sql, args := db.Build()
|
||||
fmt.Println(sql)
|
||||
fmt.Println(args)
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// Copyright 2018 Huan Du. All rights reserved.
|
||||
// Licensed under the MIT license that can be found in the LICENSE file.
|
||||
|
||||
package sqlbuilder
|
||||
|
||||
import (
|
||||
@@ -10,6 +13,7 @@ func ExampleInsertBuilder() {
|
||||
ib.Cols("id", "name", "status", "created_at")
|
||||
ib.Values(1, "Huan Du", 1, ib.Raw("UNIX_TIMESTAMP(NOW())"))
|
||||
ib.Values(2, "Charmy Liu", 1, 1234567890)
|
||||
|
||||
sql, args := ib.Build()
|
||||
fmt.Println(sql)
|
||||
fmt.Println(args)
|
||||
|
||||
@@ -24,6 +24,7 @@ func ExampleUpdateBuilder() {
|
||||
),
|
||||
"modified_at > created_at + "+ub.Var(86400), // It's allowed to write arbitrary SQL.
|
||||
)
|
||||
|
||||
sql, args := ub.Build()
|
||||
fmt.Println(sql)
|
||||
fmt.Println(args)
|
||||
|
||||
Reference in New Issue
Block a user