1. Home
  2. Docs
  3. UniREST Solution 3.5
  4. UniREST Server
  5. API Manager
  6. Update

Update

The Update operation gives the API the ability to modify data of existing records of a Database table. Because this operation needs to know which record to update, the Keys definitions are mandatory. If there are no Keys, an alert icon will appear near the UPDATE label.

API Reply to the Unity Game

Once called, this API will reply with the number of updated records (if the operation succeeds).

Update options

ID as Keythe record ID will be used in the records research. If there are columns set as “Key”, the ID and that columns will be used together.
Can Writethe Update operation becomes able to write a new record. This feature requires a column set as Key. If a record with that Key doesn’t exist, a new record is written, otherwise, the found record is updated.
See the “Update()” method in the “UniREST Client” chapter for more details.
Dynamic UpdateObsolete from UniREST 2.0 version.

Column option

Updatethe value of this column will be updated with a new value received from the Unity game.
Nonethis column will be ignored in the updating operation.
Keythis column value will be used exclusively as an ID for records selection.

MySQL interaction

From the MySQL point of view, this operation builds an UPDATE query with this base form:

UPDATE table SET columns=values WHERE keys

  • table: the selected table this API is updating;
  • columns/values: all the columns with the option “Update” set with the values received from the Unity game;
  • keys: all the columns with the option “Key” and the ID if the “ID as key” option is selected. All the keys are joined by an AND operator;