package model import ( "log" ) type RecipeStep struct { Id string // FIXME has to be uint RecipeId string // FIXME has to be uint Index string // FIXME has to be uint Text string } func (d *RecipeStep) String() string { return d.Text } func (d *RecipeStep) FromDB() error { query, err := GetSql(`recipe-step-select`) if err != nil { return err } err = db.QueryRow(query, d.Id).Scan( &d.Id, &d.RecipeId, &d.Index, &d.Text, ) log.Printf("d.Text: %s %s %s %s\n", d.Id, d.RecipeId, d.Index, d.Text) return err }