SQLite Query
SQLite Query can be set up to automatically execute SQL statements as soon as a page or widget loads. This feature is useful for fetching data from the database to display on a page or widget, such as populating a ListView with items or showing user preferences in Text widgets.
Prerequisites
Before you add this query, ensure you configure the database and define the query. Check detailed instructions here.
Adding SQLite query
Let's see how to display a list of items from the database using the SQLite query. Here are the steps:
1. Add query
Go to your project page and follow the steps below to define an SQLite query:
- Select the widget (or page) on which to apply the query.
- Select Backend Query from the Properties Panel (the right menu).
- Click Add Query and set the Query Type to SQLite Query.
- Select the Query Name. (Only Read Queries will be displayed here.)
- Click Confirm.
2. Showing query data in UI element
Once you have the SQLite query defined, you can use the data retrieved from the query to display on widgets present inside. Follow the steps below:
- Select the widget (e.g.,
Text
) on which you want to display the data. - From the Properties Panel, open the Set from Variable menu > select [your query name] Row > select the column data that you want display here.
- Click Confirm.