console/content/view/expected_schema_view.auto.sql

SELECT 'dynamic' AS component, sqlpage.run_sql('shell/shell.sql') AS properties;

              SELECT 'breadcrumb' AS component;
              SELECT 'Home' as title,sqlpage.environment_variable('SQLPAGE_SITE_PREFIX') || '/' AS link;
              SELECT 'Console' as title,sqlpage.environment_variable('SQLPAGE_SITE_PREFIX') || '/console' AS link;
              SELECT 'Content' as title,sqlpage.environment_variable('SQLPAGE_SITE_PREFIX') || '/console/content' AS link;
              SELECT 'expected_schema_view view' as title, '#' AS link;

              SELECT 'title' AS component, 'expected_schema_view (view) Content' as contents;

              SET total_rows = (SELECT COUNT(*) FROM expected_schema_view);
              SET limit = COALESCE($limit, 50);
              SET offset = COALESCE($offset, 0);
              SET total_pages = ($total_rows + $limit - 1) / $limit;
              SET current_page = ($offset / $limit) + 1;

              SELECT 'text' AS component, '[expected_schema_view (view) Schema](console/info-schema/view.sql?name=expected_schema_view&stats=yes)' AS contents_md
              SELECT 'text' AS component,
                '- Start Row: ' || $offset || '
' ||
                '- Rows per Page: ' || $limit || '
' ||
                '- Total Rows: ' || $total_rows || '
' ||
                '- Current Page: ' || $current_page || '
' ||
                '- Total Pages: ' || $total_pages as contents_md
              WHERE $stats IS NOT NULL;

              -- Display uniform_resource table with pagination
              SELECT 'table' AS component,
                    TRUE AS sort,
                    TRUE AS search,
                    TRUE AS hover,
                    TRUE AS striped_rows,
                    TRUE AS small;
            SELECT * FROM expected_schema_view
            LIMIT $limit
            OFFSET $offset;

            SELECT 'text' AS component,
                (SELECT CASE WHEN $current_page > 1 THEN '[Previous](?limit=' || $limit || '&offset=' || ($offset - $limit) || ')' ELSE ' END) || ' ' ||
                '(Page ' || $current_page || ' of ' || $total_pages || ') ' ||
                (SELECT CASE WHEN $current_page < $total_pages THEN '[Next](?limit=' || $limit || '&offset=' || ($offset + $limit) || ')' ELSE ' END)
                AS contents_md;