lxd/db/containers.go
func ContainerUpdate(tx *sql.Tx, id int, description string, architecture int, ephemeral bool,
	expiryDate time.Time) error {
	str := fmt.Sprintf("UPDATE containers SET description=?, architecture=?, ephemeral=?, expiry_date=? WHERE id=?")
	stmt, err := tx.Prepare(str)
	if err != nil {
		return err
	}
	defer stmt.Close()

	ephemeralInt := 0
	if ephemeral {
		ephemeralInt = 1
	}

	if expiryDate.IsZero() {
		_, err = stmt.Exec(description, architecture, ephemeralInt, "", id)
	} else {
		_, err = stmt.Exec(description, architecture, ephemeralInt, expiryDate, id)
	}
	if err != nil {
		return err
	}

	return nil
}
func ContainerUpdate(tx *sql.Tx, id int, description string, architecture int, ephemeral bool,
	expiryDate time.Time) error {
	str := fmt.Sprintf("UPDATE containers SET description=?, architecture=?, ephemeral=?, expiry_date=? WHERE id=?")
	stmt, err := tx.Prepare(str)
	if err != nil {
		return err
	}
	defer stmt.Close()

	ephemeralInt := 0
	if ephemeral {
		ephemeralInt = 1
	}

	if expiryDate.IsZero() {
		_, err = stmt.Exec(description, architecture, ephemeralInt, "", id)
	} else {
		_, err = stmt.Exec(description, architecture, ephemeralInt, expiryDate, id)
	}
	if err != nil {
		return err
	}

	return nil
}
func ContainerUpdate ( tx * sql . Tx , id int , description string , architecture int , ephemeral bool , expiryDate time . Time ) error { str := fmt . Sprintf ( " " ) stmt , err := tx . Prepare ( str ) if err != nil { return err } defer stmt . Close ( ) ephemeralInt := 0 if ephemeral { ephemeralInt = 1 } if expiryDate . IsZero ( ) { _ , err = stmt . Exec ( description , architecture , ephemeralInt , " " , id ) } else { _ , err = stmt . Exec ( description , architecture , ephemeralInt , expiryDate , id ) } if err != nil { return err } return nil }
// ContainerUpdate updates the description, architecture and ephemeral flag of
// the container with the given ID.
ContainerUpdate updates the description architecture and ephemeral flag of the container with the given ID .