Files
wehub-resource-sync d718c5a372
CI / compile_and_lint (push) Failing after 0s
CI / docker_build (linux/amd64, -linux-amd64-duckdb, duckdb) (push) Failing after 0s
CI / docker_build (linux/arm64, -linux-arm64, minimal) (push) Failing after 2s
CI / docker_build (linux/arm64, -linux-arm64-duckdb, duckdb) (push) Failing after 1s
CI / docker_build (linux/amd64, minimal) (push) Failing after 1s
CI / test (, sqlite, sqlite::memory:) (push) Has been skipped
CI / test (mssql, mssql, mssql://root:Password123!@127.0.0.1/sqlpage) (push) Has been skipped
CI / test (mysql, mysql, mysql://root:Password123!@127.0.0.1/sqlpage) (push) Has been skipped
CI / test (oracle, oracle, Driver=Oracle 21 ODBC driver;Dbq=//127.0.0.1:1521/FREEPDB1;Uid=root;Pwd=Password123!) (push) Has been skipped
CI / test (postgres, odbc, Driver=PostgreSQL Unicode;Server=127.0.0.1;Port=5432;Database=sqlpage;UID=root;PWD=Password123!, true) (push) Has been skipped
CI / test (postgres, postgres, postgres://root:Password123!@127.0.0.1/sqlpage) (push) Has been skipped
CI / playwright (push) Has been skipped
CI / docker_build (linux/arm/v7, -linux-arm-v7, minimal) (push) Failing after 0s
CI / hurl_examples (push) Failing after 8s
deploy website / deploy_official_site (push) Failing after 1s
CI / hurl (${{ matrix.example }}) (push) Has been skipped
CI / docker_push (duckdb) (push) Has been cancelled
CI / docker_push (minimal) (push) Has been cancelled
CI / windows_test (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:31:57 +08:00

88 lines
4.1 KiB
SQL
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
select 'http_header' as component,
'public, max-age=300, stale-while-revalidate=3600, stale-if-error=86400' as "Cache-Control",
'<https://sql-page.com/your-first-sql-website/>; rel="canonical"' as "Link";
set os = COALESCE($os, case
when sqlpage.header('user-agent') like '%windows%' then 'windows'
when sqlpage.header('user-agent') like '%x11; linux%' then 'linux'
when sqlpage.header('user-agent') like '%x11; ubuntu; linux%' then 'linux'
when sqlpage.header('user-agent') like '%x11; debian; linux%' then 'linux'
when sqlpage.header('user-agent') like '%macintosh%' then 'macos'
else 'any'
end);
-- Fetch the page title and header from the database
select 'dynamic' as component, json_patch(json_extract(properties, '$[0]'), json_object(
'title', 'SQL to Website - Tutorial',
'description', 'Convert your SQL database into a website in minutes. In this 5-minute guide, we will create a simple website from scratch, and learn the basics of SQLPage.'
)) as properties
FROM example WHERE component = 'shell' LIMIT 1;
SET req = '{
"url": "https://api.github.com/repos/sqlpage/SQLPage/releases/latest",
"timeout_ms": 200
}';
SET api_results = sqlpage.fetch_with_meta($req);
SET sqlpage_version = COALESCE(json_extract($api_results, '$.body.tag_name'), '');
SELECT 'hero' as component,
'Your first SQL Website' as title,
'[SQLPage](/) is a free tool for building data-driven apps quickly.
Let''s create a simple website with a database from scratch, to learn SQLPage basics.' as description_md,
case $os
when 'linux' then 'get_started_linux.webp'
when 'macos' then 'get_started_macos.webp'
when 'windows' then 'get_started_windows.webp'
else 'get_started.webp'
end as image,
CASE $os
WHEN 'macos' THEN '#download'
WHEN 'windows' THEN 'https://github.com/sqlpage/SQLPage/releases/latest/download/sqlpage-windows.zip'
WHEN 'linux' THEN 'https://github.com/sqlpage/SQLPage/releases/latest/download/sqlpage-linux.tgz'
ELSE 'https://github.com/sqlpage/SQLPage/releases'
END AS link,
CASE $os
WHEN 'macos' THEN CONCAT('Install SQLPage ', $sqlpage_version, ' using Homebrew')
WHEN 'windows' THEN CONCAT('Download SQLPage ', $sqlpage_version, ' for Windows')
WHEN 'linux' THEN CONCAT('Download SQLPage ', $sqlpage_version, ' for Linux')
ELSE CONCAT('Download SQLPage ', $sqlpage_version)
END AS link_text;
SELECT 'alert' as component,
'Afraid of the setup ? Do it the easy way !' as title,
'mood-happy' as icon,
'teal' as color,
'You dont want to install anything on your computer ?
You can use a preconfigured SQLPage hosted on our servers, and get your app online in minutes, without **ever having to configure a server** yourself.' as description_md,
'https://datapage.app' AS link,
'Host your app on our servers' as link_text;
select 'https://editor.datapage.app' as link, 'Try SQLPage from your browser' as title, 'teal' as color;
SELECT 'alert' as component,
'Do you prefer videos ?' as title,
'brand-youtube' as icon,
'purple' as color,
'We made videos to introduce you to SQLPage. You can watch them on YouTube. The videos cover everything from the underlying technology to the philosophy behind SQLPage to the actual steps to create your first website.' as description_md,
'https://www.youtube.com/watch?v=9NJgH_-zXjY' AS link,
'Watch the introduction video' as link_text;
select 'https://www.youtube.com/watch?v=6D5D10v18b0&list=PLTue_qIAHxActQnLn_tHWZUNXziZTeraB' as link, 'Tutorial video series' as title;
select 'text' as component,
sqlpage.read_file_as_text(
printf('your-first-sql-website/tutorial-install-%s.md',
case
when $os = 'windows' then 'windows'
when $os = 'macos' then 'macos'
else 'any'
end
)
) as contents_md,
true as article,
'download' as id;
select 'text' as component,
sqlpage.read_file_as_text('your-first-sql-website/tutorial.md') as contents_md,
true as article,
'tutorial' as id;