console/sqlpage-files/content.sql
SELECT 'dynamic' AS component, sqlpage.run_sql('shell/shell.sql') AS properties;
SELECT 'breadcrumb' as component;
WITH RECURSIVE breadcrumbs AS (
SELECT
COALESCE(abbreviated_caption, caption) AS title,
COALESCE(url, path) AS link,
parent_path, 0 AS level,
namespace
FROM sqlpage_aide_navigation
WHERE namespace = 'prime' AND path='console/sqlpage-files/content.sql'
UNION ALL
SELECT
COALESCE(nav.abbreviated_caption, nav.caption) AS title,
COALESCE(nav.url, nav.path) AS link,
nav.parent_path, b.level + 1, nav.namespace
FROM sqlpage_aide_navigation nav
INNER JOIN breadcrumbs b ON nav.namespace = b.namespace AND nav.path = b.parent_path
)
SELECT title ,
sqlpage.environment_variable('SQLPAGE_SITE_PREFIX') || '/'||link as link
FROM breadcrumbs ORDER BY level DESC;
-- not including page title from sqlpage_aide_navigation
SELECT 'title' AS component, 'SQLPage pages generated from tables and views' AS contents;
SELECT 'text' AS component, '
- `*.auto.sql` pages are auto-generated "default" content pages for each table and view defined in the database.
- The `*.sql` companions may be auto-generated redirects to their `*.auto.sql` pair or an app/service might override the `*.sql` to not redirect and supply custom content for any table or view.
- [View regenerate-auto.sql](' || sqlpage.environment_variable('SQLPAGE_SITE_PREFIX') || '/console/sqlpage-files/sqlpage-file.sql?path=console/content/action/regenerate-auto.sql' || ')
' AS contents_md;
SELECT 'button' AS component, 'center' AS justify;
SELECT sqlpage.environment_variable('SQLPAGE_SITE_PREFIX') || '/console/content/action/regenerate-auto.sql' AS link, 'info' AS color, 'Regenerate all "default" table/view content pages' AS title;
SELECT 'title' AS component, 'Redirected or overriden content pages' as contents;
SELECT 'table' AS component,
'Path' as markdown,
'Size' as align_right,
TRUE as sort,
TRUE as search;
SELECT
'[🚀](' || sqlpage.environment_variable('SQLPAGE_SITE_PREFIX') || '/' || path || ')[📄 ' || path || '](sqlpage-file.sql?path=' || path || ')' AS "Path",
LENGTH(contents) as "Size", last_modified
FROM sqlpage_files
WHERE path like 'console/content/%'
AND NOT(path like 'console/content/%.auto.sql')
AND NOT(path like 'console/content/action%')
ORDER BY path;
SELECT 'title' AS component, 'Auto-generated "default" content pages' as contents;
SELECT 'table' AS component,
'Path' as markdown,
'Size' as align_right,
TRUE as sort,
TRUE as search;
SELECT
'[🚀](' || sqlpage.environment_variable('SQLPAGE_SITE_PREFIX') || '/' || path || ') [📄 ' || path || '](sqlpage-file.sql?path=' || path || ')' AS "Path",
LENGTH(contents) as "Size", last_modified
FROM sqlpage_files
WHERE path like 'console/content/%.auto.sql'
ORDER BY path;