MCPcopy
hub / github.com/gogf/gf / Test_DB_BatchInsert_Struct

Function Test_DB_BatchInsert_Struct

contrib/drivers/dm/dm_z_unit_basic_test.go:306–323  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

304}
305
306func Test_DB_BatchInsert_Struct(t *testing.T) {
307 // batch insert struct
308 table := "A_tables"
309 createInitTable(table)
310 defer dropTable(table)
311 gtest.C(t, func(t *gtest.T) {
312 user := &User{
313 ID: 700,
314 AccountName: "BatchInsert_Struct_700",
315 CreatedTime: time.Now(),
316 UpdatedTime: time.Now(),
317 }
318 result, err := db.Model(table).Insert(user)
319 t.AssertNil(err)
320 n, _ := result.RowsAffected()
321 t.Assert(n, 1)
322 })
323}
324
325func Test_DB_Update(t *testing.T) {
326 table := "A_tables"

Callers

nothing calls this directly

Calls 8

CFunction · 0.92
AssertNilMethod · 0.80
AssertMethod · 0.80
createInitTableFunction · 0.70
dropTableFunction · 0.70
InsertMethod · 0.65
ModelMethod · 0.65
RowsAffectedMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…