MCPcopy Index your code
hub / github.com/Masterminds/structable / LoadByName

Method LoadByName

example/users.go:38–40  ·  view source on GitHub ↗

LoadByName is a custom loader. The Load() method on a Recorder loads by ID. This allows us to load by a different field -- Name.

()

Source from the content-addressed store, hash-verified

36// The Load() method on a Recorder loads by ID. This allows us to load by
37// a different field -- Name.
38func (u *User) LoadByName() error {
39 return u.Recorder.LoadWhere("name = ? order by id desc", u.Name)
40}
41
42func main() {
43

Callers 1

mainFunction · 0.95

Calls 1

LoadWhereMethod · 0.65

Tested by

no test coverage detected