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

Method Insert

bench/sqlx.go:48–60  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

46}
47
48func (sqlx *Sqlx) Insert(b *testing.B) {
49 m := NewModel()
50
51 b.ReportAllocs()
52 b.ResetTimer()
53
54 for i := 0; i < b.N; i++ {
55 _, err := sqlx.conn.Exec(sqlxInsertSQL, m.Name, m.Title, m.Fax, m.Web, m.Age, m.Right, m.Counter)
56 if err != nil {
57 helper.SetError(b, sqlx.Name(), "Insert", err.Error())
58 }
59 }
60}
61
62func (sqlx *Sqlx) InsertMulti(b *testing.B) {
63 ms := make([]*Model, 0, 100)

Callers

nothing calls this directly

Calls 5

NameMethod · 0.95
SetErrorFunction · 0.92
NewModelFunction · 0.85
ErrorMethod · 0.65
ExecMethod · 0.45

Tested by

no test coverage detected