Subscribe rss
Blog categories
All | Backendless features
Feature 26: Encoding SQL search queries in console for use by REST clients
February 2, 2015 by markpiller

In one of my previous posts I wrote how to run SQL searches against your mBaaS backend data. The SQL queries you run in console can be used verbatim in your mobile and desktop applications built with Backendless whenever you need to run a search for the app data. We refer to the SQL queries supported by Backendless 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:

You 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 your 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.


Share this post
Tweet about this on TwitterShare on FacebookGoogle+