Ejemplo n.º 1
0
func GetByID(id uint64) (*Foo, error) {
	item, err := dbutil.Select(
		dbutil.ParseRowFunc(ParseRow),
		BY_ID_STMT,
		id,
	)
	return item.(*Foo), err
}
Ejemplo n.º 2
0
func GetAll() ([]*Foo, error) {
	var items []*Foo
	objects, err := dbutil.SelectList(
		dbutil.ParseRowFunc(ParseRow),
		SELECT_STMT,
	)
	for _, i := range objects {
		items = append(items, i.(*Foo))
	}
	return items, err
}