mirror of
https://github.com/hanzoai/sqlbuilder.git
synced 2026-10-01 00:37:42 +00:00
fix #134: Add new Num* methods in CRUD builders to count number of required clause
This commit is contained in:
@@ -211,3 +211,17 @@ func ExampleInsertBuilder_subSelect_oracle() {
|
||||
// INSERT INTO demo.user (id, name) SELECT id, name FROM demo.test WHERE id = :1
|
||||
// [1]
|
||||
}
|
||||
|
||||
func ExampleInsertBuilder_NumValue() {
|
||||
ib := NewInsertBuilder()
|
||||
ib.InsertInto("demo.user")
|
||||
ib.Cols("id", "name")
|
||||
ib.Values(1, "Huan Du")
|
||||
ib.Values(2, "Charmy Liu")
|
||||
|
||||
// Count the number of values.
|
||||
fmt.Println(ib.NumValue())
|
||||
|
||||
// Output:
|
||||
// 2
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user