2. Adapters

Adapters are the backbone of the UI Components. 1. SQL Runner Adapter

The SQL Runner Adapter holds the connection to a database, we can run an SQL Query by calling the execAsync function. execAsync(query: string) -> Promise<result> run an SQL and receive the result.

How to use SQL Runner?

We can use it in the script of JavaScript Runner to perform a query. For example, we can write a script to run a query and get the result to render. sql_runner.execAsync("select 1").then((result)=>{

data_table.value = result; })

2. JavaScript Runner Adapter. The JavaScript Runner Adapter can be linked with UI components to handle its events.

The JavaScript Runner can only run JavaScript. It's an isolation context, there are a few built-in functions:

  • alert(string): show an alert dialog.

  • prompt(string): show a dialog with input.

  • confirm(string): show a confirmation dialog.

You can also access all the UI component objects in the script referenced by their names.

Last updated