code: func (ap *AuthPermission) Update(db XODB) error {
  	var err error
  
  	// if doesn't exist, bail
  	if !ap._exists {
  		return errors.New("update failed: does not exist")
  	}
  
  	// if deleted, bail
  	if ap._deleted {
  		return errors.New("update failed: marked for deletion")
  	}
  
  	// sql query
  	const sqlstr = `UPDATE auth_permission SET ` +
  		`content_type_id = ?, codename = ?, name = ?` +
  		` WHERE id = ?`
  
  	// run query
  	XOLog(sqlstr, ap.ContentTypeID, ap.Codename, ap.Name, ap.ID)
  	_, err = db.Exec(sqlstr, ap.ContentTypeID, ap.Codename, ap.Name, ap.ID)
  	return err
  }
docs: // Update updates the AuthPermission in the database.