SQLPage v0.19.0 documentation

If you are completely new to SQLPage, you should start by reading the get started tutorial, which will guide you through the process of creating your first SQLPage application.

Building an application with SQLPage is quite simple. To create a new web page, just create a new SQL file. For each SELECT statement that you write, the data it returns will be analyzed and rendered to the user. The two most important concepts in SQLPage are components and parameters.

To select a component and set its top-level properties, you write the following SQL statement:

SELECT 'component_name' AS component, 'my value' AS top_level_parameter_1;

Then, you can set its row-level parameters by writing a second SELECT statement:

SELECT my_column_1 AS row_level_parameter_1, my_column_2 AS row_level_parameter_2 FROM my_table;

This page documents all the components provided by default in SQLPage and their parameters. Use this as a reference when building your SQL application. If at any point you need help, you can ask for it on the SQLPage forum.

If you know some HTML, you can also easily create your own components for your application.

components

The "tracking" component

Component for visualising activity logs or other monitoring-related data.

Introduced in SQLPage v0.18.0.

Top-level parameters

title

REQUIRED. Title of the tracking component.

center

Whether to center the component.

class

class attribute added to the container in HTML. It can be used to apply custom styling to this item through css. Added in v0.18.0.

description

A short paragraph.

description_md

A short paragraph formatted using markdown.

id

id attribute added to the container in HTML. It can be used to target this item through css or for scrolling to this item through links (use "#id" in link url).

information

A short text displayed below the title.

placement

Position of the tooltip (e.g. top, bottom, right, left)

width

Width of the component, between 1 and 12.

Row-level parameters

title

REQUIRED. Description of the state.

color

Color of the tracked item (e.g. success, warning, danger)

Example 1

A basic example of servers tracking component

select 
    'tracking'       as component,
    'Servers status' as title;
select 
    'No data' as title;
select 
    'No data' as title;
select 
    'No data' as title;
select 
    'No data' as title;
select 
    'No data' as title;
select 
    'No data' as title;
select 
    'No data' as title;
select 
    'No data' as title;

Result

Servers status

Example 2

An example of servers tracking component

select 
    'tracking'        as component,
    'Servers status'  as title,
    '60% are running' as information,
    'Status of all **currently running servers**' as description_md,
    'top'             as placement,
    4                 as width;
select 
    'success'     as color,
    'operational' as title;
select 
    'success'     as color,
    'operational' as title;
select 
    'success'     as color,
    'operational' as title;
select 
    'danger'   as color,
    'Downtime' as title;
select 
    'No data' as title;
select 
    'success'     as color,
    'operational' as title;
select 
    'warning'  as color,
    'Big load' as title;
select 
    'success'     as color,
    'operational' as title;

Result

Servers status
60% are running

Status of all currently running servers

Official SQLPage documentation