lxd/db/query/config.go
func UpdateConfig(tx *sql.Tx, table string, values map[string]string) error {
	changes := map[string]string{}
	deletes := []string{}

	for key, value := range values {
		if value == "" {
			deletes = append(deletes, key)
			continue
		}
		changes[key] = value
	}

	err := upsertConfig(tx, table, changes)
	if err != nil {
		return errors.Wrap(err, "updating values failed")
	}

	err = deleteConfig(tx, table, deletes)
	if err != nil {
		return errors.Wrap(err, "deleting values failed")
	}

	return nil
}
func UpdateConfig(tx *sql.Tx, table string, values map[string]string) error {
	changes := map[string]string{}
	deletes := []string{}

	for key, value := range values {
		if value == "" {
			deletes = append(deletes, key)
			continue
		}
		changes[key] = value
	}

	err := upsertConfig(tx, table, changes)
	if err != nil {
		return errors.Wrap(err, "updating values failed")
	}

	err = deleteConfig(tx, table, deletes)
	if err != nil {
		return errors.Wrap(err, "deleting values failed")
	}

	return nil
}
// UpdateConfig updates the given keys in the given table. Config keys set to
// empty values will be deleted.