The Read operation gives the API the ability to read Database table records.
API Reply to the Unity Game
Once called, this API can reply with:
- the list of all the table records;
- the list of the records that contain the provided Keys;
- a single record that contains the provided Keys.
Read options
ID as Key | the 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. |
One record only | the data sent to the Unity game will contain one record only. It’s supposed that this API has been configured properly in order to read one record only. |
Order by | the order to use when the API reads more records. It requires the selection of one column and the order direction (ascending or descending). |
Column option
Read | the value of this column is read and included in the group of data this API will send to the Unity game. |
None | this column will be ignored in the reading operation. |
Key | this column value will be used exclusively as an ID for records selection. |
MySQL interaction
From the MySQL point of view, this operation builds a SELECT query with this base form:
SELECT columns FROM table WHERE keys ORDER BY order
- columns: all the columns with the option “Read”;
- table: the selected table this API is reading;
- 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;
- order (optional): the column to use for ordering and the order direction.