docs/functions-inner.sql
SELECT 'dynamic' AS component, sqlpage.run_sql('shell/shell.sql') AS properties;
-- not including breadcrumbs from sqlpage_aide_navigation
-- not including page title from sqlpage_aide_navigation
select
'breadcrumb' as component;
select
'Home' as title,
sqlpage.environment_variable('SQLPAGE_SITE_PREFIX') || '/' as link;
select
'Docs' as title,
sqlpage.environment_variable('SQLPAGE_SITE_PREFIX') || '/docs/index.sql' as link;
select
'SQL Functions' as title,
sqlpage.environment_variable('SQLPAGE_SITE_PREFIX') || '/docs/functions.sql' as link;
select
$function as title,
sqlpage.environment_variable('SQLPAGE_SITE_PREFIX') || '/docs/functions-inner.sql?function=' || $function AS link;
SELECT
'text' AS component,
'' || name || '()' AS title, 'function' AS id
FROM surveilr_function_doc WHERE name = $function;
SELECT
'text' AS component,
description AS contents_md
FROM surveilr_function_doc WHERE name = $function;
SELECT
'text' AS component,
'Introduced in version ' || version || '.' AS contents
FROM surveilr_function_doc WHERE name = $function;
SELECT
'title' AS component,
3 AS level,
'Parameters' AS contents
WHERE $function IS NOT NULL;
SELECT
'card' AS component,
3 AS columns
WHERE $function IS NOT NULL;
SELECT
json_each.value ->> '$.name' AS title,
json_each.value ->> '$.description' AS description,
json_each.value ->> '$.data_type' AS footer,
'azure' AS color
FROM surveilr_function_doc, json_each(surveilr_function_doc.parameters)
WHERE name = $function;
-- Navigation Buttons
SELECT 'button' AS component, 'sm' AS size, 'pill' AS shape;
SELECT name AS title,
NULL AS icon, -- Add an icon field if needed
sqlpage.link('functions-inner.sql', json_object('function', name)) AS link
FROM surveilr_function_doc
ORDER BY name;