You are here:
Generate a Datasource Preview
To verify that you correctly defined the datasource contract, review the SQL statement generated from the datasource contract.
Required Editions
To explore and query SQLite databases, we recommend that you use the SQLite (or equivalent) extension in Microsoft Visual Studio Code.
| Available in: Enterprise, Performance, and Unlimited Editions |
| User Permissions Needed | |
|---|---|
| To generate datasource preview: | Customizer, Admin |
Extract the SQL query statement that’s constructed from your datasource contract. Then, execute the SQL query against the database to confirm that the query is constructed properly.
- At the command prompt or in a Terminal window, change directory to your workspace.
-
Build the workspace. Run:
sf modeler workspace buildAlternatively, run one of these alias commands:-
mdl ws build -
mdl build
-
-
Start the server. Run:
sf modeler workspace server startAlternatively, run one of these alias commands:-
mdl ws server start -
mdl ws simulate -
mdl simulate
-
- To view the reference application or the app in a simulated UI, open the URL http://localhost:3000/framework/index.html?desktop in a Google Chrome browser in incognito mode.
-
Open Chrome Dev Tools and enable Toggle device toolbar (⌘ ⇧ M).
Make sure Info logs are available.
- On the simulator app in the development mode, press F12 or tap thrice on the header or any area outside the widgets to open the logs. On the Log Settings tab, ensure that Enable Logs / AppLogs is enabled and Logs to console is selected.
-
To locate the SQL statements constructed from the DS file, use one of these
options:
- On the Logs tab, scroll to the log entry containing the desired SQL statement.
- On Chrome Dev Tools → Console tab, run a search and go to the desired SQL query in the logs.
-
Copy the SQL statement to a new query in SQLite and format the statement to make it
readable. Run the query on the database.
Important Make sure that you replace the ‘?’ character in the SQL statement with the necessary parameters for a successful execution of the SQL query. -
Review and verify that the generated output is as expected.
If the query returns empty or incomplete results, make the necessary changes to the datasource contract and repeat the procedure.
Did this article solve your issue?
Let us know so we can improve!

