pgkiln 0.75.0 → 0.77.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/apex-feature-parity.md +6 -4
- package/docs/guide/03-builder.md +9 -1
- package/docs/guide/04-pages-and-regions.md +23 -2
- package/docs/guide/12-development.md +4 -1
- package/docs/guide/18-cli.md +74 -0
- package/docs/guide/20-ai-agents.md +3 -0
- package/package.json +1 -1
- package/public/app.css +18 -0
- package/public/app.js +141 -0
- package/src/builder/advisor.ts +50 -1
- package/src/builder/workingcopies.ts +1 -11
- package/src/cli/advise.ts +177 -0
- package/src/cli/apps.ts +1 -1
- package/src/cli/main.ts +149 -0
- package/src/cli/mcp.ts +93 -0
- package/src/cli/working-copy.ts +121 -0
- package/src/i18n/ar.ts +24 -0
- package/src/i18n/cs.ts +24 -0
- package/src/i18n/da.ts +24 -0
- package/src/i18n/de.ts +24 -0
- package/src/i18n/el.ts +24 -0
- package/src/i18n/es.ts +24 -0
- package/src/i18n/fi.ts +24 -0
- package/src/i18n/fr.ts +24 -0
- package/src/i18n/he.ts +24 -0
- package/src/i18n/it.ts +24 -0
- package/src/i18n/ja.ts +24 -0
- package/src/i18n/ko.ts +24 -0
- package/src/i18n/nb.ts +24 -0
- package/src/i18n/pl.ts +24 -0
- package/src/i18n/pt.ts +24 -0
- package/src/i18n/ru.ts +24 -0
- package/src/i18n/sv.ts +24 -0
- package/src/i18n/tr.ts +24 -0
- package/src/i18n/uk.ts +24 -0
- package/src/i18n/zh.ts +24 -0
- package/src/i18n.ts +48 -0
- package/src/instance.ts +6 -0
- package/src/runtime/ai-filter.ts +11 -6
- package/src/runtime/ir-plan.ts +3 -3
- package/src/runtime/pdf.ts +6 -6
- package/src/runtime/render.ts +1 -1
- package/src/runtime/report.ts +208 -25
|
@@ -7,14 +7,14 @@ open item and open an issue or pull request; see [CONTRIBUTING.md](../CONTRIBUTI
|
|
|
7
7
|
Legend: ✅ available · 🟡 partial (see notes) · ❌ not yet · ➖ not planned (a deliberate choice,
|
|
8
8
|
or better served by the PostgreSQL ecosystem; see the notes and [extensions](guide/15-extensions.md))
|
|
9
9
|
|
|
10
|
-
Last reviewed: 2026-11-04 against **APEX 26.2** (sprint 142: JSON sources with a data profile and updatable views whose arrays are rows, document views of a table with its children (APEX's duality views), JSON path columns in reports (AP-8); sprint 141: static workspace files (`#WORKSPACE_FILES#`), remote servers for REST data sources, catalogs and AI services (an environment variable per environment), and workspace-level web credentials (AP-7); sprint 140: the items Shuttle (ordered), Select One and Select Many, the regions Classic Report (report templates, pagination types), Breadcrumb and Help Text with a page help text, and a [mapping of every APEX item and region type](#item-and-region-types-one-by-one) (AP-4); sprint 139: OpenTelemetry, traces with a span per SQL statement, web call, AI request and tool call, logs, metrics and `/metrics` for Prometheus, browser spans relayed by pgkiln, per workspace off or its own collector (AP-6); sprint 138: an application's Utilities tab with a dashboard, database object dependencies, change history per component, Upgrade application, UI defaults (APEX's Attribute Dictionary), application and page checksums and an icon browser (AP-5); sprint 137: Create page as a grid of page types with previews, the page types interactive report, smart filters, search page, data loading, tree, timeline, media list, content row, comments, dashboard, wizard, unified task list and workflow console, a Feature tab with nine features that install once, and Create page as copy with shared components mapped or copied (AP-3); sprint 136: vector providers (an AI service with an embedding model or a SQL function), `meta.embed`, *Add vector column* in Table Properties with an HNSW index and a queue that keeps embeddings current, search types vector and hybrid (reciprocal rank fusion with full-text) and a Retrieve (RAG) tool for AI agents, all as the app's role through RLS, on pgvector (AP-1); sprint 135: full-text search configurations, APEX's Oracle Text search type on PostgreSQL full-text search with stemming, ranking, highlights, *Did you mean* and *Add full-text search* in Table Properties (AP-2); sprint 134: the builder also in Italiano, 中文 (简体), 中文 (繁體), 日本語 and 한국어, APEX's ten builder languages plus Nederlands (SEC-5); sprints 121, 123–125: the builder in Deutsch, English, Español, Français, Nederlands and Português, step by step: the frame, sign-in, Workspace home, App Builder, Page Designer menus, the SQL Workshop's home, SQL Worksheet, Object Browser and Table Properties, Shared Components, application settings, users, identity providers, developers and workspaces (WS-7); sprint 122: *Ask in your own words* sets faceted search and smart filter facets, smart filters read a typed phrase (WS-5), and Sample Maps, Sample Approvals, Sample Data Loading and Sample Files in the App Gallery (WS-8); sprint 120: the App Gallery's single-topic sample apps (charts, cards, calendar, interactive grids, dynamic actions, reporting), the UX Pattern Catalog and a Utility Apps tab with Lookup Lists, Release Notes and Announcements (WS-8); sprint 119: data security per table, a roles × columns matrix and masked values per application role in a masking view, the same identity for pages, AI tools, REST, AutoREST and MCP (WS-13); sprint 118: Administration → Mail queue with delivery per hour and per workspace, the slowest provider calls and failures with Retry and Purge, a workspace's own mail service, and workspace network access lists that narrow the installation's allow-list (WS-9); sprint 117: Pillar Light and Pillar Dark navigation appearances with a header strip, clearer navigation tree states, subtle colour utilities, RTL; sprint 116: the comparison moved from 26.1 to 26.2, with a section for the 26.2 workspace items WS-1 … WS-13 and OCI managed identities; the App Builder list with Updated by, working copies and the lock; `pgkiln import --only`, a file-level import; stale rows on facet menus and blueprints fixed; sprint 115: popup LOVs that load on scroll, Wait Popup dynamic actions and dynamic actions on menu entries; sprint 114: Workflow 26.2 with custom task outcomes, task events and notifications, Send E-Mail and draft steps, migrating running instances and the diagram as SVG / PNG; sprint 113: Team Development with issues, labels, milestones, templates, a board and a set-up wizard; sprint 112: AI interactive reports with chips, Undo, computed columns and a phrase parser that needs no AI service; sprint 111: AI Agents with tools as a shared component, a Navigate tool with checksummed URLs, Gemini and OpenAI-compatible services; sprint 110: Data Reporter as a workspace tool with datasets, reporting applications, editors and viewers, published reports with stable URLs and pins; sprint 109: the Workspace home above the App Builder and SQL Workshop, with a summary, top applications, users and developers, and an optional release check; sprint 108: the code editor's syntax colours in the builder's light and dark themes, read-only SQL highlighted, the Data Modeler in dark mode; sprint 107: a transaction mode in the SQL Worksheet with Commit and Rollback; DA-18: JavaScript (MLE) not planned, plv8 where installed; sprint 106: the change log of DDL change sets with Flyway, Liquibase and SQL downloads; sprint 104: RESTful Services modules, templates and handlers with PL/pgSQL and media handlers, privileges, OpenAPI and Try it; sprint 103: Schema Export / Import with pg_dump and pg_restore; sprint 102: the SQL Monitor with live sessions, Top SQL and a statement's plan; sprint 101: Scheduling of pg_cron jobs with a schedule builder, run now and run history; sprint 100: RESTful Services, tables and views published as REST endpoints with paging, filters, keys and OpenAPI; sprint 99: Administration → Database Users for PostgreSQL roles; sprint 98: the Data Modeler with relational diagrams, DDL and a data dictionary; sprint 97: charts of a query in the worksheet, saved charts and their dashboard; sprint 96: the SQL Workshop's Launchpad with pins and tool groups, the builder's search with Ctrl+K; sprint 95: Table Properties: create, edit or copy a table in a form with a DDL preview and Apply in one transaction; sprint 94: an object's menu with Open in a panel, Quick DDL, Add index / trigger / policy and Drop with dependents; sprint 93: worksheets saved as SQL Scripts with tabs and a Files list, Format, Convert case, find and replace, bind and substitution variables; sprint 92: the worksheet's Query Result with sort, value dialog, copy and downloads, plans as a tree with the slowest step and misestimates, SQL History with status, search and run again; sprint 91: the SQL Worksheet like Database Actions' SQL: navigator, Run Statement at the cursor and Run Script with a log per statement, Explain Plan, Autotrace, notices, history, Run as an application role; sprint 90: Comment Out in the page designer, gallery labels in title case; sprint 89: the Object Browser's schema, one row of tabs, blank NULLs, Modify column; sprint 88: home cards with colour bands and round icons, the hero on the page background, a page footer with the version and Back to top; sprint 87: the Create Application wizard reloads the page list for a schema, RLS badges, the alias from the name; sprint 86: the page designer by page number, HTML error pages in the builder; sprint 85: the Form Designer, beyond APEX; sprint 84: the date picker, facet menus; sprint 83: Component Settings and Component Groups; sprint 82: Report Queries; sprint 81: Application Computations and Shortcuts in Shared Components; sprint 80: the master grid's first row selected when the page opens and after a search; grid cells as text with their format mask until edited, with cell navigation by arrow keys, Enter, F2 and Escape; sprint 79: generated dashboards with sums, donuts and lines, leaving out charts that say nothing; applications open in their own light or dark mode until the user chooses, per application; a user menu with Appearance and Sign in when signed out; the developer toolbar's App and Page texts and debug state; the report search's column scope in the magnifier; sprint 78: generated faceted search reports with one column per foreign key, the faceted search's total row count, Show all and Yes/No values, one search field, friendly headings and number formats in generated grids and master-detail pages, friendly names in the Create Application wizard's page list; sprint 77: the Page Designer's layout and tree by display position, button positions, the tree's context menu with Duplicate and Copy to other page, Show Common / Show All, Go to group and the Template Options dialog; display positions, button positions and side-column page templates at runtime; sprint 76: the interactive report's menus and pagination, date items in the date format; sprint 75: the SQL Workshop's Object Browser and tabs; sprint 74: the builder's information architecture: Shared Components grid, Settings tabs, application home search and tasks; sprint 73: the Create Application wizard on one page with page types and features; sprint 72: the runtime chrome compared with APEX 26.2's: the developer toolbar, the Iris look, the navigation bar's Help menu and Install button; sprint 71: generated applications compared with APEX 26.2's: labels, foreign key names in reports, file columns, format masks, the Home page and the dashboard; sprint 70: treemap, sunburst and timeline charts; sprint 69: dragging tasks on a Gantt chart; sprint 68: the Data Reporter's welcome page, Find my workspace; sprint 67: REST source catalogs from OpenAPI documents, a workspace's export and import (two rows added); sprint 66: a blueprint from an existing application; sprint 65: facet charts; sprint 64: approval vacation rules and expiration policies; sprint 63: range, box plot and stock charts; sprint 62: workspace preferences (SQL Workshop and RESTful services per workspace), extension links, Manage backups across applications, SQL Workshop utilities with object reports, About Database and a database monitor; sprint 61: the builder's screens compared with APEX 26.1: the workspace sign-in page, the Administration menu with workspace message, environment banner and utilization, the SQL Workshop home, the App Gallery, application groups and cross application reports (four rows added); sprint 60: isolated workspaces with their own database logins, row-level security on pgkiln's tables and workspace database roles, workspace administrators; sprint 59: the Page Designer's help pane, Quick edit from the developer toolbar; sprint 58: page groups; sprint 57: region templates hero, title bar, buttons container, inline dialog and drawer, wizard with wizard progress, the carousel; sprint 56: Generate DDL and Schema Comparison in the SQL Workshop, `pgkiln ddl` and `pgkiln compare`; sprint 55: an editable login page with a Login region and the Minimal page template, Forgot password through the application's mail service; sprint 54: interactive grid views, the single row view, group by and chart; sprint 53: application settings, user preferences and items kept per user, dynamic translations, `meta.data_export` and data export downloads, display image and geocoded address items; sprint 52: every dynamic action event and action, Ajax callbacks, an error handling function, the session timeout warning; sprint 51: checked imports, application backups, availability and Run only, feedback, type-specific attribute help; sprint 50: lost update detection, warn on unsaved changes, the URL and search regions with search configurations, the developer toolbar with a session state viewer, and e-mail through SMTP with OAuth2, Microsoft Graph, Amazon SES and HTTP APIs; import checks, application availability, property help and e-mail compared again; 2026-10-06: pgkiln 0.31.0, in progress: static application files and the Execute JavaScript dynamic action; region, item, dynamic action and process plug-ins; conditional and dynamic theme styles; XML and Excel in `meta.parse_data`, zips in SQL, `meta.v_boolean`; file items in S3-compatible object storage; map layers by the visible area and as vector tiles; a graphical query builder; tenants for workflows and tasks; application files as YAML and region static IDs; Lucide icons and icon modifiers; PWA push notifications; 0.30.0: 136 icons and an icon picker; an axe-core accessibility audit; cropping pictures; session sharing between applications; twenty-two built-in languages; 0.29.0: workspaces; the Iris base style; drawers; built-in template components including the metric card; Theme Roller dark-mode colours, live preview and template options on items and report columns; report selection across pages; instance settings; fourteen built-in languages; 0.28.0: AI with Claude and OpenAI; 0.27.0: Data Reporter; sample data generator; create application from several sheets, pasted data or existing tables; 0.26.0: working copies with a three-way merge; theme, library and boilerplate applications with subscriptions; 0.25.0: Gantt, pyramid and polar charts; map layers, clustering and server-side spatial filters; REST data sources that write back from forms and grids and synchronise into tables, OAuth2 password and refresh-token grants; debug messages per request and an install/upgrade log; `meta.web_request()` and `meta.parse_data()`; Theme Roller style variants and template options; 0.24.0: automations with several actions, error handling per row and runs from SQL; invoke-API workflow steps; Unload Data in the Data Workshop; create page wizards for cards, calendar, chart, map, faceted search, form and master-detail; create an application from a file; 0.23.0: interactive grid aggregates, frozen/moved/resized columns, layouts and saved grid reports, master-detail, row actions and copy/paste; download processes, execution chains in the background, workflow processes, branches to a function's URL or another app, the Dialog Closed event; number format masks, automatic time zone, runtime messages in German, French and Spanish; SQL scripts, Quick SQL, a query builder, XML loading and data load definitions; custom authentication, lists, page and application locks with developer comments, supporting objects; 0.22.0: keyset paging, report PDFs and REST collections streamed from a cursor, database-account authentication; 0.21.0: HTTP-header authentication behind a reverse proxy; 0.20.0: a popup list of values with server-side search; 0.19.0: row-range pagination, maximum row counts and row limits, lazy loading and caching of regions, streamed CSV/Excel downloads; 0.18.0: calendar week/day/list views with drag and drop, bubble/gauge/funnel/radar charts and drill-down, smart filters, a region display selector and more facet types, computations, conditional branches, build options, menu buttons, REST data sources and web credentials, rich text/Markdown, rating, combobox, date range and QR code items; 0.17.0: an App Builder home, workspace dashboard and utilities like APEX's; 0.16.0: a Page Designer with drag-and-drop layout, a code editor with autocomplete, template components and plug-ins, parallel branches and versions of workflows, the `pgkiln` command line with one file per component; 0.15.0: drop and paste files, heat maps, filtering a report by the map area; 0.14.0: stacked, combo, scatter and pie charts, several files per upload item; 0.13.0: map and tree regions; 0.12.0: REST modules in the builder; 0.11.0: workflows and Progressive Web Apps; 0.10.0: LDAP, SAML, "Keep me signed in", document templates, JSON loading, approvals and the task list; pgkiln installs no application, HR is an example).
|
|
10
|
+
Last reviewed: 2026-11-04 against **APEX 26.2** (sprint 144: `pgkiln advise` for CI with text, JSON and SARIF output (APEXlang static analysis / SQLcl CodeScan), security checks in the Advisor, and working copies and locks from the command line and MCP (the Working Copy APIs) (AP-10); sprint 143: the interactive report's 26.2 dialogs: *is one of* / *is not one of* filters with the column's values and counts, *is between* two values (dates with the date picker in the application's format), relative periods on date columns, and the column order by drag and drop or arrow buttons, followed by downloads and the PDF (AP-9); sprint 142: JSON sources with a data profile and updatable views whose arrays are rows, document views of a table with its children (APEX's duality views), JSON path columns in reports (AP-8); sprint 141: static workspace files (`#WORKSPACE_FILES#`), remote servers for REST data sources, catalogs and AI services (an environment variable per environment), and workspace-level web credentials (AP-7); sprint 140: the items Shuttle (ordered), Select One and Select Many, the regions Classic Report (report templates, pagination types), Breadcrumb and Help Text with a page help text, and a [mapping of every APEX item and region type](#item-and-region-types-one-by-one) (AP-4); sprint 139: OpenTelemetry, traces with a span per SQL statement, web call, AI request and tool call, logs, metrics and `/metrics` for Prometheus, browser spans relayed by pgkiln, per workspace off or its own collector (AP-6); sprint 138: an application's Utilities tab with a dashboard, database object dependencies, change history per component, Upgrade application, UI defaults (APEX's Attribute Dictionary), application and page checksums and an icon browser (AP-5); sprint 137: Create page as a grid of page types with previews, the page types interactive report, smart filters, search page, data loading, tree, timeline, media list, content row, comments, dashboard, wizard, unified task list and workflow console, a Feature tab with nine features that install once, and Create page as copy with shared components mapped or copied (AP-3); sprint 136: vector providers (an AI service with an embedding model or a SQL function), `meta.embed`, *Add vector column* in Table Properties with an HNSW index and a queue that keeps embeddings current, search types vector and hybrid (reciprocal rank fusion with full-text) and a Retrieve (RAG) tool for AI agents, all as the app's role through RLS, on pgvector (AP-1); sprint 135: full-text search configurations, APEX's Oracle Text search type on PostgreSQL full-text search with stemming, ranking, highlights, *Did you mean* and *Add full-text search* in Table Properties (AP-2); sprint 134: the builder also in Italiano, 中文 (简体), 中文 (繁體), 日本語 and 한국어, APEX's ten builder languages plus Nederlands (SEC-5); sprints 121, 123–125: the builder in Deutsch, English, Español, Français, Nederlands and Português, step by step: the frame, sign-in, Workspace home, App Builder, Page Designer menus, the SQL Workshop's home, SQL Worksheet, Object Browser and Table Properties, Shared Components, application settings, users, identity providers, developers and workspaces (WS-7); sprint 122: *Ask in your own words* sets faceted search and smart filter facets, smart filters read a typed phrase (WS-5), and Sample Maps, Sample Approvals, Sample Data Loading and Sample Files in the App Gallery (WS-8); sprint 120: the App Gallery's single-topic sample apps (charts, cards, calendar, interactive grids, dynamic actions, reporting), the UX Pattern Catalog and a Utility Apps tab with Lookup Lists, Release Notes and Announcements (WS-8); sprint 119: data security per table, a roles × columns matrix and masked values per application role in a masking view, the same identity for pages, AI tools, REST, AutoREST and MCP (WS-13); sprint 118: Administration → Mail queue with delivery per hour and per workspace, the slowest provider calls and failures with Retry and Purge, a workspace's own mail service, and workspace network access lists that narrow the installation's allow-list (WS-9); sprint 117: Pillar Light and Pillar Dark navigation appearances with a header strip, clearer navigation tree states, subtle colour utilities, RTL; sprint 116: the comparison moved from 26.1 to 26.2, with a section for the 26.2 workspace items WS-1 … WS-13 and OCI managed identities; the App Builder list with Updated by, working copies and the lock; `pgkiln import --only`, a file-level import; stale rows on facet menus and blueprints fixed; sprint 115: popup LOVs that load on scroll, Wait Popup dynamic actions and dynamic actions on menu entries; sprint 114: Workflow 26.2 with custom task outcomes, task events and notifications, Send E-Mail and draft steps, migrating running instances and the diagram as SVG / PNG; sprint 113: Team Development with issues, labels, milestones, templates, a board and a set-up wizard; sprint 112: AI interactive reports with chips, Undo, computed columns and a phrase parser that needs no AI service; sprint 111: AI Agents with tools as a shared component, a Navigate tool with checksummed URLs, Gemini and OpenAI-compatible services; sprint 110: Data Reporter as a workspace tool with datasets, reporting applications, editors and viewers, published reports with stable URLs and pins; sprint 109: the Workspace home above the App Builder and SQL Workshop, with a summary, top applications, users and developers, and an optional release check; sprint 108: the code editor's syntax colours in the builder's light and dark themes, read-only SQL highlighted, the Data Modeler in dark mode; sprint 107: a transaction mode in the SQL Worksheet with Commit and Rollback; DA-18: JavaScript (MLE) not planned, plv8 where installed; sprint 106: the change log of DDL change sets with Flyway, Liquibase and SQL downloads; sprint 104: RESTful Services modules, templates and handlers with PL/pgSQL and media handlers, privileges, OpenAPI and Try it; sprint 103: Schema Export / Import with pg_dump and pg_restore; sprint 102: the SQL Monitor with live sessions, Top SQL and a statement's plan; sprint 101: Scheduling of pg_cron jobs with a schedule builder, run now and run history; sprint 100: RESTful Services, tables and views published as REST endpoints with paging, filters, keys and OpenAPI; sprint 99: Administration → Database Users for PostgreSQL roles; sprint 98: the Data Modeler with relational diagrams, DDL and a data dictionary; sprint 97: charts of a query in the worksheet, saved charts and their dashboard; sprint 96: the SQL Workshop's Launchpad with pins and tool groups, the builder's search with Ctrl+K; sprint 95: Table Properties: create, edit or copy a table in a form with a DDL preview and Apply in one transaction; sprint 94: an object's menu with Open in a panel, Quick DDL, Add index / trigger / policy and Drop with dependents; sprint 93: worksheets saved as SQL Scripts with tabs and a Files list, Format, Convert case, find and replace, bind and substitution variables; sprint 92: the worksheet's Query Result with sort, value dialog, copy and downloads, plans as a tree with the slowest step and misestimates, SQL History with status, search and run again; sprint 91: the SQL Worksheet like Database Actions' SQL: navigator, Run Statement at the cursor and Run Script with a log per statement, Explain Plan, Autotrace, notices, history, Run as an application role; sprint 90: Comment Out in the page designer, gallery labels in title case; sprint 89: the Object Browser's schema, one row of tabs, blank NULLs, Modify column; sprint 88: home cards with colour bands and round icons, the hero on the page background, a page footer with the version and Back to top; sprint 87: the Create Application wizard reloads the page list for a schema, RLS badges, the alias from the name; sprint 86: the page designer by page number, HTML error pages in the builder; sprint 85: the Form Designer, beyond APEX; sprint 84: the date picker, facet menus; sprint 83: Component Settings and Component Groups; sprint 82: Report Queries; sprint 81: Application Computations and Shortcuts in Shared Components; sprint 80: the master grid's first row selected when the page opens and after a search; grid cells as text with their format mask until edited, with cell navigation by arrow keys, Enter, F2 and Escape; sprint 79: generated dashboards with sums, donuts and lines, leaving out charts that say nothing; applications open in their own light or dark mode until the user chooses, per application; a user menu with Appearance and Sign in when signed out; the developer toolbar's App and Page texts and debug state; the report search's column scope in the magnifier; sprint 78: generated faceted search reports with one column per foreign key, the faceted search's total row count, Show all and Yes/No values, one search field, friendly headings and number formats in generated grids and master-detail pages, friendly names in the Create Application wizard's page list; sprint 77: the Page Designer's layout and tree by display position, button positions, the tree's context menu with Duplicate and Copy to other page, Show Common / Show All, Go to group and the Template Options dialog; display positions, button positions and side-column page templates at runtime; sprint 76: the interactive report's menus and pagination, date items in the date format; sprint 75: the SQL Workshop's Object Browser and tabs; sprint 74: the builder's information architecture: Shared Components grid, Settings tabs, application home search and tasks; sprint 73: the Create Application wizard on one page with page types and features; sprint 72: the runtime chrome compared with APEX 26.2's: the developer toolbar, the Iris look, the navigation bar's Help menu and Install button; sprint 71: generated applications compared with APEX 26.2's: labels, foreign key names in reports, file columns, format masks, the Home page and the dashboard; sprint 70: treemap, sunburst and timeline charts; sprint 69: dragging tasks on a Gantt chart; sprint 68: the Data Reporter's welcome page, Find my workspace; sprint 67: REST source catalogs from OpenAPI documents, a workspace's export and import (two rows added); sprint 66: a blueprint from an existing application; sprint 65: facet charts; sprint 64: approval vacation rules and expiration policies; sprint 63: range, box plot and stock charts; sprint 62: workspace preferences (SQL Workshop and RESTful services per workspace), extension links, Manage backups across applications, SQL Workshop utilities with object reports, About Database and a database monitor; sprint 61: the builder's screens compared with APEX 26.1: the workspace sign-in page, the Administration menu with workspace message, environment banner and utilization, the SQL Workshop home, the App Gallery, application groups and cross application reports (four rows added); sprint 60: isolated workspaces with their own database logins, row-level security on pgkiln's tables and workspace database roles, workspace administrators; sprint 59: the Page Designer's help pane, Quick edit from the developer toolbar; sprint 58: page groups; sprint 57: region templates hero, title bar, buttons container, inline dialog and drawer, wizard with wizard progress, the carousel; sprint 56: Generate DDL and Schema Comparison in the SQL Workshop, `pgkiln ddl` and `pgkiln compare`; sprint 55: an editable login page with a Login region and the Minimal page template, Forgot password through the application's mail service; sprint 54: interactive grid views, the single row view, group by and chart; sprint 53: application settings, user preferences and items kept per user, dynamic translations, `meta.data_export` and data export downloads, display image and geocoded address items; sprint 52: every dynamic action event and action, Ajax callbacks, an error handling function, the session timeout warning; sprint 51: checked imports, application backups, availability and Run only, feedback, type-specific attribute help; sprint 50: lost update detection, warn on unsaved changes, the URL and search regions with search configurations, the developer toolbar with a session state viewer, and e-mail through SMTP with OAuth2, Microsoft Graph, Amazon SES and HTTP APIs; import checks, application availability, property help and e-mail compared again; 2026-10-06: pgkiln 0.31.0, in progress: static application files and the Execute JavaScript dynamic action; region, item, dynamic action and process plug-ins; conditional and dynamic theme styles; XML and Excel in `meta.parse_data`, zips in SQL, `meta.v_boolean`; file items in S3-compatible object storage; map layers by the visible area and as vector tiles; a graphical query builder; tenants for workflows and tasks; application files as YAML and region static IDs; Lucide icons and icon modifiers; PWA push notifications; 0.30.0: 136 icons and an icon picker; an axe-core accessibility audit; cropping pictures; session sharing between applications; twenty-two built-in languages; 0.29.0: workspaces; the Iris base style; drawers; built-in template components including the metric card; Theme Roller dark-mode colours, live preview and template options on items and report columns; report selection across pages; instance settings; fourteen built-in languages; 0.28.0: AI with Claude and OpenAI; 0.27.0: Data Reporter; sample data generator; create application from several sheets, pasted data or existing tables; 0.26.0: working copies with a three-way merge; theme, library and boilerplate applications with subscriptions; 0.25.0: Gantt, pyramid and polar charts; map layers, clustering and server-side spatial filters; REST data sources that write back from forms and grids and synchronise into tables, OAuth2 password and refresh-token grants; debug messages per request and an install/upgrade log; `meta.web_request()` and `meta.parse_data()`; Theme Roller style variants and template options; 0.24.0: automations with several actions, error handling per row and runs from SQL; invoke-API workflow steps; Unload Data in the Data Workshop; create page wizards for cards, calendar, chart, map, faceted search, form and master-detail; create an application from a file; 0.23.0: interactive grid aggregates, frozen/moved/resized columns, layouts and saved grid reports, master-detail, row actions and copy/paste; download processes, execution chains in the background, workflow processes, branches to a function's URL or another app, the Dialog Closed event; number format masks, automatic time zone, runtime messages in German, French and Spanish; SQL scripts, Quick SQL, a query builder, XML loading and data load definitions; custom authentication, lists, page and application locks with developer comments, supporting objects; 0.22.0: keyset paging, report PDFs and REST collections streamed from a cursor, database-account authentication; 0.21.0: HTTP-header authentication behind a reverse proxy; 0.20.0: a popup list of values with server-side search; 0.19.0: row-range pagination, maximum row counts and row limits, lazy loading and caching of regions, streamed CSV/Excel downloads; 0.18.0: calendar week/day/list views with drag and drop, bubble/gauge/funnel/radar charts and drill-down, smart filters, a region display selector and more facet types, computations, conditional branches, build options, menu buttons, REST data sources and web credentials, rich text/Markdown, rating, combobox, date range and QR code items; 0.17.0: an App Builder home, workspace dashboard and utilities like APEX's; 0.16.0: a Page Designer with drag-and-drop layout, a code editor with autocomplete, template components and plug-ins, parallel branches and versions of workflows, the `pgkiln` command line with one file per component; 0.15.0: drop and paste files, heat maps, filtering a report by the map area; 0.14.0: stacked, combo, scatter and pie charts, several files per upload item; 0.13.0: map and tree regions; 0.12.0: REST modules in the builder; 0.11.0: workflows and Progressive Web Apps; 0.10.0: LDAP, SAML, "Keep me signed in", document templates, JSON loading, approvals and the task list; pgkiln installs no application, HR is an example).
|
|
11
11
|
|
|
12
12
|
## At a glance
|
|
13
13
|
|
|
14
14
|
| Area | ✅ | 🟡 | ❌ | ➖ | In short |
|
|
15
15
|
|---|---:|---:|---:|---:|---|
|
|
16
|
-
| App Builder and development |
|
|
17
|
-
| Regions |
|
|
16
|
+
| App Builder and development | 23 | 0 | 0 | 0 | Page Designer with drag-and-drop and a code editor, wizards, search, where used, an Advisor (also `pgkiln advise` for CI with SARIF), a CLI with one file per component, page locks and comments, supporting objects, working copies with a three-way merge, theme/library/boilerplate apps with subscriptions; App Builder AI (pages, SQL and table descriptions) |
|
|
17
|
+
| Regions | 25 | 0 | 0 | 0 | All everyday regions incl. classic reports with report templates, breadcrumb and help text regions, a search region over search configurations and a URL region; twenty-two chart types with drill-down; calendars with week/day/list views and drag and drop; faceted search, smart filters and a region display selector; interactive reports with breaks, aggregates, highlights, compute, group by, pivot, chart view, saved reports and 26.2's multi-select, date-range and column-order dialogs; interactive grids with single row, group by and chart views; maps (with vector tiles) and trees; template components; row ranges, lazy loading and region caching for large tables |
|
|
18
18
|
| Items | 15 | 0 | 0 | 0 | All common items incl. shuttle, Select One and Select Many, file upload (several files per item), rich text and Markdown editors, star rating, combobox, date range, QR code, password reveal, display image and geocoded address |
|
|
19
19
|
| Logic and processing | 18 | 0 | 0 | 1 | User preferences and application settings; all dynamic action events and actions, Ajax callbacks and an error handling function; Core APEX model complete with computations, conditional branches, build options and menu buttons, download, chain and workflow processes; JavaScript from static application files in dynamic actions; region, item, dynamic action and process plug-ins |
|
|
20
20
|
| Security | 22 | 0 | 0 | 0 | An editable login page and Forgot password; a session timeout warning; On par or stricter (CSP without `unsafe-inline`); OIDC, SAML and LDAP; header authentication behind a proxy; database accounts; custom authentication |
|
|
@@ -24,7 +24,7 @@ Last reviewed: 2026-11-04 against **APEX 26.2** (sprint 142: JSON sources with a
|
|
|
24
24
|
| Workflow, automation and AI | 6 | 0 | 0 | 0 | Scheduled automations with several actions and runs from SQL, approvals, a task list and workflows with parallel branches, versions and invoke-API steps; AI with Claude or OpenAI: *Generate text with AI*, an assistant region with tools, natural-language report filters and blueprints |
|
|
25
25
|
| Administration | 15 | 0 | 0 | 0 | OpenTelemetry traces, logs and metrics to the team's own monitoring and `/metrics` for Prometheus (24.2); An APEX-like sign-in with a workspace and a Workspace home; a mail queue dashboard, a workspace's own mail service and network access list (26.1 / 26.2); a workspace's components exported and imported as one file; workspace message, environment banner and utilization; isolated workspaces with their own database logins and roles, and workspace administrators; application availability and Run only, automatic backups, user feedback; a developer toolbar with a session state viewer and debug per session; Top SQL per app; debug messages per request; an install/upgrade log |
|
|
26
26
|
| APEX 26.2 workspace (WS-1 … WS-13) | 13 | 0 | 0 | 1 | Workspace home, Data Reporter as a workspace tool, Team Development, AI Agents, AI interactive reports, Workflow 26.2, the mail queue, workspace mail and network access, the 26.1 component details, the App Builder list's details, the Pillar navigation appearances and data security per table (rows, columns and masked values), the App Gallery's single-topic sample apps, UX Pattern Catalog and Utility Apps; the builder in eleven languages (APEX's ten and Nederlands) |
|
|
27
|
-
| **Total** | **
|
|
27
|
+
| **Total** | **171** | **0** | **0** | **3** | 174 APEX features compared: 98% available, none missing, 3 deliberately not planned |
|
|
28
28
|
|
|
29
29
|
(Counts are of the rows in the tables below. A review on 2026-10-06 added 18 rows for APEX features that were
|
|
30
30
|
not compared before, one on 2026-10-12 added two more (property help, application availability), and one on
|
|
@@ -48,6 +48,7 @@ database links row and added static workspace files with workspace web credentia
|
|
|
48
48
|
| Shared components | ✅ | (sprint 74) A grid of ten groups with counts like APEX's, a searchable, sortable list per type with Create, and Settings-backed types linking to their Settings tab ([mapping below](#shared-components-apex-links-and-pgkiln)). Navigation menu, **lists** (static entries with nesting, badges, conditions, authorization and build options, or a query; for list regions, the navigation menu and the navigation bar), authorization schemes, build options, lists of values, application items and processes, access control, globalization, template components and plug-ins, web credentials, REST data sources, data load definitions, supporting objects |
|
|
49
49
|
| Export / import | ✅ | `meta.export_app()` / `meta.import_app()`: portable JSON, also in the builder (new applications; `pgkiln import --replace` and the MCP `import_app` update one in place, live for every user at the commit). (sprint 51) **Checked imports**: `pgkiln import --check` (`--dry-run`, `--force`), the MCP import (by default) and the builder's import run the Advisor inside the import's transaction (SQL planned as the application's role: missing tables, columns, functions, types, grants; references) and refuse on errors, so nothing changes; APEX doesn't check. The version an import replaces is [backed up](guide/03-builder.md#backups) first ([chapter 18](guide/18-cli.md#checking-before-an-import)) |
|
|
50
50
|
| APEXlang: human-readable, diffable app files; static IDs (26.1) | ✅ | `pgkiln export --format dir`: one JSON file per component with sorted keys, SQL and HTML in sibling files, references by static id instead of database ids; `pgkiln import --replace` updates an app in place, `pgkiln diff` compares ([chapter 18](guide/18-cli.md)). (0.31) **`--format text`**: the same files as YAML (a strict subset any YAML tool reads) with the SQL and templates inline, read back losslessly ([text files](guide/18-cli.md#text-files-apexlang)); regions have a stored **Static ID** (exported as their key, rendered as `data-static-id`), other components are named by their stored names. The syntax is YAML rather than APEXlang's own, so APEXlang files don't import. (sprint 116, 26.2 **file-level import**) `pgkiln import <dir> --replace --only pages/12` (or `--only shared/lovs/jobs.yaml`, repeatable) imports one page or shared component from a directory export and leaves the rest of the application as it is ([chapter 18](guide/18-cli.md#importing-one-page-or-component)) |
|
|
51
|
+
| Static analysis of exports in CI (APEXlang / SQLcl CodeScan), Working Copy APIs (26.2) | ✅ | (sprint 144, AP-10) **`pgkiln advise <export \| alias>`** runs the Advisor outside the builder: an export is imported under a temporary alias in a transaction that is always rolled back (code never runs) and checked there; every SQL fragment is planned as the application's role (stronger than CodeScan's file-only checks: unknown tables, columns, functions, types, missing grants), references are followed, and security defaults are checked (pages that write data without sign-in or an authorization scheme, unrestricted page protection, long sessions, administrators without a second factor). Output as text, JSON or **SARIF 2.1.0** with each finding at the file of its page or component, so GitHub code scanning annotates pull requests; `--fail-on` sets the exit code ([chapter 18](guide/18-cli.md#pgkiln-advise-in-ci)). **`pgkiln working-copy list\|create\|compare\|merge\|refresh\|delete`** and **`pgkiln lock` / `unlock`** for scripts and CI, and the MCP tools `advise_app`, `working_copy` and `lock_app` for coding agents ([working copies and locks](guide/18-cli.md#working-copies-and-locks)). It needs a database (pgkiln's migrations and the application's tables), not the files alone |
|
|
51
52
|
| Working copies, merge, team development | ✅ | **Working copies** of an application ([chapter 3](guide/03-builder.md#working-copies)): a second app on the same schema and data, compared three ways per component (settings, each shared component, page, region, item, …) with the main app as it was when copied; changes on one side merge, conflicts are chosen per component with a line diff; merge into the main app or refresh the copy, keeping users, sessions, saved reports, secrets and automation switches; locks respected. Conflicts are resolved per component, not per property |
|
|
52
53
|
| Team Development: issues, labels, milestones, templates, feedback | ✅ | (sprint 113) Builder → **Team Development** ([chapter 3](guide/03-builder.md#team-development)): issues per workspace with labels in groups, milestones, assignees, application and page links, Markdown comments with in-app @mentions and a history; a filtered list with saved views and a board by label group or milestone (no JavaScript needed); a set-up wizard installs sample labels, templates, canned responses and milestones. Users' feedback and developer comments become issues; open issues show in the Page Designer, on App Home and on the Workspace home; issues travel in the workspace export. Not included: e-mail notifications, GitHub sync |
|
|
53
54
|
| Application lock (26.1), page locks, comments | ✅ | Page and application locks, enforced on the server for every builder change; the owner or an administrator unlocks, and an administrator breaking a lock is logged. Developer comments per page and per app ([chapter 3](guide/03-builder.md)) |
|
|
@@ -70,6 +71,7 @@ database links row and added static workspace files with workspace web credentia
|
|
|
70
71
|
|---|---|---|
|
|
71
72
|
| Classic report (report templates, pagination types) | ✅ | (sprint 140) Region type `classic_report`: the report renderer without the Actions menu, column menus, saved reports or downloads, and none of an interactive report's settings from the URL; sorting by headings, an optional search; `report_template` `standard` (a table), `value_pairs` (Value Attribute Pairs), `badges` (Badge List) or `media_list` (Media List); `pagination` `total` (X–Y of Z), `range` (X–Y) or `none` ([chapter 4](guide/04-pages-and-regions.md#classic_report-classic-report)) |
|
|
72
73
|
| Interactive report | ✅ | (sprint 76) An Actions menu of nine entries with dialogs, a column heading menu (sort, hide, control break, the column's values to filter by), a search in one column, hidden columns, pagination with the range, first/last and rows per page. Search, column filters, sort, rows per page, control break, aggregates (with subtotals), highlight, saved private and public reports, computed columns, group by, pivot, chart view, row selection into a page item, CSV, Excel (typed cells) and PDF download, print, reset, reflow on phones. a maximum row count (`max_rows`), natural-language control (*Ask in your own words*, 26.1) and row selection that stays across pages. Not possible: flashback queries (PostgreSQL has none; use an audit or temporal table) |
|
|
74
|
+
| Interactive report dialogs of 26.2: multi-select and date-range filters, drag-and-drop columns | ✅ | (sprint 143, AP-9) *Actions → Filter*: **is one of** / **is not one of** (several values at once: ticked in a list of the column's values with counts and a search, or typed with commas; *is not one of* keeps the rows without a value), **is between** two values (both included; either may stay empty; on a date column the date picker in the application's date format, and the whole last day of a timestamp), and **is in** a period on a date column (today, yesterday, the last 7 or 30 days, the next 7 days, this or last month, this or last year; rolling, so a saved report stays current). Each is a chip in words (*Job is one of CLERK, ANALYST*). *Actions → Columns*: the columns in their order, **dragged** into another or moved with **arrow buttons** (announced to screen readers; without JavaScript the arrows submit the form); the order is a chip that puts it back, is kept in saved reports and followed by the CSV, Excel and PDF downloads, which also leave out hidden columns ([chapter 4](guide/04-pages-and-regions.md#report-interactive-report)). *Ask in your own words* and AI answers use the same operators. Text templates for AI computed columns: computed columns stay expressions over the report's columns |
|
|
73
75
|
| Interactive grid | ✅ | Inline edit, add and delete rows, lists of values, required columns, per-row errors, all-or-nothing save, signed row keys, search and paging; **aggregates** over the whole result (developer and user defined), **frozen columns**, column **reorder/resize/hide** (Actions → Columns, or drag and drop), per-user layouts and **saved grid reports** (private and public), **master-detail** (signed row selection, the first row selected on load and after a search, details refreshed in place), **navigation and edit mode** (cells as text with their format mask until clicked, Enter or F2; arrow keys between cells), a **row actions menu** (edit, duplicate, delete, links) and **copy/paste** of cell ranges (tab-separated, spreadsheet compatible) ([chapter 4](guide/04-pages-and-regions.md)) |
|
|
74
76
|
| Interactive grid views: single row view, chart view, group by | ✅ | (sprint 54) **Single row view**: one row of the search as a form with first/previous/next/last and *Add row*, from the Actions or row actions menu, saved by the grid's own process with the same checks; **group by** and **chart** set up in the Actions menu over every row of the search, as for the interactive report; `views` limits them; Save comes back to the same search, page and view ([chapter 4](guide/04-pages-and-regions.md#grid-interactive-grid)). No pivot view on grids (the interactive report has one), no editing in the single row view of columns the grid doesn't show |
|
|
75
77
|
| Form (automatic row processing) | ✅ | Fetch, insert, update, delete, in a page or a modal dialog. Detects rows deleted meanwhile. (sprint 50) **Lost update detection** (APEX: *Prevent Lost Updates* and *Lock Row*): the page carries a checksum of the row's form columns (`meta.row_version`, independent of time zone and date format, as the app's role); *Save* and *Delete* lock the row and refuse when it changed meanwhile; off per form with `{"lost_update": false}` ([chapter 4](guide/04-pages-and-regions.md#form)) |
|
package/docs/guide/03-builder.md
CHANGED
|
@@ -1609,11 +1609,19 @@ Database code (views, functions, RLS policies) isn't part of the application, so
|
|
|
1609
1609
|
component out, and the items computations set or copy); grids without a key or a save process;
|
|
1610
1610
|
workflow `invoke_api` steps that name a REST data source, parameter or web credential that
|
|
1611
1611
|
doesn't exist, leave a required parameter empty or use a `&VAR.` no step sets.
|
|
1612
|
+
- **Security** (sprint 144; APEX 26.2: CodeScan's checks): a page that needs no sign-in with a process that writes
|
|
1613
|
+
data (a form or grid save, or SQL with INSERT, UPDATE, DELETE, MERGE or TRUNCATE) is a warning; a signed-in page
|
|
1614
|
+
that writes data with no authorization scheme on the page or the process, in an application that has schemes, is a
|
|
1615
|
+
note; a page with **unrestricted** protection whose items a link can set without a checksum is a note, a warning
|
|
1616
|
+
when it writes data (hidden items never take posted values, so the URL is the way to set them); the installation's
|
|
1617
|
+
session idle time above 120 minutes or session length above 24 hours is a warning; and, as before, administrators
|
|
1618
|
+
who sign in with only a password.
|
|
1612
1619
|
- **PL/pgSQL functions:** when the `plpgsql_check` extension is installed, the functions in the
|
|
1613
1620
|
schemas the application's role can use are checked with `plpgsql_check_function_tb` (see
|
|
1614
1621
|
[extensions](15-extensions.md)).
|
|
1615
1622
|
|
|
1616
|
-
Findings are errors, warnings or notes, each linking to the component.
|
|
1623
|
+
Findings are errors, warnings or notes, each linking to the component. The same checks run from the command line
|
|
1624
|
+
for CI, with text, JSON or SARIF output: [`pgkiln advise`](18-cli.md#pgkiln-advise-in-ci).
|
|
1617
1625
|
|
|
1618
1626
|
## Utilities
|
|
1619
1627
|
|
|
@@ -234,12 +234,32 @@ Features for end users:
|
|
|
234
234
|
search and filters; at most 200), with a box to narrow them; choosing a value filters the report on it. The sort
|
|
235
235
|
arrow of the sorted column sorts at once. Without JavaScript a heading sorts (again for descending).
|
|
236
236
|
- **Hidden columns**: hidden from the heading menu or *Actions → Columns*, shown as chips to bring them back.
|
|
237
|
+
- **Column order** (sprint 143; APEX 26.2: drag-and-drop columns): *Actions → Columns* lists the columns in their
|
|
238
|
+
order with a checkbox to hide each; drag one to another place, or move it with its ↑ / ↓ buttons (each move is
|
|
239
|
+
announced to screen readers; without JavaScript the buttons submit the dialog). *Own column order* is a chip that
|
|
240
|
+
puts the report's order back. The order is kept in saved reports (`r12_o=sal&r12_o=ename`, the columns it names
|
|
241
|
+
first, the rest after them in the report's order), and the CSV, Excel and PDF downloads follow it and leave out
|
|
242
|
+
the columns the user hid.
|
|
237
243
|
- **Pagination**: *1–15 of 107*, first, previous, next and last page, and the **rows per page** list.
|
|
238
244
|
- **Actions menu** (sprint 76: a short menu like APEX's; each entry opens a dialog, or unfolds in place without
|
|
239
245
|
JavaScript): *Columns*, *Filter*, *Data* (sort, aggregate, compute, control break), *Format* (highlight, rows per
|
|
240
246
|
page), *Chart*, *Group by*, *Pivot*, *Report* (saved reports, reset) and *Download* (CSV, Excel, PDF, print):
|
|
241
247
|
- **column filters** (`=`, `≠`, contains, does not contain, `>`, `≥`, `<`, `≤`, is empty, is
|
|
242
|
-
not empty) and **sort
|
|
248
|
+
not empty, and since sprint 143 the 26.2 operators below) and **sort**:
|
|
249
|
+
- **is one of** / **is not one of** (APEX 26.2: multi-select filters): tick values in the column's list (with
|
|
250
|
+
their counts and a search box, as in the heading menu), or type them separated by commas. *Is not one of*
|
|
251
|
+
keeps the rows without a value. In the URL the values are a JSON array: `r12_f=job|in|["CLERK","ANALYST"]`
|
|
252
|
+
(`job|in|CLERK, ANALYST` works too), at most 100 values;
|
|
253
|
+
- **is between** (date-range filters): two values, both included, either may stay empty (*Salary ≥ 1000*). On a
|
|
254
|
+
date or timestamp column the fields get the date picker and take dates in the application's date format, and
|
|
255
|
+
the last day counts as a whole (`hiredate|between|["1981-01-01","1981-12-31"]`);
|
|
256
|
+
- **is in** a period, on a date column: today, yesterday, the last 7 days, the last 30 days, the next 7 days,
|
|
257
|
+
this month, last month, this year or last year (`hiredate|period|last_30_days`). A period is computed
|
|
258
|
+
from today when the report runs, so a saved report stays current.
|
|
259
|
+
|
|
260
|
+
The dialog shows only the fields the chosen operator needs (without JavaScript it shows all of them); a filter
|
|
261
|
+
is a chip in words (*Job is one of CLERK, ANALYST*), also in the PDF's filter list. *Ask in your own words* and
|
|
262
|
+
an AI service may use the same operators; a highlight takes the one-value operators;
|
|
243
263
|
- **control break**: group the rows by a column, with a heading row per group;
|
|
244
264
|
- **aggregates**: sum, average, count, minimum or maximum of a column, over all filtered rows
|
|
245
265
|
(not just the page). A *Total* row closes the table, and with a control break every group
|
|
@@ -267,7 +287,8 @@ Features for end users:
|
|
|
267
287
|
|
|
268
288
|
The report's state lives in the URL (`?r12_q=…&r12_s=3&r12_d=desc&r12_b=job&r12_a=sum|sal&r12_h=sal|gt|green|3000`),
|
|
269
289
|
so it can be bookmarked and shared. Everything the user enters is applied safely: search, filter
|
|
270
|
-
and highlight values become literals
|
|
290
|
+
and highlight values become literals (each value of a list and each bound of a range on its own; a period is one
|
|
291
|
+
of a fixed list of expressions), columns must exist in the result, operators, aggregate
|
|
271
292
|
functions, chart types and colors come from fixed lists, sort positions are integers, and computed
|
|
272
293
|
column expressions are parsed (below), never pasted into SQL.
|
|
273
294
|
|
|
@@ -49,7 +49,10 @@ src/
|
|
|
49
49
|
cli/ the command line: main.ts (commands, help, exit codes), apps.ts (connect, export,
|
|
50
50
|
read, import), files.ts (directories, zip), diff.ts, replace.ts (import --replace in place),
|
|
51
51
|
mcp.ts (`pgkiln mcp`: the MCP server for AI coding agents, chapter 20), only.ts (sprint 116:
|
|
52
|
-
`import --replace --only pages/12`, the named files merged over the application's current export)
|
|
52
|
+
`import --replace --only pages/12`, the named files merged over the application's current export),
|
|
53
|
+
advise.ts (sprint 144: `pgkiln advise`, the Advisor on an export rolled back, text / JSON / SARIF
|
|
54
|
+
with each finding at its file), working-copy.ts (sprint 144: working copies and locks for the
|
|
55
|
+
command line and the MCP tools working_copy and lock_app)
|
|
53
56
|
app.ts / server.ts Fastify setup / entry point
|
|
54
57
|
db.ts the owner and shared runtime pools, `runtime` (the current scope's: runtimeScope), appTx() (SET LOCAL ROLE + pgkiln.* settings, NOTICEs to the debug log), savepoints
|
|
55
58
|
workspace-db.ts isolated workspaces (090): the isolated applications (cached 5 s), a pool per workspace login (passwords from
|
package/docs/guide/18-cli.md
CHANGED
|
@@ -44,6 +44,9 @@ any (see [what is not exported](03-builder.md#export-format)).
|
|
|
44
44
|
| `pgkiln export <alias> [--format json\|dir\|text] [--out <path>]` | `json` (default): the `pgkiln/2` document with sorted keys, to `--out` or standard output. `dir`: a directory (default `./<alias>`), see below. `text`: the same directory in YAML with the code inline ([text files](#text-files-apexlang)) |
|
|
45
45
|
| `pgkiln import <path> [--alias <alias>] [--replace [--only <file>]…] [--check [--force] \| --dry-run]` | Imports a JSON export, an application directory or a `.zip` of one. `--alias` gives the copy another alias. `--replace` updates the application with that alias in place (after a [backup](03-builder.md#backups)); with `--only pages/12` (repeatable) only that page or component file ([below](#importing-one-page-or-component)). `--check` checks the application before it commits, `--dry-run` only checks ([below](#checking-before-an-import)) |
|
|
46
46
|
| `pgkiln diff <alias> <path> [--name-only \| --quiet]` | What differs between the application in the database and a directory (or JSON file, or zip) |
|
|
47
|
+
| `pgkiln advise <path\|alias> [--format text\|json\|sarif] [--fail-on error\|warning\|info\|never] [-o <file>] [--base <dir>]` | (0.77) The [Advisor](03-builder.md#advisor) for CI: an export is imported into a transaction that is always rolled back and checked there; an alias checks the application in the database. SARIF points each finding at its file, so pull requests get annotations. Exit code 1 from `--fail-on` (default `error`) ([below](#pgkiln-advise-in-ci)) |
|
|
48
|
+
| `pgkiln working-copy list\|create\|compare\|merge\|refresh\|delete <alias> [<name>] [--prefer copy\|main] [--take <component>]… [--as <developer>]` | (0.77) [Working copies](03-builder.md#working-copies) from the command line ([below](#working-copies-and-locks)) |
|
|
49
|
+
| `pgkiln lock <alias> [--page <n>] [--note <text>]` / `pgkiln unlock <alias> [--page <n>] [--force]` | (0.77) The builder's application and page locks; another developer's lock is broken only with `--force` (logged) |
|
|
47
50
|
| `pgkiln ddl <schema> [--no-comments] [--no-grants] [--out <file>]` | The DDL of a schema's objects, in an order that runs (as SQL Workshop → DDL, [chapter 3](03-builder.md#sql-workshop)) |
|
|
48
51
|
| `pgkiln compare <source> <target> [--script]` | Compares two schemas: `+` only in the source, `-` only in the target, `~` different; exit code 1 when they differ. `--script` writes the script that makes the target like the source (drops commented out); nothing is run |
|
|
49
52
|
| `pgkiln mcp` | An MCP server on standard input/output for AI coding agents, see [chapter 20](20-ai-agents.md) |
|
|
@@ -273,6 +276,77 @@ Import page has the check ticked.
|
|
|
273
276
|
leaves dot files (`.git`, `.gitattributes`) alone; it refuses a non-empty directory without a
|
|
274
277
|
`pgkiln.json`, so a typo can't empty the wrong folder.
|
|
275
278
|
|
|
279
|
+
### pgkiln advise in CI
|
|
280
|
+
|
|
281
|
+
(sprint 144; APEX 26.2: APEXlang static analysis with SQLcl CodeScan) `pgkiln advise` runs the
|
|
282
|
+
[Advisor](03-builder.md#advisor) outside the builder: every SQL fragment planned as the application's role, the
|
|
283
|
+
references, and the security checks (pages that write data without sign-in or an authorization scheme, unrestricted
|
|
284
|
+
page protection, long sessions, administrators without a second factor). Given a path (directory, `.zip` or JSON
|
|
285
|
+
export), it imports the application under a temporary alias in a transaction that is always rolled back: nothing
|
|
286
|
+
changes, and process code, supporting objects and plug-in SQL are never run. Given an alias, it checks the application
|
|
287
|
+
in the database (also rolled back).
|
|
288
|
+
|
|
289
|
+
It needs a database: pgkiln's migrations for the `meta` schema, and the application's own tables, so the SQL plans
|
|
290
|
+
against what the new version needs. In CI that is a PostgreSQL service, `pgkiln migrate` and your own migrations:
|
|
291
|
+
|
|
292
|
+
```yaml
|
|
293
|
+
# .github/workflows/pgkiln.yml
|
|
294
|
+
jobs:
|
|
295
|
+
advise:
|
|
296
|
+
runs-on: ubuntu-latest
|
|
297
|
+
permissions: { contents: read, security-events: write }
|
|
298
|
+
services:
|
|
299
|
+
postgres:
|
|
300
|
+
image: postgres:17
|
|
301
|
+
env: { POSTGRES_USER: pgkiln, POSTGRES_PASSWORD: pgkiln, POSTGRES_DB: pgkiln }
|
|
302
|
+
ports: ['5432:5432']
|
|
303
|
+
options: --health-cmd pg_isready --health-interval 2s --health-retries 30
|
|
304
|
+
env:
|
|
305
|
+
DATABASE_URL: postgres://pgkiln:pgkiln@localhost:5432/pgkiln
|
|
306
|
+
steps:
|
|
307
|
+
- uses: actions/checkout@v4
|
|
308
|
+
- uses: actions/setup-node@v4
|
|
309
|
+
with: { node-version: 22 }
|
|
310
|
+
- run: npx pgkiln migrate
|
|
311
|
+
- run: psql "$DATABASE_URL" -f db/schema.sql # your application's tables
|
|
312
|
+
- run: npx pgkiln advise apps/sales --format sarif -o advise.sarif --fail-on warning
|
|
313
|
+
- uses: github/codeql-action/upload-sarif@v3
|
|
314
|
+
if: always()
|
|
315
|
+
with: { sarif_file: advise.sarif }
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
| Format | What it gives |
|
|
319
|
+
|---|---|
|
|
320
|
+
| `text` (default) | one finding per line with its file under it, and a summary line |
|
|
321
|
+
| `json` | `{ alias, checked, counts: { error, warning, info }, findings: [{ severity, where, field, message, page, kind, file }] }` |
|
|
322
|
+
| `sarif` | SARIF 2.1.0: a result per finding with its level (error, warning, note), a stable rule id (`pgkiln/region/source`) and the file of its page or component in the export (`apps/sales/pages/0002-orders/regions/0010-order-list.yaml`), so GitHub code scanning annotates the pull request |
|
|
323
|
+
|
|
324
|
+
The paths are relative to the current directory. With an alias there is no directory: `--base apps/sales` names
|
|
325
|
+
the folder its export is kept in. `--fail-on` sets the exit code: 1 when a finding is at that level or worse
|
|
326
|
+
(`error` by default; `never` always 0); 2 for a usage error, 3 when the database can't be reached.
|
|
327
|
+
|
|
328
|
+
### Working copies and locks
|
|
329
|
+
|
|
330
|
+
(sprint 144; APEX 26.2: the Application and Working Copy APIs) The builder's [working copies](03-builder.md#working-copies)
|
|
331
|
+
and locks, for scripts and CI:
|
|
332
|
+
|
|
333
|
+
```sh
|
|
334
|
+
pgkiln working-copy create sales "feature x" --as alice # Working copy feature x of sales: application sales-feature-x (812)
|
|
335
|
+
pgkiln export sales-feature-x --format text -o apps/sales-feature-x # change the copy's files …
|
|
336
|
+
pgkiln import apps/sales-feature-x --replace --check
|
|
337
|
+
pgkiln working-copy compare sales-feature-x # copy / main / CONFLICT per component, exit 1 with conflicts
|
|
338
|
+
pgkiln working-copy merge sales-feature-x --take pages/0002/page --as alice
|
|
339
|
+
pgkiln working-copy delete sales-feature-x
|
|
340
|
+
pgkiln lock sales --page 2 --note "release 1.4" --as alice
|
|
341
|
+
pgkiln unlock sales --page 2 --as alice
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
A merge needs a choice for every conflict (a component changed in both): `--prefer copy` or `--prefer main` for all
|
|
345
|
+
of them, or `--take <component>` (as `compare` lists them) for each that keeps the copy's version. It is refused while
|
|
346
|
+
another developer has locked the target application or a page it changes, as in the builder. Changes go to the
|
|
347
|
+
activity log under `--as`, else `PGKILN_DEVELOPER`, else the operating system user. The MCP server has the same as
|
|
348
|
+
the tools `advise_app`, `working_copy` and `lock_app` ([chapter 20](20-ai-agents.md#tools)).
|
|
349
|
+
|
|
276
350
|
### diff
|
|
277
351
|
|
|
278
352
|
`pgkiln diff hr apps/hr` exports the application in memory and compares file by file:
|
|
@@ -75,6 +75,9 @@ directory the agent started the server in (the project).
|
|
|
75
75
|
| `recent_errors` | the latest errors and refused requests from the activity log | no |
|
|
76
76
|
| `export_app` | writes an application to a directory (default `apps/<alias>`, format `text`) | files on disk |
|
|
77
77
|
| `diff_app` | what an import of a directory would change (A/D/M with unified diffs); also reports files it can't read | no |
|
|
78
|
+
| `advise_app` | (0.77) the Advisor on an application or an export (imported and rolled back): SQL planned as the application's role, references, security checks, each finding with its file | no |
|
|
79
|
+
| `working_copy` | (0.77) `list`, `create`, `compare`, `merge`, `refresh` or `delete` working copies; conflicts need `prefer` (copy or main) or `take` (component ids); a merge is refused while another developer has a lock on it | the database |
|
|
80
|
+
| `lock_app` | (0.77) locks an application or a page (`unlock: true` removes it; another developer's lock only with `force: true`, logged) | the database |
|
|
78
81
|
| `import_app` | imports a directory, zip or JSON file; `replace: true` updates the application in place. It checks the application first (the Advisor, in the import's transaction): errors refuse the import and are listed; `force: true` imports anyway, `dry_run: true` only checks | the database |
|
|
79
82
|
|
|
80
83
|
The files are the [directory format](18-cli.md#the-directory-format) of the command line, in the
|
package/package.json
CHANGED
package/public/app.css
CHANGED
|
@@ -2020,6 +2020,24 @@ a.search-hit:hover, a.search-hit:focus-visible { background: var(--accent-soft);
|
|
|
2020
2020
|
.ir-dialog-head h2 { margin: 0; font-size: 1.05rem; }
|
|
2021
2021
|
.ir-dialog .ir-body { padding: 1rem; }
|
|
2022
2022
|
.ir-dialog .filter-row { min-width: 0; }
|
|
2023
|
+
.filter-dialog .date-field { display: flex; min-width: 0; }
|
|
2024
|
+
.filter-dialog .date-field input { flex: 1; min-width: 0; }
|
|
2025
|
+
.filter-dialog .filter-values, .filter-dialog .help { grid-column: 1 / -1; }
|
|
2026
|
+
.filter-values { display: grid; gap: 0.3rem; }
|
|
2027
|
+
.filter-values-list { list-style: none; margin: 0; padding: 0.25rem 0.4rem; max-height: 14rem; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); }
|
|
2028
|
+
.filter-values-list .check { display: flex; gap: 0.4rem; align-items: center; padding: 0.15rem 0; }
|
|
2029
|
+
.filter-values-list .muted { margin-left: auto; font-variant-numeric: tabular-nums; }
|
|
2030
|
+
/* (143) Actions → Columns: a row per column, dragged by its handle or moved with its arrows */
|
|
2031
|
+
.ir-col-order { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; }
|
|
2032
|
+
.ir-col-order > li { display: flex; align-items: center; gap: 0.4rem; padding: 0.15rem 0.3rem; border: 1px solid transparent; border-radius: var(--radius); background: var(--surface); }
|
|
2033
|
+
.ir-col-order > li:hover { border-color: var(--border); }
|
|
2034
|
+
.ir-col-order > li.dragging { opacity: 0.55; border-style: dashed; border-color: var(--accent); }
|
|
2035
|
+
.ir-col-order .check { flex: 1; min-width: 0; }
|
|
2036
|
+
.ir-col-order .drag-handle { color: var(--muted); cursor: grab; display: inline-flex; }
|
|
2037
|
+
.no-js .ir-col-order .drag-handle, html:not(.js) .ir-col-order .drag-handle { display: none; }
|
|
2038
|
+
.ir-col-move { display: inline-flex; gap: 0.15rem; }
|
|
2039
|
+
.ir-col-move .btn { min-width: 2rem; padding: 0.1rem 0.4rem; line-height: 1.2; }
|
|
2040
|
+
.ir-col-move .btn:disabled { opacity: 0.35; }
|
|
2023
2041
|
/* the search field with its column list (APEX: the magnifier's column menu) */
|
|
2024
2042
|
.search-field { display: flex; flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
|
|
2025
2043
|
.search-field:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
|
package/public/app.js
CHANGED
|
@@ -4420,6 +4420,147 @@ const reportTexts = (() => {
|
|
|
4420
4420
|
window.addEventListener('resize', shut);
|
|
4421
4421
|
})();
|
|
4422
4422
|
|
|
4423
|
+
// (143; APEX 26.2: multi-select and date-range filters) Actions → Filter shows the fields its operator needs: one
|
|
4424
|
+
// value; "is one of" a list of the column's values with counts and a search (the ticked ones go as r<id>_fl, next to
|
|
4425
|
+
// values typed with commas); "is between" two values; "is in" a period, offered on date columns only. On a date
|
|
4426
|
+
// column the value fields get the date picker in the application's date format.
|
|
4427
|
+
(() => {
|
|
4428
|
+
const t = (k, d) => reportTexts[k] || d;
|
|
4429
|
+
const cache = new Map();
|
|
4430
|
+
function fill(box, column) {
|
|
4431
|
+
const list = box.querySelector('.filter-values');
|
|
4432
|
+
if (!list || list.dataset.column === column) return;
|
|
4433
|
+
list.dataset.column = column;
|
|
4434
|
+
list.replaceChildren();
|
|
4435
|
+
const search = document.createElement('input');
|
|
4436
|
+
search.type = 'search';
|
|
4437
|
+
search.placeholder = t('report.filter_values', 'Filter the values');
|
|
4438
|
+
search.setAttribute('aria-label', search.placeholder);
|
|
4439
|
+
const ul = document.createElement('ul');
|
|
4440
|
+
ul.className = 'filter-values-list';
|
|
4441
|
+
list.append(search, ul);
|
|
4442
|
+
search.addEventListener('input', () => {
|
|
4443
|
+
const q = search.value.trim().toLowerCase();
|
|
4444
|
+
ul.querySelectorAll('li').forEach((li) => { li.hidden = !!q && !li.textContent.toLowerCase().includes(q); });
|
|
4445
|
+
});
|
|
4446
|
+
const url = new URL(box.dataset.values, location.href);
|
|
4447
|
+
new URL(location.href).searchParams.forEach((v, k) => url.searchParams.append(k, v));
|
|
4448
|
+
url.searchParams.set('col', column);
|
|
4449
|
+
const key = url.toString();
|
|
4450
|
+
const got = cache.get(key) ?? fetch(url, { headers: { accept: 'application/json' }, credentials: 'same-origin' }).then((r) => (r.ok ? r.json() : { values: [] })).catch(() => ({ values: [] }));
|
|
4451
|
+
cache.set(key, got);
|
|
4452
|
+
got.then(({ values }) => {
|
|
4453
|
+
if (list.dataset.column !== column) return;
|
|
4454
|
+
const shown = (values || []).filter((x) => x.value !== null);
|
|
4455
|
+
if (!shown.length) {
|
|
4456
|
+
const li = document.createElement('li');
|
|
4457
|
+
li.className = 'muted';
|
|
4458
|
+
li.textContent = t('report.no_values', 'No values');
|
|
4459
|
+
ul.append(li);
|
|
4460
|
+
return;
|
|
4461
|
+
}
|
|
4462
|
+
for (const { value, count } of shown) {
|
|
4463
|
+
const li = document.createElement('li');
|
|
4464
|
+
const label = document.createElement('label');
|
|
4465
|
+
label.className = 'check';
|
|
4466
|
+
const box2 = document.createElement('input');
|
|
4467
|
+
box2.type = 'checkbox';
|
|
4468
|
+
box2.name = box.dataset.list;
|
|
4469
|
+
box2.value = value;
|
|
4470
|
+
box2.setAttribute('form', box.dataset.form);
|
|
4471
|
+
const n = document.createElement('span');
|
|
4472
|
+
n.className = 'muted';
|
|
4473
|
+
n.textContent = ` ${count}`;
|
|
4474
|
+
label.append(box2, ` ${value}`, n);
|
|
4475
|
+
li.append(label);
|
|
4476
|
+
ul.append(li);
|
|
4477
|
+
}
|
|
4478
|
+
});
|
|
4479
|
+
}
|
|
4480
|
+
function sync(box) {
|
|
4481
|
+
const col = box.querySelector('[data-filter-column]');
|
|
4482
|
+
const op = box.querySelector('[data-filter-op]');
|
|
4483
|
+
if (!col || !op) return;
|
|
4484
|
+
const date = col.selectedOptions[0]?.dataset.kind === 'date';
|
|
4485
|
+
op.querySelectorAll('option[data-op-kind="period"]').forEach((o) => { o.hidden = !date; o.disabled = !date; });
|
|
4486
|
+
if (!date && op.selectedOptions[0]?.dataset.opKind === 'period') op.value = 'eq';
|
|
4487
|
+
const kind = op.selectedOptions[0]?.dataset.opKind || 'one';
|
|
4488
|
+
box.querySelectorAll('.filter-field[data-show]').forEach((el) => { el.hidden = !el.dataset.show.split(' ').includes(kind); });
|
|
4489
|
+
for (const input of box.querySelectorAll('input[data-mask-off]')) {
|
|
4490
|
+
const picker = date && kind !== 'list';
|
|
4491
|
+
if (picker) input.dataset.dateMask = input.dataset.maskOff;
|
|
4492
|
+
else delete input.dataset.dateMask;
|
|
4493
|
+
input.placeholder = picker ? input.dataset.maskOff : input.getAttribute('aria-label') || '';
|
|
4494
|
+
const btn = input.parentElement?.querySelector('[data-date-pick]');
|
|
4495
|
+
if (btn) btn.hidden = !picker;
|
|
4496
|
+
}
|
|
4497
|
+
if (kind === 'list') fill(box, col.value);
|
|
4498
|
+
}
|
|
4499
|
+
document.querySelectorAll('[data-filter-dialog]').forEach(sync);
|
|
4500
|
+
document.addEventListener('change', (e) => {
|
|
4501
|
+
const box = e.target.closest?.('[data-filter-dialog]');
|
|
4502
|
+
if (box && e.target.matches('[data-filter-column], [data-filter-op]')) sync(box);
|
|
4503
|
+
});
|
|
4504
|
+
})();
|
|
4505
|
+
|
|
4506
|
+
// (143; APEX 26.2: drag-and-drop column ordering) Actions → Columns: drag a column to another place, or move it with
|
|
4507
|
+
// its arrow buttons (Up / Down; without JavaScript they submit the form and the server moves it); the dialog's form
|
|
4508
|
+
// sends the columns in the list's order when applied. Each move is announced.
|
|
4509
|
+
(() => {
|
|
4510
|
+
const t = (k, d) => reportTexts[k] || d;
|
|
4511
|
+
const fmt = (s, p) => s.replace(/\{(\w+)\}/g, (m, k) => (k in p ? p[k] : m));
|
|
4512
|
+
function refresh(list, moved) {
|
|
4513
|
+
const items = [...list.children];
|
|
4514
|
+
items.forEach((li, i) => {
|
|
4515
|
+
const [up, down] = li.querySelectorAll('.ir-col-move button');
|
|
4516
|
+
if (up) up.disabled = i === 0;
|
|
4517
|
+
if (down) down.disabled = i === items.length - 1;
|
|
4518
|
+
});
|
|
4519
|
+
if (!moved) return;
|
|
4520
|
+
const status = list.closest('.ir-columns')?.parentElement?.querySelector('[data-col-status]');
|
|
4521
|
+
const name = moved.querySelector('label')?.textContent.trim() || moved.dataset.colName;
|
|
4522
|
+
if (status) status.textContent = fmt(t('report.moved', '{column}: position {n} of {total}'), { column: name, n: items.indexOf(moved) + 1, total: items.length });
|
|
4523
|
+
}
|
|
4524
|
+
document.addEventListener('click', (e) => {
|
|
4525
|
+
const btn = e.target.closest?.('[data-col-order] .ir-col-move button');
|
|
4526
|
+
if (!btn) return;
|
|
4527
|
+
e.preventDefault();
|
|
4528
|
+
const li = btn.closest('li');
|
|
4529
|
+
const list = li.parentElement;
|
|
4530
|
+
const up = btn === li.querySelector('.ir-col-move button');
|
|
4531
|
+
const other = up ? li.previousElementSibling : li.nextElementSibling;
|
|
4532
|
+
if (!other) return;
|
|
4533
|
+
if (up) other.before(li);
|
|
4534
|
+
else other.after(li);
|
|
4535
|
+
refresh(list, li);
|
|
4536
|
+
(btn.disabled ? li.querySelector('.ir-col-move button:not(:disabled)') : btn)?.focus();
|
|
4537
|
+
});
|
|
4538
|
+
let dragged = null;
|
|
4539
|
+
document.addEventListener('dragstart', (e) => {
|
|
4540
|
+
const li = e.target.closest?.('[data-col-order] > li');
|
|
4541
|
+
if (!li) return;
|
|
4542
|
+
dragged = li;
|
|
4543
|
+
li.classList.add('dragging');
|
|
4544
|
+
e.dataTransfer.effectAllowed = 'move';
|
|
4545
|
+
e.dataTransfer.setData('text/plain', li.dataset.colName || '');
|
|
4546
|
+
});
|
|
4547
|
+
document.addEventListener('dragover', (e) => {
|
|
4548
|
+
const list = e.target.closest?.('[data-col-order]');
|
|
4549
|
+
if (!dragged || !list || dragged.parentElement !== list) return;
|
|
4550
|
+
e.preventDefault();
|
|
4551
|
+
const after = [...list.children].find((li) => li !== dragged && e.clientY < li.getBoundingClientRect().top + li.offsetHeight / 2);
|
|
4552
|
+
if (after) after.before(dragged);
|
|
4553
|
+
else list.append(dragged);
|
|
4554
|
+
});
|
|
4555
|
+
document.addEventListener('drop', (e) => { if (dragged && e.target.closest?.('[data-col-order]')) e.preventDefault(); });
|
|
4556
|
+
document.addEventListener('dragend', () => {
|
|
4557
|
+
if (!dragged) return;
|
|
4558
|
+
dragged.classList.remove('dragging');
|
|
4559
|
+
refresh(dragged.parentElement, dragged);
|
|
4560
|
+
dragged = null;
|
|
4561
|
+
});
|
|
4562
|
+
})();
|
|
4563
|
+
|
|
4423
4564
|
// (sprint 76) the report pager's rows per page: sent on change
|
|
4424
4565
|
document.addEventListener('change', (e) => {
|
|
4425
4566
|
if (e.target.matches?.('select[data-go]')) e.target.form?.submit();
|
package/src/builder/advisor.ts
CHANGED
|
@@ -3,6 +3,7 @@ import pg from 'pg';
|
|
|
3
3
|
import { applyBinds, splitStatements } from '../binds.ts';
|
|
4
4
|
import { owner, runtime, type Db } from '../db.ts';
|
|
5
5
|
import { devDbForApp } from '../workspace-db.ts';
|
|
6
|
+
import { settingFrom } from '../instance.ts';
|
|
6
7
|
import { html, type Raw } from '../html.ts';
|
|
7
8
|
import { icon } from '../icons.ts';
|
|
8
9
|
import { templateProblem } from '../runtime/document.ts';
|
|
@@ -154,6 +155,49 @@ export async function checkSql(c: pg.PoolClient, sql: string, shape: SqlShape):
|
|
|
154
155
|
return unchecked.length ? { severity: 'info', message: `Not checked (only SELECT, INSERT, UPDATE, DELETE, MERGE and DO can be checked without running them): ${unchecked.join(', ')}` } : null;
|
|
155
156
|
}
|
|
156
157
|
|
|
158
|
+
/** process types that write data (sprint 144: the security checks below; a sql process when its code has DML) */
|
|
159
|
+
const WRITES = ['form_dml', 'grid_dml', 'sql'];
|
|
160
|
+
/** (sprint 144) session limits above which the Advisor warns (APEX CodeScan's session limits) */
|
|
161
|
+
export const SESSION_LIMITS = { idleMinutes: 120, maxHours: 24 };
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* (sprint 144, AP-10; APEX 26.2: APEXlang static analysis / SQLcl CodeScan) Security defaults of an application:
|
|
165
|
+
* - a page anyone can open (no sign-in) with a process that writes data;
|
|
166
|
+
* - a signed-in page that writes data with neither the page nor the process behind an authorization scheme, in an
|
|
167
|
+
* application that has schemes (info: every signed-in user may use it);
|
|
168
|
+
* - a page with unrestricted protection whose items take values from the URL without a checksum (APEX: value
|
|
169
|
+
* protection; hidden items never take posted values in pgkiln, so URL values are the way in);
|
|
170
|
+
* - the installation's session limits above SESSION_LIMITS.
|
|
171
|
+
*/
|
|
172
|
+
async function securityFindings(appId: number, query: (sql: string, params?: unknown[]) => Promise<pg.QueryResult>, byKey: Map<string, Entry>): Promise<Finding[]> {
|
|
173
|
+
const out: Finding[] = [];
|
|
174
|
+
const schemes = (await query('select count(*)::int as n from meta.authz_scheme where app_id = $1', [appId])).rows[0].n as number;
|
|
175
|
+
const pages = (await query(
|
|
176
|
+
`select p.id, p.page_no, p.requires_auth, p.authz, p.protection,
|
|
177
|
+
(select array_agg(pr.name order by pr.seq) from meta.process pr where pr.page_id = p.id and pr.type = any($2) and pr.authz is null and coalesce(pr.build_option, '') <> 'COMMENTED_OUT'
|
|
178
|
+
and (pr.type <> 'sql' or pr.code ~* '\\m(insert|update|delete|merge|truncate)\\M')) as writes,
|
|
179
|
+
(select count(*)::int from meta.item i where i.page_id = p.id and i.type <> 'display') as items
|
|
180
|
+
from meta.page p where p.app_id = $1 and coalesce(p.build_option, '') <> 'COMMENTED_OUT' order by p.page_no`, [appId, WRITES])).rows;
|
|
181
|
+
for (const p of pages) {
|
|
182
|
+
const entry = byKey.get(`page-${p.id}`) ?? null;
|
|
183
|
+
const writes: string[] = p.writes ?? [];
|
|
184
|
+
if (writes.length && !p.requires_auth)
|
|
185
|
+
out.push({ severity: 'warning', entry, field: 'Security → Authentication', message: `Page ${p.page_no} needs no sign-in, and its process ${writes.join(', ')} writes data: anyone can run it. Require authentication, or put the process behind an authorization scheme.` });
|
|
186
|
+
else if (writes.length && !p.authz && schemes)
|
|
187
|
+
out.push({ severity: 'info', entry, field: 'Security → Authorization scheme', message: `Page ${p.page_no} writes data (${writes.join(', ')}) with no authorization scheme on the page or the process: every signed-in user may use it.` });
|
|
188
|
+
if (p.protection === 'unrestricted' && p.items)
|
|
189
|
+
out.push({ severity: writes.length ? 'warning' : 'info', entry, field: 'Security → Page protection', message: `Page ${p.page_no} is unrestricted: a link can set its items without a checksum${writes.length ? ', and the page writes data' : ''}. Use checksum protection unless the URL is meant to be typed.` });
|
|
190
|
+
}
|
|
191
|
+
const settings = (await query(`select name, value from meta.setting where name in ('session_idle_minutes', 'session_max_hours')`).catch(() => ({ rows: [] }))).rows;
|
|
192
|
+
const idle = settingFrom('session_idle_minutes', settings);
|
|
193
|
+
const max = settingFrom('session_max_hours', settings);
|
|
194
|
+
if (idle > SESSION_LIMITS.idleMinutes)
|
|
195
|
+
out.push({ severity: 'warning', entry: null, field: 'Instance settings → Session idle time', message: `Sessions end after ${idle} minutes without requests; more than ${SESSION_LIMITS.idleMinutes} leaves unattended sessions open.` });
|
|
196
|
+
if (max > SESSION_LIMITS.maxHours)
|
|
197
|
+
out.push({ severity: 'warning', entry: null, field: 'Instance settings → Maximum session length', message: `Sessions last up to ${max} hours; more than ${SESSION_LIMITS.maxHours} keeps a stolen session usable for long.` });
|
|
198
|
+
return out;
|
|
199
|
+
}
|
|
200
|
+
|
|
157
201
|
const ITEM_REF = /(?<![A-Za-z0-9_$&:])(?::|&)(P\d+_[A-Z0-9_]+)\b/gi;
|
|
158
202
|
const BUILT_IN = new Set(['MUST_NOT_BE_PUBLIC_USER']);
|
|
159
203
|
|
|
@@ -177,7 +221,11 @@ export async function advise(appId: number, tx?: pg.ClientBase, opts: { db?: Db
|
|
|
177
221
|
? await query(`select t.*, p.page_no from ${table} t join meta.page p on p.id = t.page_id where p.app_id = $1`, [appId])
|
|
178
222
|
: await query(`select * from ${table} where app_id = $1`, [appId])
|
|
179
223
|
).rows.map((row) => ({ kind, row }));
|
|
180
|
-
|
|
224
|
+
// one client (an import's transaction) runs one query at a time; the pool may run them side by side
|
|
225
|
+
const lists: { kind: string; row: any }[][] = [];
|
|
226
|
+
if (tx) for (const [kind, spec] of Object.entries(COMPONENTS)) lists.push(await rowsOf(kind, spec.table, spec.scope));
|
|
227
|
+
else lists.push(...(await Promise.all(Object.entries(COMPONENTS).map(([kind, spec]) => rowsOf(kind, spec.table, spec.scope)))));
|
|
228
|
+
const all = lists.flat();
|
|
181
229
|
|
|
182
230
|
// metadata checks, as the owner (before the role switch below: the application's role can't read meta)
|
|
183
231
|
// (087) the application's login page: a page that needs no sign-in, with a login region
|
|
@@ -201,6 +249,7 @@ export async function advise(appId: number, tx?: pg.ClientBase, opts: { db?: Db
|
|
|
201
249
|
for (const p of (await query(`select p.page_no, p.page_group from meta.page p where p.app_id = $1 and p.page_group is not null
|
|
202
250
|
and not exists (select 1 from meta.page_group g where g.app_id = p.app_id and g.name = p.page_group) order by 1`, [appId])).rows)
|
|
203
251
|
findings.push({ severity: 'warning', entry: null, field: `Page ${p.page_no} → Page group`, message: `Page group ${p.page_group} doesn't exist (Shared Components → Page groups).` });
|
|
252
|
+
findings.push(...(await securityFindings(appId, query, byKey)));
|
|
204
253
|
// ---- SQL, as the application's role, rolled back (a savepoint in the caller's transaction)
|
|
205
254
|
// (090) an isolated workspace's application: planned on the workspace's developer login, in a
|
|
206
255
|
// transaction of its own (planning can run the application's functions; RESET ROLE there only
|
|
@@ -7,7 +7,7 @@ import { clientIp, logActivity } from '../session.ts';
|
|
|
7
7
|
import {
|
|
8
8
|
compare, copiesOf, copyOf, createCopy, deleteCopy, fingerprint, mergeCopy, WorkingCopyError, type Change,
|
|
9
9
|
} from '../workingcopy.ts';
|
|
10
|
-
import {
|
|
10
|
+
import { lockedFor } from '../cli/working-copy.ts';
|
|
11
11
|
import { appHeader, back, BASE, csrf, developer, flash, input, region, send, shell, type Req } from './ui.ts';
|
|
12
12
|
import { appAllowed } from './workspaces.ts';
|
|
13
13
|
|
|
@@ -24,16 +24,6 @@ const appRow = async (id: string) => (/^\d{1,9}$/.test(id) ? owner.one('select i
|
|
|
24
24
|
const SIDE: Record<string, string> = { added: 'added', deleted: 'deleted', changed: 'changed' };
|
|
25
25
|
const STATUS: Record<Change['status'], string> = { copy: 'Changed in the copy', main: 'Changed in the main application', conflict: 'Conflict: changed on both sides' };
|
|
26
26
|
|
|
27
|
-
/** Another developer's lock on the target application or one of the pages a merge changes. */
|
|
28
|
-
const lockedFor = (username: string) => async (appId: number, pages: Set<number>) => {
|
|
29
|
-
const l = await owner.one<Lock>(
|
|
30
|
-
`select app_id, page_no, locked_by, locked_at::text, note from meta.builder_lock
|
|
31
|
-
where app_id = $1 and locked_by <> $2 and (page_no = 0 or page_no = any($3::int[])) order by page_no limit 1`,
|
|
32
|
-
[appId, username, [...pages]],
|
|
33
|
-
);
|
|
34
|
-
return l ? `${lockText(l)} The change is refused until it is unlocked.` : null;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
27
|
function diffPanel(ch: Change) {
|
|
38
28
|
const paths = [...new Set([...(ch.main?.keys() ?? []), ...(ch.copy?.keys() ?? [])])].sort();
|
|
39
29
|
return html`<div id="diff">
|