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

Method Read

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

Source from the content-addressed store, hash-verified

88}
89
90func (dbr *Dbr) Read(b *testing.B) {
91 m := NewModel2()
92
93 _, err := dbr.conn.InsertInto("models").Columns(columns...).Record(m).Exec()
94 if err != nil {
95 helper.SetError(b, dbr.Name(), "Read", err.Error())
96 }
97
98 b.ReportAllocs()
99 b.ResetTimer()
100
101 for i := 0; i < b.N; i++ {
102 _, err := dbr.conn.Select("*").From("models").Where("id = ?", m.ID).Load(m)
103 if err != nil {
104 helper.SetError(b, dbr.Name(), "Read", err.Error())
105 }
106 }
107}
108
109func (dbr *Dbr) ReadSlice(b *testing.B) {
110 m := NewModel2()

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected