MCPcopy Create free account
hub / github.com/efectn/go-orm-benchmarks / Insert

Method Insert

bench/dbr.go:45–57  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

43}
44
45func (dbr *Dbr) Insert(b *testing.B) {
46 m := NewModel2()
47
48 b.ReportAllocs()
49 b.ResetTimer()
50
51 for i := 0; i < b.N; i++ {
52 _, err := dbr.conn.InsertInto("models").Columns(columns...).Record(m).Exec()
53 if err != nil {
54 helper.SetError(b, dbr.Name(), "Insert", err.Error())
55 }
56 }
57}
58
59func (dbr *Dbr) InsertMulti(b *testing.B) {
60 helper.SetError(b, dbr.Name(), "InsertMulti", "bulk-insert is not supported")

Callers

nothing calls this directly

Calls 6

NameMethod · 0.95
SetErrorFunction · 0.92
NewModel2Function · 0.85
ColumnsMethod · 0.80
ErrorMethod · 0.65
ExecMethod · 0.45

Tested by

no test coverage detected