oracle supports insert multiple values

This commit is contained in:
zhangyd
2023-09-12 15:09:05 +08:00
parent 9cd8ddcc2c
commit 92b7453ec1
2 changed files with 47 additions and 0 deletions
+16
View File
@@ -65,6 +65,22 @@ func ExampleInsertBuilder() {
// [1 Huan Du 1 2 Charmy Liu 1 1234567890]
}
func ExampleInsertBuilder_Oracle() {
ib := Oracle.NewInsertBuilder()
ib.InsertInto("demo.user")
ib.Cols("id", "name", "status")
ib.Values(1, "Huan Du", 1)
ib.Values(2, "Charmy Liu", 1)
sql, args := ib.Build()
fmt.Println(sql)
fmt.Println(args)
// Output:
// INSERT ALL INTO demo.user (id, name, status) VALUES (:1, :2, :3) INTO demo.user (id, name, status) VALUES (:4, :5, :6) SELECT 1 from DUAL
// [1 Huan Du 1 2 Charmy Liu 1]
}
func ExampleInsertBuilder_insertIgnore() {
ib := NewInsertBuilder()
ib.InsertIgnoreInto("demo.user")