SQLPage v0.20.3 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 "rss" component

Produces a data flow in the RSS format. Can be used to generate a podcast feed. To use this component, you must first return an HTTP header with the "application/rss+xml" content type (see http_header component). Next, you must use the shell-empty component to avoid that SQLPage generates HTML code.

Introduced in SQLPage v0.20.0.

Top-level parameters

description

REQUIRED. Describes the channel.

link

REQUIRED. Defines the hyperlink to the channel.

title

REQUIRED. Defines the title of the channel.

author

Defines the group, person, or people responsible for creating the channel.

category

Defines the category of the channel. The value should be a string representing the category (e.g., "News", "Technology", etc.).

complete

Specifies that a channel is complete and will not post any more items in the future.

copyright

Provides the copyright details for the channel.

explicit

Indicates whether the channel contains explicit content. The value can be either TRUE or FALSE.

funding_url

Specifies the donation/funding links for the channel. The content of the tag is the recommended string to be used with the link.

guid

The globally unique identifier (GUID) for a channel. The value is a UUIDv5.

image_url

Provides a URL linking to the artwork for the channel.

language

Defines the language of the channel, specified in the ISO 639 format. For example, "en" for English, "fr" for French.

locked

Tells podcast hosting platforms whether they are allowed to import this feed.

self_link

URL of the RSS feed.

type

Specifies the channel as either episodic or serial. The value can be either "episodic" or "serial".

Row-level parameters

description

REQUIRED. Describes the item

link

REQUIRED. Defines the hyperlink to the item (blog post URL, etc.).

title

REQUIRED. Defines the title of the feed item (episode name, blog post title, etc.).

block

Prevents a specific item from appearing in podcast listening applications.

date

Indicates when the item was published (RFC-822 date-time).

duration

The duration of an item in seconds.

enclosure_length

The length in bytes of the audio/video episode content.

enclosure_type

The MIME media type of the audio/video episode content (e.g., "audio/mpeg", "audio/m4a", "video/m4v", "video/mp4").

enclosure_url

For podcast episodes, provides a URL linking to the audio/video episode content, in mp3, m4a, m4v, or mp4 format.

episode

The chronological number that is associated with an item.

episode_type

Defines the type of content for a specific item. The value can be either "full", "trailer", or "bonus".

explicit

Indicates whether the item contains explicit content. The value can be either TRUE or FALSE.

guid

The globally unique identifier (GUID) for an item.

image_url

Provides a URL linking to the artwork for the item.

season

The chronological number associated with an item's season.

transcript_type

The type of the transcript or closed captions file for the item (e.g., "text/plain", "text/html", "text/vtt", "application/json", "application/x-subrip").

transcript_url

A link to a transcript or closed captions file for the item.

Examples

An RSS channel about SQLPage latest news.

select 'http_header' as component, 'application/rss+xml' as content_type;
select 'shell-empty' as component;
select
  'rss' as component,
  'SQLPage blog' as title,
  'https://sql.ophir.dev/blog.sql' as link,
  'latest news about SQLpage' as description,
  'en' as language,
  'Technology' as category,
  FALSE as explicit,
  'https://sql.ophir.dev/favicon.ico' as image_url,
  'Ophir Lojkine' as author,
  'https://github.com/sponsors/lovasoa' as funding_url,
  'episodic' as type;
select
  'Hello everyone !' as title,
  'https://sql.ophir.dev/blog.sql?post=Come%20see%20me%20build%20twitter%20live%20on%20stage%20in%20Prague' as link,
  'If some of you european SQLPagers are around Prague this december, I will be giving a talk about SQLPage at pgconf.eu on December 14th.' as description,
  'http://127.0.0.1:8080/sqlpage_introduction_video.webm' as enclosure_url,
  123456789 as enclosure_length,
  'video/webm' as enclosure_type,
  '2023-12-04' as date;

Once you have your rss feed ready, you can submit it to podcast directories like Apple Podcasts, Spotify, Google Podcasts...

Official SQLPage documentation