Backendless Support
 

Encoding SQL search queries in console for use by REST clients

The SQL queries a developer runs in Backendless console can be used verbatim in his/her mobile and desktop applications built with Backendless whenever an owner needs to run a search for the app data.The SQL queries supported by Backendless are referred to as the "where clause" since it must contain the WHERE part of an SQL statement.

When a REST client runs a data search, the SQL query is a parameter in the request URI. As a result, it must be a URL-encoded value. To make it easy for developers to get an encoded value, Backendless console provides a way to encode SQL queries. For instance, using the Restaurant-to-Go app I've been using in this series, the following where clause runs a search for all restaurants with the name which includes the word "Cantina" and located in Frisco:
name LIKE '%cantina%' and locations.city = 'Frisco'

One can try running it against the Restaurant table to see the result: 

NOTICE: the URL Encode button right next to the SQL Search toggle. When you click the button, Backendless encodes the current SQL query so it can be used in a REST application: 

Once the value is encoded, it can be copied/pasted into your app which uses Backendless REST API. Also, for the best developer's convenience the URL Decode button reverses the encoding back.

For additional information see the documentation on how to use the Data Service API in a REST client.

Review related topic:

Is article helpful?