fix #134: Add new Num* methods in CRUD builders to count number of required clause

This commit is contained in:
Huan Du
2023-11-30 23:57:25 +08:00
parent b1bf57945d
commit 3706314572
8 changed files with 82 additions and 0 deletions
+14
View File
@@ -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
}