code: func (d *Database) Update(db DB, table string, src interface{}) error {
  	// gather the query parts
  	names, err := d.Columns(src, false)
  	if err != nil {
  		return err
  	}
  	placeholders, err := d.Placeholders(src, false)
  	if err != nil {
  		return err
  	}
  	values, err := d.Values(src, false)
  	if err != nil {
  		return err
  	}
  
  	// form the column=placeholder pairs
  	var pairs []string
  	for i := 0; i < len(names) && i < len(placeholders); i++ {
  		pair := fmt.Sprintf("%s=%s", d.quoted(names[i]), placeholders[i])
  		pairs = append(pairs, pair)
  	}
  
  	pkName, pkValue, err := d.PrimaryKey(src)
  	if err != nil {
  		return err
  	}
  	if pkName == "" {
  		return fmt.Errorf("meddler.Update: no primary key field")
  	}
  	if pkValue < 1 {
  		return fmt.Errorf("meddler.Update: primary key must be an integer > 0")
  	}
  	ph := d.placeholder(len(placeholders) + 1)
  
  	// run the query
  	q := fmt.Sprintf("UPDATE %s SET %s WHERE %s=%s", d.quoted(table),
  		strings.Join(pairs, ","),
  		d.quoted(pkName), ph)
  	values = append(values, pkValue)
  
  	if _, err := db.Exec(q, values...); err != nil {
  		return &dbErr{msg: "meddler.Update: DB error in Exec", err: err}
  	}
  
  	return nil
  }
docs: // Update performs and UPDATE query for the given record.
  // The record must have an integer primary key field that is non-zero,
  // and it will be used to select the database row that gets updated.