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.
components are small user interface elements that you can use to display your data in a certain way.
top-levelparameters are the properties of these components, allowing you to customize their appearance and behavior.
row-levelparameters constitute the data that you want to display in the components.
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.
A paragraph of text. The entire component will render as a single paragraph, with each item being rendered as a span of text inside it, the styling of which can be customized using parameters.
Top-level parameters
center
Whether to center the title.
contents
A top-level paragraph of text to display, without any formatting, without having to make additional queries.
contents_md
Rich text in the markdown format. Among others, this allows you to write bold text using **bold**, italics using *italics*, and links using [text](https://example.com).
html
Raw html code to include on the page. Don't use that if you are not sure what you are doing, it may have security implications.
title
Text header before the paragraph.
width
How wide the paragraph should be, in characters.
Row-level parameters
contents
REQUIRED. A span of text to display
bold
Whether the span of text should be displayed as bold.
break
Indicates that the current span of text starts a new paragraph.
code
Use a monospace font. Useful to display the text as code.
color
The name of a color for this span of text.
italics
Whether the span of text should be displayed as italics.
link
An URL to which the user should be taken when they click on this span of text.
size
A number between 1 and 6 indicating the font size.
underline
Whether the span of text should be underlined.
Example 1
Rendering a simple text paragraph.
select
'text' as component,
'Hello, world ! <3' as contents;
Result
Hello, world ! <3
Example 2
Rendering rich text using markdown
select
'text' as component,
'
# Markdown in SQLPage
## Simple formatting
SQLPage supports only plain text as column values, but markdown allows easily adding **bold**, *italics*, and [links](index.sql).
## Lists
### Unordered lists
* SQLPage is easy
* SQLPage is fun
* SQLPage is free
### Ordered lists
1. SQLPage is fast
2. SQLPage is safe
3. SQLPage is open-source
## Code
```sql
SELECT ''list'' AS component;
SELECT name as title FROM users;
```
## Tables
| SQLPage component | Description | Documentation link |
| --- | --- | --- |
| text | A paragraph of text. | [Documentation](https://sql.ophir.dev/documentation.sql?component=text) |
| list | A list of items. | [Documentation](https://sql.ophir.dev/documentation.sql?component=list) |
| steps | A progress indicator. | [Documentation](https://sql.ophir.dev/documentation.sql?component=steps) |
| form | A series of input fields. | [Documentation](https://sql.ophir.dev/documentation.sql?component=form) |
## Quotes
> Fantastic.
>
> — [HackerNews User](https://news.ycombinator.com/item?id=36194473#36209061) about SQLPage
## Images

## Horizontal rules
---
' as contents_md;
Result
Markdown in SQLPage
Simple formatting
SQLPage supports only plain text as column values, but markdown allows easily adding bold, italics, and links.
Lists
Unordered lists
SQLPage is easy
SQLPage is fun
SQLPage is free
Ordered lists
SQLPage is fast
SQLPage is safe
SQLPage is open-source
Code
SELECT 'list' AS component;
SELECT name as title FROM users;
select
'text' as component,
'About SQL' as title;
select
'SQL' as contents,
TRUE as bold,
TRUE as italics;
select
' is a domain-specific language used in programming and designed for managing data held in a ' as contents;
select
'relational database management system' as contents,
'https://en.wikipedia.org/wiki/Relational_database' as link;
select
'. It is particularly useful in handling structured data.' as contents;
Result
About SQL
SQL is a domain-specific language used in programming and designed for managing data held in a relational database management system. It is particularly useful in handling structured data.