pgkiln 0.36.0 → 0.38.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.
Files changed (54) hide show
  1. package/SECURITY.md +12 -9
  2. package/db/migrations/090_workspace_isolation.sql +512 -0
  3. package/db/migrations/091_workspace_service.sql +20 -0
  4. package/db/migrations/092_app_groups.sql +23 -0
  5. package/docs/apex-feature-parity.md +16 -11
  6. package/docs/guide/03-builder.md +125 -11
  7. package/docs/guide/12-development.md +12 -2
  8. package/examples/gallery/README.md +13 -0
  9. package/examples/gallery/gallery.json +20 -0
  10. package/examples/gallery/starters/asset-inventory.json +30 -0
  11. package/examples/gallery/starters/contacts.json +41 -0
  12. package/examples/gallery/starters/event-registrations.json +29 -0
  13. package/examples/gallery/starters/expense-claims.json +32 -0
  14. package/examples/gallery/starters/team-tasks.json +35 -0
  15. package/examples/hr/hr_40_sample_data.sql +1 -1
  16. package/package.json +1 -1
  17. package/public/builder.css +91 -0
  18. package/src/app.ts +24 -0
  19. package/src/automations.ts +3 -2
  20. package/src/builder/advisor.ts +11 -5
  21. package/src/builder/ai-builder.ts +27 -18
  22. package/src/builder/app-groups.ts +132 -0
  23. package/src/builder/blueprints.ts +21 -7
  24. package/src/builder/code-editor.ts +3 -2
  25. package/src/builder/cross-app.ts +106 -0
  26. package/src/builder/dataload.ts +24 -14
  27. package/src/builder/ddl-tools.ts +7 -4
  28. package/src/builder/documents.ts +2 -1
  29. package/src/builder/gallery.ts +154 -0
  30. package/src/builder/home.ts +33 -10
  31. package/src/builder/newapp.ts +21 -3
  32. package/src/builder/quicksql.ts +3 -2
  33. package/src/builder/report-settings.ts +4 -2
  34. package/src/builder/routes.ts +78 -26
  35. package/src/builder/sampledata.ts +22 -18
  36. package/src/builder/scripts.ts +31 -16
  37. package/src/builder/sql.ts +119 -15
  38. package/src/builder/ui.ts +30 -7
  39. package/src/builder/unload.ts +3 -2
  40. package/src/builder/workspaces.ts +291 -22
  41. package/src/cli/replace.ts +2 -0
  42. package/src/db.ts +36 -6
  43. package/src/ddl.ts +2 -1
  44. package/src/debug.ts +3 -2
  45. package/src/migrate.ts +3 -0
  46. package/src/process-jobs.ts +7 -2
  47. package/src/restsync.ts +3 -2
  48. package/src/runtime/calendar.ts +2 -1
  49. package/src/runtime/routes.ts +4 -1
  50. package/src/sampledata.ts +3 -3
  51. package/src/session.ts +18 -4
  52. package/src/websources.ts +3 -1
  53. package/src/workflow.ts +65 -9
  54. package/src/workspace-db.ts +166 -0
@@ -7,13 +7,13 @@ 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-10-12 (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-10-13 (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 | 0 | 0 | 0 | Page Designer with drag-and-drop and a code editor, wizards, search, where used, an Advisor, 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) |
16
+ | App Builder and development | 20 | 0 | 0 | 0 | Page Designer with drag-and-drop and a code editor, wizards, search, where used, an Advisor, 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
17
  | Regions | 23 | 0 | 0 | 0 | All everyday regions, a search region over search configurations and a URL region; sixteen 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 and saved reports; 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 | 13 | 0 | 0 | 0 | All common items, 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 | 17 | 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 |
@@ -22,12 +22,13 @@ Last reviewed: 2026-10-12 (sprint 59: the Page Designer's help pane, Quick edit
22
22
  | Globalization | 6 | 0 | 0 | 0 | One translated app like 26.1 with dynamic translations of table values; number format masks and automatic time zone; twenty-two built-in languages |
23
23
  | Data and integration | 12 | 0 | 0 | 2 | Generate DDL and schema comparison; `meta.data_export` and data export downloads (CSV, JSON, XML, HTML, Excel, PDF); e-mail through SMTP (password or OAuth2), Microsoft Graph, Amazon SES and HTTP APIs; REST APIs via PostgREST, REST data sources that write back and synchronise, web credentials with OAuth2 grants, CSV/XLSX/JSON/XML loading with saved definitions and unloading, SQL scripts and Quick SQL, report PDFs and document templates |
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
- | Administration | 8 | 1 | 0 | 0 | Application availability and Run only, automatic backups, user feedback; a developer toolbar with a session state viewer and debug per session; Workspaces that group applications and developers (not a tenant boundary); Top SQL per app; debug messages per request; an install/upgrade log |
26
- | **Total** | **136** | **1** | **0** | **3** | 140 APEX features compared: 97% available, 1% partial |
25
+ | Administration | 10 | 0 | 0 | 0 | An APEX-like sign-in with a workspace; 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
+ | **Total** | **141** | **0** | **0** | **3** | 144 APEX features compared: 98% available, none partial or missing |
27
27
 
28
28
  (Counts are of the rows in the tables below. A review on 2026-10-06 added 18 rows for APEX features that were
29
- not compared before, and one on 2026-10-12 added two more (property help, application availability), so the share
30
- available dropped without anything being removed.)
29
+ not compared before, one on 2026-10-12 added two more (property help, application availability), and one on
30
+ 2026-10-13 compared the builder's screens with APEX 26.1 and added four (App Gallery, application groups, cross
31
+ application reports, Manage Service), so the share available dropped without anything being removed.)
31
32
 
32
33
  ## App Builder and development
33
34
 
@@ -50,6 +51,9 @@ available dropped without anything being removed.)
50
51
  | Builder search, "where used" | ✅ | Search over every page and component (names, SQL, settings, help); "Used in" under items, pages, lists of values, schemes and report layouts. No search and replace |
51
52
  | AI assistant, pages from natural language, describe tables for LLMs (26.1) | ✅ | **App Builder AI** (administrators choose the builder's AI service): SQL Workshop → AI writes SQL from a question (shown in an editor, never run automatically), explains a query or an error, and describes tables and columns for LLMs (notes, optionally `COMMENT ON`, with AI drafts from names, types and keys only); **Create pages with AI** turns a description into proposed pages that the developer edits and confirms ([chapter 3](guide/03-builder.md)). The model never sees table rows |
52
53
  | Sample data source for development (26.1) | ✅ | SQL Workshop → **Sample Data** ([chapter 16](guide/16-files.md#sql-workshop--sample-data)): generators proposed per column from the catalog and column names (names, e-mail addresses, phones, companies, addresses, words and sentences, codes, number/date/time ranges, booleans, value lists from enums and CHECKs, sequences, foreign keys picking existing or newly inserted parent rows, values relative to another column, % nulls; identity/serial/generated columns skipped; unique and simple CHECK constraints respected), rows per table, a seed for repeatable data, preview (inserted and rolled back), insert in one transaction with parents first, download as SQL INSERTs or CSV, saved generator definitions |
54
+ | App Gallery: sample, starter and custom apps | ✅ | (sprint 61) The **App Gallery** in the builder ([chapter 3](guide/03-builder.md#app-gallery)): *Sample Apps* shipped with pgkiln (HR Demo, Tasks) installed by administrators; *Starter Apps* (Team Tasks, Contacts, Expense Claims, Asset Inventory, Event Registrations) shipped as blueprints, created after their review in the current workspace with a role and schema of their own; *Custom Apps*: the workspace's boilerplates. **Missing:** a gallery fed from a remote catalogue |
55
+ | Application groups | ✅ | (sprint 61) Workspace utilities → **Application groups**: a workspace's named groups, a group per application, a group filter and labels on the App Builder home ([chapter 3](guide/03-builder.md#application-groups)) |
56
+ | Cross application reports | ✅ | (sprint 61) In Workspace utilities' side column, over every application of the workspace: application attributes, build options, developer comments, authentication, authorization schemes, password items and theme summary |
53
57
 
54
58
  ## Regions
55
59
 
@@ -179,7 +183,7 @@ available dropped without anything being removed.)
179
183
 
180
184
  | APEX | pgkiln | Notes |
181
185
  |---|---|---|
182
- | SQL Workshop: SQL commands, object browser | ✅ | The object browser shows columns, RLS policies, grants, data and function source |
186
+ | SQL Workshop: SQL commands, object browser | ✅ | (sprint 61) A **home page** like APEX's: tiles, recently created tables, your recent SQL commands and the workspace's recent scripts, and the session's **default schema** (first in the search path of SQL Commands and Scripts). The object browser shows columns, RLS policies, grants, data and function source |
183
187
  | RESTful services (ORDS) | ✅ | [PostgREST](https://postgrest.org) next to pgkiln: `api` schema, the same RLS as the UI, per-app API role, tokens in the builder, a pre-request check, and **OAuth clients** (client credentials, like ORDS `oauth.create_client`) so tokens renew themselves |
184
188
  | REST handler editor, REST-enabled SQL | ✅ | **REST modules** in the builder: handlers (method, path with parameters, SQL as collection, item or statements, roles, public) served by pgkiln with bearer tokens and an OpenAPI description; plus PostgREST for schema-wide APIs. **Missing:** REST-enabled SQL (rarely desirable) |
185
189
  | SQL scripts, query builder, Quick SQL | ✅ | **SQL Scripts**: saved, upload/download, a result per statement, stop or continue on errors, optionally one transaction, run history. **Quick SQL** (a subset: tables, child tables, types, the main column directives, `/auditcols`, settings, views). A graphical **query builder**: tables as boxes on a canvas (dragged, placed where left), joins along foreign keys or drawn from column to column (inner or left), column functions with automatic `group by`, conditions, sort, open in SQL Commands; without JavaScript the same as forms ([chapter 3](guide/03-builder.md#sql-workshop)) |
@@ -209,15 +213,16 @@ available dropped without anything being removed.)
209
213
 
210
214
  | APEX | pgkiln | Notes |
211
215
  |---|---|---|
212
- | Developer accounts | ✅ | |
216
+ | Developer accounts, workspace sign-in | ✅ | (sprint 61) The builder's sign-in page like APEX's: workspace (optional; it becomes the current one, a wrong one answers like a wrong password), username, password with a Show button, *Remember workspace and username*, a link to Administration |
217
+ | Workspace message, environment banner, workspace utilization (Manage Service) | ✅ | (sprint 61) An **Administration** menu in the icon rail; administrators and workspace administrators set a **workspace message** (on the App Builder home) and an **environment banner** (a coloured label on every builder page of the workspace), and see **workspace utilization** (applications, pages, page views, users, static files, schema storage) ([chapter 3](guide/03-builder.md#workspace-message-and-environment-banner)). **Missing:** extension links, workspace-level preferences such as disabling the SQL Workshop |
213
218
  | Instance administration, install/upgrade logs (26.1) | ✅ | Versioned migrations (`npm run db:migrate`), every run logged; Workspace utilities → **Installation** (administrators): server version, install and upgrade runs with errors, applied migrations, and warnings for migrations the database misses or the server doesn't know ([chapter 3](guide/03-builder.md)). Workspace utilities → **Instance settings**: session length and sign-in throttling (stored in the database, over the environment variables) and an overview of the server's configuration without secrets; a server whose database lacks migrations says so (503) or applies them (`MIGRATE_ON_START`). Other settings stay environment variables |
214
219
  | Debug messages | ✅ | Debug levels 1–9 per app; `meta.debug(level, text)` and `meta.debug_enabled(level)` from application SQL (APEX_DEBUG); timed entries per request (page steps, regions, processes, branches, errors, SQL notices); Activity → **Debug messages** viewer per page view with filters and the slowest step highlighted; retention 1–90 days; password item values are never recorded ([chapter 6](guide/06-processing.md)). (sprint 50) Debug for **one session** from the developer toolbar, the application staying out of debug. **Missing:** debug entries for background jobs and REST requests |
215
- | Developer toolbar, session state viewer | ✅ | (sprint 50) Developers signed in to the builder see a toolbar on the pages of their applications in the same browser: App Builder, the application, **Edit page** (Page Designer), **Session** (the session state viewer: user, roles, session, language, time zone, debug level, this page's items, application items and other pages' items; passwords never shown; clear the page's items) **Quick edit** (sprint 59: click a region, item or button to open it in the Page Designer) and **Debug** for this session only. A separate random token (cookie path `/a`, HttpOnly) of a live builder session of a developer of the application's workspace ([chapter 3](guide/03-builder.md#developer-toolbar)). **Missing:** Quick Edit (pick a component on the page), Theme Roller from the page |
220
+ | Developer toolbar, session state viewer | ✅ | (sprint 50) Developers signed in to the builder see a toolbar on the pages of their applications in the same browser: App Builder, the application, **Edit page** (Page Designer), **Session** (the session state viewer: user, roles, session, language, time zone, debug level, this page's items, application items and other pages' items; passwords never shown; clear the page's items) **Quick edit** (sprint 59: click a region, item or button to open it in the Page Designer) and **Debug** for this session only. A separate random token (cookie path `/a`, HttpOnly) of a live builder session of a developer of the application's workspace ([chapter 3](guide/03-builder.md#developer-toolbar)). **Missing:** Theme Roller from the page |
216
221
  | Feedback (users send feedback from a page, developers answer) | ✅ | (sprint 51) With *Users can send feedback* on, the navigation bar's **Feedback** link opens a page for a comment, idea or problem about the page (optional rating), with the user's earlier feedback and the developers' answers; developers read, filter, set a status and answer under Application → Feedback ([chapter 3](guide/03-builder.md#feedback)). No screenshots, no e-mail to developers |
217
222
  | Automatic application backups, page groups | ✅ | (sprint 51) **Backups**: before every import that replaces an application (CLI, MCP, working copy merge, restore), daily when it changed, and by hand; the newest 25 (configurable) are kept; download and restore from the builder ([chapter 3](guide/03-builder.md#backups)). (sprint 58) **Page groups**: Shared Components → Page groups, a page's *Page group*, the page list by group with a filter ([chapter 3](guide/03-builder.md#page-groups)) |
218
223
  | Application availability (Available, Developers only, Restricted access, Unavailable; build status *Run only*) | ✅ | (sprint 51) Available, available to developers only (a builder session in the same browser), restricted to named users, or unavailable with a message, for pages, file downloads, REST modules and PostgREST; build status **Run only** refuses builder changes as if the application were locked, while `pgkiln import --replace` still deploys. Installation settings: not exported, kept by an import ([chapter 3](guide/03-builder.md#availability-and-build-status)) |
219
224
  | Monitoring (top SQL) | ✅ | Activity per app; Top SQL per app's database role from `pg_stat_statements` (sortable, resettable) |
220
- | Workspaces (multi-tenant) | 🟡 | Workspaces group applications and developers: the builder shows and opens only the applications of a developer's workspaces (administrators: all), a current workspace with a switcher, new and imported applications go into it, administrators add workspaces, choose their developers and move applications ([chapter 3](guide/03-builder.md#workspaces)). **Missing:** isolation between tenants (the SQL Workshop and application code run with installation-wide rights; use separate installations), per-workspace user accounts, schemas and workspace administrators |
225
+ | Workspaces (multi-tenant) | ✅ | Workspaces group applications and developers: the builder shows and opens only the applications of a developer's workspaces (administrators: all), a current workspace with a switcher, new and imported applications go into it, administrators add workspaces, choose their developers and move applications ([chapter 3](guide/03-builder.md#workspaces)). (sprint 60) **Isolated workspaces** are a tenant boundary: the applications run on a PostgreSQL login of the workspace's own and its developers' SQL Workshop on another, with row-level security on pgkiln's tables, so SQL that resets its role can't reach other workspaces' applications, data, sessions or accounts; **workspace database roles** (APEX: workspace schemas) assigned by administrators; **workspace administrators** who manage their workspace's developers; SQL scripts, blueprints and sample data per workspace ([isolated workspaces](guide/03-builder.md#isolated-workspaces)). **Missing:** user directories per workspace (accounts are installation-wide, visible to the workspaces whose applications they use), developers created by a workspace administrator |
221
226
 
222
227
  ## Different on purpose
223
228
 
@@ -291,7 +296,7 @@ report filters, App Builder AI and blueprints.
291
296
  translations, display image and geocoded address items~~ (done in sprint 53).
292
297
  8. ~~Interactive grid views (single row view, chart view, group by)~~ (done in sprint 54).
293
298
  9. ~~Schema comparison and DDL generation in SQL Workshop~~ (done in sprint 56): no ❌ rows left.
294
- 10. ~~Region templates~~ (done in sprint 57); ~~page groups~~ (sprint 58); ~~the help pane and Quick edit~~ (sprint 59); then the last 🟡 row: workspace isolation. (2026-10-12, owner: more built-in runtime languages are not planned; the row was removed. Other languages come from an application's own text messages.)
299
+ 10. ~~Region templates~~ (done in sprint 57); ~~page groups~~ (sprint 58); ~~the help pane and Quick edit~~ (sprint 59); ~~then the last 🟡 row: workspace isolation~~ (done in sprint 60: no 🟡 rows left). (2026-10-12, owner: more built-in runtime languages are not planned; the row was removed. Other languages come from an application's own text messages.)
295
300
 
296
301
  Sources: [APEX 26.1 new features](https://docs.oracle.com/en/database/oracle/apex/26.1/htmrn/new-features.html),
297
302
  [What's new in APEX 24.2](https://apex.oracle.com/en/platform/features/whats-new-242/),
@@ -6,7 +6,16 @@ The builder lives at `/builder`. Everything it does is also possible in SQL (see
6
6
  ## Signing in and developer accounts
7
7
 
8
8
  Sign in with a developer account. The first one is `admin` / `admin`, and a red banner reminds you
9
- to change it. On the **Developers** page you can:
9
+ to change it.
10
+
11
+ The sign-in page (`/builder/login`) is laid out like APEX's: **Workspace** (optional), **Username** and
12
+ **Password** (with a *Show* button). A workspace you name must be one of yours (administrators: any); it becomes the
13
+ current one, and a wrong one gets the same answer as a wrong password. Left empty, you continue in your first
14
+ workspace and switch in your account menu. **Remember workspace and username** keeps both on this device (an
15
+ HttpOnly cookie for `/builder`, no password); signing in without the tick forgets them. *Administration* under the
16
+ form signs in and opens Workspace utilities.
17
+
18
+ On the **Developers** page you can:
10
19
 
11
20
  - change your own password (minimum 8 characters; other builder sessions of yours end);
12
21
  - as an **administrator**: add developer accounts (developers or administrators), make a developer
@@ -33,21 +42,89 @@ department. Every installation has the **Default** workspace, which holds the ap
33
42
  - **New applications** (Create, from a file, pasted data, existing tables, a blueprint) and **imports** go into the
34
43
  current workspace; a working copy stays in its main application's workspace. Imports made with the command line
35
44
  (`pgkiln import`) go into Default. Exports don't carry the workspace.
45
+ - **Workspace utilities**: tiles for users and sign-in, application groups, the App Gallery, developers, the SQL
46
+ Workshop and the dashboard (and, for administrators, instance settings, workspaces, AI and mail services and the
47
+ installation), with **Cross Application Reports** in the side column (APEX: Cross Application Reports), each over
48
+ every application of the current workspace: *Application attributes* (type, sign-in, availability, build status,
49
+ debug level, language, database role), *Build options*, *Developer comments*, *Authentication* (sign-in methods,
50
+ identity providers, LDAP, access, the login page, Forgot password), *Authorization schemes*, *Password items* and
51
+ *Theme summary*.
36
52
  - Workspace utilities → **Workspaces** (administrators): add a workspace (you become its first developer), rename it,
37
53
  choose its developers, move applications to another workspace and delete an empty workspace.
38
-
39
- **Workspaces are not a security boundary between developers who write SQL.** The SQL Workshop runs as pgkiln's owner,
40
- and application code (processes, regions, validations) runs on the runtime connection, from which a developer's SQL
41
- can reach other applications' data and metadata. User accounts, identity providers, LDAP directories and AI services
42
- also stay installation-wide. Use workspaces to keep teams' applications apart in the builder; give tenants who must
43
- not see each other's applications or data **separate installations** (databases).
54
+ - **Workspace administrators**: on a workspace's page, administrators tick which of its developers administer it. A
55
+ workspace administrator opens the page from Workspace utilities (the card names the current workspace) and changes
56
+ its name, description and developers; isolation, database roles, moving applications and deleting stay with the
57
+ installation's administrators.
58
+
59
+ A **shared** workspace (the default) is not a security boundary between developers who write SQL: its SQL Workshop
60
+ runs as pgkiln's owner, and its application code (processes, regions, validations) runs on the shared runtime
61
+ connection, from which SQL can reach other shared applications' data and metadata. Make a workspace **isolated** when
62
+ its developers must not reach other teams' applications or data.
63
+
64
+ ### Workspace message and environment banner
65
+
66
+ Administrators and the workspace's administrators set them on the workspace's page (*Manage service*, or the
67
+ Administration menu → *Workspace message and environment banner*; APEX: Define Workspace Message, Define Environment
68
+ Banner): a **message** (plain text, up to 2000 characters) shown to the workspace's developers on the App Builder home,
69
+ and an **environment banner**: a label of up to 40 characters in one of eight colours, shown at the top of every
70
+ builder page while the workspace is current.
71
+
72
+ ### Workspace utilization
73
+
74
+ Administration menu → **Workspace utilization** (`/builder/workspaces/<id>/utilization`; APEX: Workspace
75
+ Utilization), for administrators and the workspace's administrators: the number of applications, pages, developers,
76
+ page views of the last 30 days and SQL scripts; per application its pages, regions, items, page views, users and the
77
+ size of its static files; and the schemas the workspace's database roles use with their tables and storage.
78
+
79
+ ### Isolated workspaces
80
+
81
+ On a workspace's page an administrator chooses **Isolate this workspace** (Workspace utilities → Workspaces → the
82
+ workspace → *Isolation*). It needs `RUNTIME_DATABASE_URL` (applications don't run on the owner connection) and
83
+ `PGKILN_SECRET_KEY` (the passwords of the workspace's logins are derived from it; nothing is stored). Then:
84
+
85
+ - **Two PostgreSQL logins of its own**: `pgkiln_ws<id>_run_<suffix>` runs its applications (pages, processes, REST
86
+ handlers, automations, workflows, background processes, REST synchronisation); `pgkiln_ws<id>_dev_<suffix>` runs its
87
+ developers' SQL: SQL Commands, SQL Scripts, Quick SQL, Load and Unload Data, Sample Data, DDL and Compare, the
88
+ Advisor, code checks and document previews. SQL that runs `RESET ROLE` (or `set_config('role', …)`) only gets back to
89
+ that login, which can use the workspace's database roles and nothing else.
90
+ - **The workspace's database roles** (APEX: workspace schemas): isolating gives the workspace the roles its
91
+ applications run as; administrators add or remove roles on its page. Its applications can run only as these roles,
92
+ so an import or a changed *Database role* setting that names another role is refused. A role belongs to one
93
+ workspace; a superuser, a role that creates roles or bypasses row-level security, and pgkiln's own roles can't
94
+ belong to one. A **new application** in an isolated workspace gets a new role and a new schema (owned by that role),
95
+ or a schema of one of the workspace's roles. The developer login starts as the first role (alphabetically), so the
96
+ tables a developer creates in the SQL Workshop belong to an application role; `set role` picks another of them.
97
+ - **pgkiln's own tables** (`meta`) show each login its own workspace's applications, pages, sessions and accounts
98
+ (row-level security), and the shared runtime connection no longer sees the isolated workspace's.
99
+ `meta.app_id()` refuses another workspace's application, so `meta.web_request`, `meta.ai_generate`, mail, push
100
+ and `meta.page_url` can't act for it. The developer login has no rights in `meta`.
101
+ - **The SQL Workshop's saved work** (scripts and their runs, blueprints, sample data generators) belongs to the
102
+ workspace it was made in, also in shared workspaces; data load definitions are listed for the current workspace's
103
+ applications.
104
+ - **Administrators keep the owner** in the SQL Workshop, and a developer who also belongs to a shared workspace has the
105
+ owner's rights there: make the developers of an isolated workspace members of that workspace only.
106
+ - A workflow step's SQL runs on the workspace's login and commits just before the workflow's own state, so after a
107
+ crash between the two a step can run again.
108
+
109
+ Still installation-wide: user accounts (an account with access to an isolated workspace's application is visible only
110
+ to that workspace, other accounts to every workspace), identity providers, LDAP directories, mail and AI services, the
111
+ REST API through PostgREST (use REST modules for isolated applications), and the database catalog (any login can read
112
+ table and function definitions in `pg_catalog`, not their rows). Every login of every workspace counts towards the
113
+ server's `max_connections`: each isolated workspace opens at most `PGKILN_WORKSPACE_POOL_SIZE` (5) connections per
114
+ login and server process.
115
+
116
+ **Make shared** undoes it: the roles go back to the shared runtime connection and the workspace's logins can no
117
+ longer sign in. Delete a workspace only when it is shared and empty; its logins are dropped with it.
44
118
 
45
119
  ## The builder window
46
120
 
47
121
  Every builder page has the same frame, modelled on an IDE:
48
122
 
49
- - **The icon rail** on the left: App Builder, SQL Workshop, Users, Developers, **Search** (on the
50
- pages of an application), Help, and your account menu (the circle with your initials) with the
123
+ - **The icon rail** on the left: App Builder, SQL Workshop, [App Gallery](#app-gallery), **Search** (on the
124
+ pages of an application); at the bottom the **Administration** menu (Workspace utilities; for administrators of the
125
+ current workspace *Manage service*: [workspace message and environment banner](#workspace-message-and-environment-banner),
126
+ [workspace utilization](#workspace-utilization) and the workspace's page; Manage users and groups, Developers,
127
+ Monitor activity, Change my password), Help, and your account menu (the circle with your initials) with the
51
128
  **builder theme** (*Dark*, the default; *Light*; or *System*, which follows the operating system),
52
129
  Change password and Sign out. The theme is remembered on this device, also after signing out;
53
130
  it only changes the builder, not your applications.
@@ -58,6 +135,8 @@ Every builder page has the same frame, modelled on an IDE:
58
135
 
59
136
  - **The status bar** at the bottom: who is signed in, the current [workspace](#workspaces), the database, the
60
137
  builder's language and the pgkiln version.
138
+ - **An environment banner** (when the current workspace has one) across the top: a coloured band with a label such as
139
+ DEVELOPMENT or TEST, so nobody mistakes one environment for another.
61
140
 
62
141
  On phones the rail gets narrower and the breadcrumb shows only the current page.
63
142
 
@@ -77,6 +156,34 @@ The home page is laid out like APEX's App Builder:
77
156
  **Actions**, to sort. The view and the sort are remembered until you sign out.
78
157
  - **A side column** (on the right on wide screens, below the list otherwise): About, **Recent** (the
79
158
  applications you opened last) and Tasks.
159
+ - **The workspace message**, when the workspace has one, above the tiles.
160
+ - **Application groups**: when the workspace has [groups](#application-groups), a select next to the views shows one
161
+ group; each application shows its group.
162
+
163
+ ### Application groups
164
+
165
+ Workspace utilities → **Application groups** (`/builder/app-groups`; APEX: Application Groups) organises the
166
+ applications of the current workspace into named groups: add, rename and delete groups, and choose each
167
+ application's group. The App Builder home then filters by group. Groups belong to the workspace, not to the
168
+ applications: they are not exported, an in-place import keeps them, and an application moved to another workspace
169
+ leaves its group. Every developer of the workspace manages them.
170
+
171
+ ## App Gallery
172
+
173
+ The **App Gallery** (the cube in the icon rail, `/builder/gallery`; APEX: App Gallery) has three tabs:
174
+
175
+ - **Sample Apps**: applications shipped with pgkiln (HR Demo, Tasks) with their own schema, data and **demo accounts
176
+ with known passwords**, so install them on a development or demo instance only. Administrators install them (the
177
+ same scripts as `pgkiln migrate --example hr`); they go into the current workspace. An installed one shows Run and
178
+ Edit.
179
+ - **Starter Apps**: small applications (Team Tasks, Contacts, Expense Claims, Asset Inventory, Event Registrations)
180
+ shipped as [blueprints](#creating-an-application-from-a-blueprint). **Install** opens the blueprint's review:
181
+ nothing is created before you confirm, the application gets a new role and schema in the current workspace, and you
182
+ may edit the blueprint first (another alias, more columns). Any developer installs them.
183
+ - **Custom Apps**: the workspace's boilerplate applications (Application type *Boilerplate*): *Create from it* opens
184
+ Create with that boilerplate chosen.
185
+
186
+ The list is `examples/gallery/gallery.json`; add your own starters there as blueprint files.
80
187
 
81
188
  ### Creating an application
82
189
 
@@ -907,14 +1014,21 @@ may use), a form to **issue a token** for an account, and `curl` examples. See
907
1014
 
908
1015
  ## SQL Workshop
909
1016
 
910
- - **SQL Commands**: run any SQL as the **owner connection**, not as an application role. Multiple
1017
+ The SQL Workshop opens on its **home** (`/builder/sql`; APEX: the SQL Workshop home): tiles for the Object Browser,
1018
+ SQL Commands, SQL Scripts, the utilities and Quick SQL; **Recently created tables** (the newest tables you can read:
1019
+ PostgreSQL keeps no creation time, so object ids decide), your **recent SQL commands** (click one to open it in SQL
1020
+ Commands; other developers' are never shown) and the workspace's **recent SQL scripts**. The side column sets the
1021
+ session's **schema** (APEX: the default schema): it goes first in the search path of SQL Commands and SQL Scripts until
1022
+ you sign out. Tasks link to Quick SQL, blueprints, table descriptions, sample data and Generate DDL.
1023
+
1024
+ - **SQL Commands** (`/builder/sql/commands`): run any SQL as the **owner connection**, not as an application role. Multiple
911
1025
  statements are allowed; the result of the last one is shown (up to 500 rows). Press
912
1026
  **Ctrl/Cmd + Enter** to run. The [code editor](#the-code-editor) suggests every schema, table,
913
1027
  column and function the owner sees.
914
1028
  - **Object Browser**: tables, views and functions per schema. For a table you see columns, types
915
1029
  and defaults, **row level security policies**, **grants** and the first 25 rows; for a
916
1030
  function, its source.
917
- - **SQL Scripts**: saved scripts, shared by all developers. Create one in the editor, upload a
1031
+ - **SQL Scripts**: saved scripts, shared by the developers of the workspace. Create one in the editor, upload a
918
1032
  `.sql` file (UTF-8, up to 5 MB) or save one from Quick SQL; download it again as `.sql`. **Run**
919
1033
  splits the script into statements at semicolons (outside strings, comments, quoted identifiers,
920
1034
  `$$` bodies and `BEGIN ATOMIC … END`) and runs them one after another, with a **result per
@@ -32,7 +32,9 @@ src/
32
32
  read, import), files.ts (directories, zip), diff.ts, replace.ts (import --replace in place),
33
33
  mcp.ts (`pgkiln mcp`: the MCP server for AI coding agents, chapter 20)
34
34
  app.ts / server.ts Fastify setup / entry point
35
- db.ts the two pools, appTx() (SET LOCAL ROLE + pgkiln.* settings, NOTICEs to the debug log), savepoints
35
+ 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
36
+ workspace-db.ts isolated workspaces (090): the isolated applications (cached 5 s), a pool per workspace login (passwords from
37
+ PGKILN_SECRET_KEY), runtimeForApp/runtimeForAlias, withAppDb, devDbForApp; app.ts scopes /a/:alias requests
36
38
  security.ts URL checksums, password policy, security headers (CSP nonce), throttling limits
37
39
  ddl.ts Generate DDL and Schema Comparison: readSchema (catalog → one DDL per object, unqualified), ddlScript (order), compare, changeScript
38
40
  static-version.ts the version of app.css, app.js, icons.svg and sw.js (?v= in their URLs, the service worker version): content hash, looked at again when a file changes
@@ -231,8 +233,13 @@ src/
231
233
  templates.ts template components: preview, plug-in export/import, region settings, report column templates
232
234
  code-editor.ts code fields (data-code marks), /builder/code/completions (scoped to the app's role), /builder/code/check
233
235
  instance.ts Workspace utilities → Instance settings (src/instance.ts: session and sign-in settings, configuration overview)
236
+ gallery.ts the App Gallery (sprint 61): examples/gallery/gallery.json, sample apps (administrators, migrate --example),
237
+ starter apps (blueprints → openBlueprint's review), custom apps (the workspace's boilerplates)
238
+ app-groups.ts application groups (092): a workspace's groups, a group per application (the App Builder home filters)
239
+ cross-app.ts Cross Application Reports (sprint 61): REPORTS (one SQL per topic over the workspace's applications)
234
240
  workspaces.ts workspaces (064): loadWorkspaces/appAllowed (checked in ui.ts developer() for every /apps/:id and /pages/:pid
235
- request), the current workspace (session state __WS), placeApp, the switcher, Workspace utilities → Workspaces
241
+ request), the current workspace (session state __WS), placeApp, the switcher, Workspace utilities → Workspaces;
242
+ (090) isolation and the workspace's database roles, workshopDb (the SQL Workshop's connection)
236
243
  locks.ts page and application locks (blockingLock, checked in ui.ts developer() for every builder POST; appOfPath), developer comments, administrators
237
244
  blueprints.ts Create → From a blueprint: list, JSON editor, AI draft, review (signed with the session), create in one transaction
238
245
  ai-builder.ts App Builder AI (migration 062): the builder's AI service (meta.builder_ai), SQL Workshop → AI (SQL from a
@@ -290,6 +297,9 @@ test/
290
297
  page-wizards.test.ts create page wizards: catalog defaults, every page type generated and rendered, refusals, the builder steps
291
298
  theme-styles.test.ts Theme Roller style variants (checks, CSS, user choice per app, builder page), template options, base style Iris
292
299
  workspaces.test.ts workspaces (064): Default, administrators' pages, current workspace, refused apps, imports and copies
300
+ gallery.test.ts the App Gallery: every starter created from its review with all its pages rendering; sample apps (admins)
301
+ builder-apex-screens.test.ts sprint 61: sign-in with a workspace, message and banner, utilization, SQL Workshop home, groups, reports
302
+ workspace-isolation.test.ts isolated workspaces (090): logins, RLS on meta, app_id, roles, SQL Workshop, scripts, imports
293
303
  ai.test.ts AI services: Generate text with AI (text, structured outputs, errors, limits, keys), its dynamic action,
294
304
  meta.ai_generate, the providers, HR page 37; against ai-mock.ts (no real API calls)
295
305
  ai-assistant.test.ts AI assistant region (context, tools as the app role, writes, REST, histories, limits, sessions), OpenAI,
@@ -0,0 +1,13 @@
1
+ # App Gallery
2
+
3
+ The builder's **App Gallery** (`/builder/gallery`) lists what `gallery.json` names:
4
+
5
+ - `samples`: applications shipped with pgkiln, installed by an administrator: `example` names a directory of
6
+ `examples/` (installed like `pgkiln migrate --example <name>`), `file` a single SQL file in `examples/`.
7
+ `alias` is the application they create (an installed one shows Run and Edit).
8
+ - `starters`: [blueprints](../../docs/guide/03-builder.md#creating-an-application-from-a-blueprint) in `starters/`.
9
+ Install opens the blueprint's review; the developer creates the application from it.
10
+
11
+ Add a starter by writing a blueprint file in `starters/` and an entry in `gallery.json` (a key of lower-case
12
+ letters, digits and `-`, a title, an [icon name](../../docs/guide/09-reference.md#icons) and a description).
13
+ `test/gallery.test.ts` creates every starter and opens all its pages.
@@ -0,0 +1,20 @@
1
+ {
2
+ "samples": [
3
+ {"key": "hr", "title": "HR Demo", "alias": "hr", "icon": "briefcase", "example": "hr",
4
+ "description": "The showcase of pgkiln on the classic EMP and DEPT tables: reports and forms, an interactive grid, charts, maps, a calendar, faceted search, approvals and workflows, documents, a REST API, translations and a Progressive Web App. Demo accounts king, blake, jones, allen, scott and demo, with the username as password."},
5
+ {"key": "tasks", "title": "Tasks", "alias": "tasks", "icon": "check", "file": "tasks-app.sql",
6
+ "description": "The tutorial application: a personal task list where every user sees only their own tasks (row level security), with a business rule in PL/pgSQL behind a button. Demo accounts ann and bob (password ann-password, bob-password)."}
7
+ ],
8
+ "starters": [
9
+ {"key": "team-tasks", "title": "Team Tasks", "icon": "layout-grid", "file": "starters/team-tasks.json",
10
+ "description": "Projects and their tasks with status, priority, assignee and due date: reports and forms, a faceted search, a calendar of due dates and a dashboard."},
11
+ {"key": "contacts", "title": "Contacts", "icon": "contact", "file": "starters/contacts.json",
12
+ "description": "Companies, their contacts and the interactions with them: contact cards, a faceted search, reports and forms and a dashboard."},
13
+ {"key": "expense-claims", "title": "Expense Claims", "icon": "receipt", "file": "starters/expense-claims.json",
14
+ "description": "Claims with their expenses in a master-detail page, an editable grid, a chart by category and a dashboard."},
15
+ {"key": "asset-inventory", "title": "Asset Inventory", "icon": "package", "file": "starters/asset-inventory.json",
16
+ "description": "Assets with their tags, locations, owners and purchase data: a faceted search, an editable grid of locations, a chart by category and a dashboard."},
17
+ {"key": "event-registrations", "title": "Event Registrations", "icon": "calendar-days", "file": "starters/event-registrations.json",
18
+ "description": "Events in a calendar and the people who registered for them, with reports, forms and a dashboard."}
19
+ ]
20
+ }
@@ -0,0 +1,30 @@
1
+ {"blueprint": 1, "name": "Asset Inventory", "alias": "asset-inventory", "schema": "asset_inventory",
2
+ "tables": [
3
+ {"name": "location", "label": "Locations", "columns": [
4
+ {"name": "name", "type": "text", "required": true, "unique": true},
5
+ {"name": "building", "type": "text"},
6
+ {"name": "floor", "type": "integer"}]},
7
+ {"name": "asset", "label": "Assets", "columns": [
8
+ {"name": "location_id", "references": "location"},
9
+ {"name": "tag", "type": "text", "required": true, "unique": true},
10
+ {"name": "name", "type": "text", "required": true},
11
+ {"name": "category", "type": "text", "required": true, "values": ["Laptop", "Monitor", "Phone", "Furniture", "Vehicle", "Other"]},
12
+ {"name": "assigned_to", "type": "text"},
13
+ {"name": "purchased_on", "type": "date"},
14
+ {"name": "price", "type": "number"},
15
+ {"name": "in_use", "type": "boolean"}]}],
16
+ "pages": [
17
+ {"type": "report_form", "table": "asset", "page": 2, "form_page": 3, "label": "Assets", "icon": "list"},
18
+ {"type": "facets", "table": "asset", "page": 4, "label": "Find assets", "icon": "filter"},
19
+ {"type": "grid", "table": "location", "page": 5, "label": "Locations", "icon": "map"},
20
+ {"type": "chart", "table": "asset", "page": 6, "label": "By category", "icon": "chart"}],
21
+ "dashboard": true,
22
+ "sample_data": [
23
+ {"table": "location", "columns": ["id", "name", "building", "floor"], "rows": [
24
+ [1, "Head office 2nd floor", "Main", 2], [2, "Head office 3rd floor", "Main", 3], [3, "Warehouse", "North", 0]]},
25
+ {"table": "asset", "columns": ["location_id", "tag", "name", "category", "assigned_to", "purchased_on", "price", "in_use"], "rows": [
26
+ [1, "A-0001", "ThinkPad T14", "Laptop", "Ann", "2025-03-10", 1249.00, true],
27
+ [1, "A-0002", "Dell 27\" monitor", "Monitor", "Ann", "2025-03-10", 329.00, true],
28
+ [2, "A-0003", "MacBook Air", "Laptop", "Ben", "2024-11-02", 1399.00, true],
29
+ [2, "A-0004", "Standing desk", "Furniture", null, "2023-06-15", 610.00, false],
30
+ [3, "A-0005", "Delivery van", "Vehicle", "Logistics", "2022-01-20", 32500.00, true]]}]}
@@ -0,0 +1,41 @@
1
+ {"blueprint": 1, "name": "Contacts", "alias": "contacts", "schema": "contacts",
2
+ "tables": [
3
+ {"name": "company", "label": "Companies", "columns": [
4
+ {"name": "name", "type": "text", "required": true, "unique": true},
5
+ {"name": "industry", "type": "text", "values": ["Retail", "Manufacturing", "Services", "Public sector", "Technology"]},
6
+ {"name": "city", "type": "text"},
7
+ {"name": "website", "type": "text"}]},
8
+ {"name": "contact", "label": "Contacts", "columns": [
9
+ {"name": "company_id", "references": "company"},
10
+ {"name": "first_name", "type": "text", "required": true},
11
+ {"name": "last_name", "type": "text", "required": true},
12
+ {"name": "email", "type": "text", "unique": true},
13
+ {"name": "phone", "type": "text"},
14
+ {"name": "role", "type": "text"},
15
+ {"name": "status", "type": "text", "required": true, "values": ["Lead", "Customer", "Former customer"]}]},
16
+ {"name": "interaction", "label": "Interactions", "columns": [
17
+ {"name": "contact_id", "references": "contact", "required": true},
18
+ {"name": "happened_on", "type": "date", "required": true},
19
+ {"name": "kind", "type": "text", "required": true, "values": ["Call", "Meeting", "E-mail", "Visit"]},
20
+ {"name": "notes", "type": "text"}]}],
21
+ "pages": [
22
+ {"type": "report_form", "table": "company", "page": 2, "form_page": 3, "label": "Companies", "icon": "building"},
23
+ {"type": "cards", "table": "contact", "page": 4, "label": "Contacts", "icon": "users"},
24
+ {"type": "report_form", "table": "contact", "page": 5, "form_page": 6, "label": "Contact list", "icon": "list"},
25
+ {"type": "facets", "table": "contact", "page": 7, "label": "Find contacts", "icon": "filter"},
26
+ {"type": "report_form", "table": "interaction", "page": 8, "form_page": 9, "label": "Interactions", "icon": "activity"}],
27
+ "dashboard": true,
28
+ "sample_data": [
29
+ {"table": "company", "columns": ["id", "name", "industry", "city", "website"], "rows": [
30
+ [1, "Northwind Traders", "Retail", "Utrecht", "https://northwind.example"],
31
+ [2, "Contoso Machines", "Manufacturing", "Eindhoven", "https://contoso.example"],
32
+ [3, "Fabrikam Services", "Services", "Rotterdam", null]]},
33
+ {"table": "contact", "columns": ["id", "company_id", "first_name", "last_name", "email", "phone", "role", "status"], "rows": [
34
+ [1, 1, "Anna", "de Vries", "anna@northwind.example", "+31 30 123 4567", "Buyer", "Customer"],
35
+ [2, 1, "Bram", "Jansen", "bram@northwind.example", null, "Director", "Customer"],
36
+ [3, 2, "Chloe", "Bakker", "chloe@contoso.example", "+31 40 765 4321", "Engineer", "Lead"],
37
+ [4, 3, "Daan", "Visser", "daan@fabrikam.example", null, "Owner", "Former customer"]]},
38
+ {"table": "interaction", "columns": ["contact_id", "happened_on", "kind", "notes"], "rows": [
39
+ [1, "2026-09-12", "Meeting", "Yearly review; wants a quote for spring."],
40
+ [1, "2026-10-02", "E-mail", "Sent the quote."],
41
+ [3, "2026-10-05", "Call", "Interested in a demo."]]}]}
@@ -0,0 +1,29 @@
1
+ {"blueprint": 1, "name": "Event Registrations", "alias": "event-registrations", "schema": "event_registrations",
2
+ "authentication": "app_users",
3
+ "tables": [
4
+ {"name": "event", "label": "Events", "columns": [
5
+ {"name": "title", "type": "text", "required": true},
6
+ {"name": "starts_at", "type": "timestamp", "required": true},
7
+ {"name": "venue", "type": "text"},
8
+ {"name": "capacity", "type": "integer"},
9
+ {"name": "status", "type": "text", "required": true, "values": ["Draft", "Open", "Full", "Closed"]}]},
10
+ {"name": "registration", "label": "Registrations", "columns": [
11
+ {"name": "event_id", "references": "event", "required": true},
12
+ {"name": "attendee", "type": "text", "required": true},
13
+ {"name": "email", "type": "text", "required": true},
14
+ {"name": "registered_on", "type": "date", "required": true},
15
+ {"name": "attended", "type": "boolean"}]}],
16
+ "pages": [
17
+ {"type": "calendar", "table": "event", "page": 2, "label": "Calendar", "icon": "calendar"},
18
+ {"type": "report_form", "table": "event", "page": 3, "form_page": 4, "label": "Events", "icon": "list"},
19
+ {"type": "report_form", "table": "registration", "page": 5, "form_page": 6, "label": "Registrations", "icon": "users"}],
20
+ "dashboard": true,
21
+ "sample_data": [
22
+ {"table": "event", "columns": ["id", "title", "starts_at", "venue", "capacity", "status"], "rows": [
23
+ [1, "PostgreSQL meetup", "2026-11-12 18:30", "Utrecht", 60, "Open"],
24
+ [2, "Low-code workshop", "2026-11-26 09:30", "Amsterdam", 20, "Full"],
25
+ [3, "Year-end drinks", "2026-12-18 17:00", "Head office", 120, "Draft"]]},
26
+ {"table": "registration", "columns": ["event_id", "attendee", "email", "registered_on", "attended"], "rows": [
27
+ [1, "Anna de Vries", "anna@example.com", "2026-10-01", null],
28
+ [1, "Bram Jansen", "bram@example.com", "2026-10-03", null],
29
+ [2, "Chloe Bakker", "chloe@example.com", "2026-09-28", null]]}]}
@@ -0,0 +1,32 @@
1
+ {"blueprint": 1, "name": "Expense Claims", "alias": "expense-claims", "schema": "expense_claims",
2
+ "tables": [
3
+ {"name": "claim", "label": "Claims", "columns": [
4
+ {"name": "employee", "type": "text", "required": true},
5
+ {"name": "purpose", "type": "text", "required": true},
6
+ {"name": "submitted_on", "type": "date", "required": true},
7
+ {"name": "status", "type": "text", "required": true, "values": ["Draft", "Submitted", "Approved", "Rejected", "Paid"]},
8
+ {"name": "approver", "type": "text"}]},
9
+ {"name": "expense", "label": "Expenses", "columns": [
10
+ {"name": "claim_id", "references": "claim", "required": true},
11
+ {"name": "spent_on", "type": "date", "required": true},
12
+ {"name": "category", "type": "text", "required": true, "values": ["Travel", "Lodging", "Meals", "Supplies", "Other"]},
13
+ {"name": "description", "type": "text"},
14
+ {"name": "amount", "type": "number", "required": true}]}],
15
+ "pages": [
16
+ {"type": "master_detail", "table": "claim", "page": 2, "label": "Claims", "icon": "file"},
17
+ {"type": "report_form", "table": "expense", "page": 3, "form_page": 4, "label": "Expenses", "icon": "list"},
18
+ {"type": "chart", "table": "expense", "page": 5, "label": "By category", "icon": "chart"},
19
+ {"type": "grid", "table": "claim", "page": 6, "label": "Edit claims", "icon": "grid"}],
20
+ "dashboard": true,
21
+ "sample_data": [
22
+ {"table": "claim", "columns": ["id", "employee", "purpose", "submitted_on", "status", "approver"], "rows": [
23
+ [1, "Ann", "Customer visit Hamburg", "2026-09-30", "Approved", "Ben"],
24
+ [2, "Cleo", "Conference in Lisbon", "2026-10-06", "Submitted", null],
25
+ [3, "Dana", "Office supplies", "2026-10-08", "Draft", null]]},
26
+ {"table": "expense", "columns": ["claim_id", "spent_on", "category", "description", "amount"], "rows": [
27
+ [1, "2026-09-24", "Travel", "Train Utrecht-Hamburg return", 189.40],
28
+ [1, "2026-09-24", "Lodging", "Hotel, one night", 132.00],
29
+ [1, "2026-09-25", "Meals", "Lunch with the customer", 64.50],
30
+ [2, "2026-10-01", "Travel", "Flight", 245.00],
31
+ [2, "2026-10-01", "Lodging", "Hotel, three nights", 420.00],
32
+ [3, "2026-10-07", "Supplies", "Notebooks and pens", 38.95]]}]}
@@ -0,0 +1,35 @@
1
+ {"blueprint": 1, "name": "Team Tasks", "alias": "team-tasks", "schema": "team_tasks",
2
+ "tables": [
3
+ {"name": "project", "label": "Projects", "columns": [
4
+ {"name": "name", "type": "text", "required": true, "unique": true},
5
+ {"name": "owner", "type": "text"},
6
+ {"name": "status", "type": "text", "required": true, "values": ["Planned", "Active", "On hold", "Done"]},
7
+ {"name": "start_date", "type": "date"},
8
+ {"name": "end_date", "type": "date"}]},
9
+ {"name": "task", "label": "Tasks", "columns": [
10
+ {"name": "project_id", "references": "project", "required": true},
11
+ {"name": "title", "type": "text", "required": true},
12
+ {"name": "assignee", "type": "text"},
13
+ {"name": "status", "type": "text", "required": true, "values": ["To do", "In progress", "Blocked", "Done"]},
14
+ {"name": "priority", "type": "text", "values": ["Low", "Normal", "High"]},
15
+ {"name": "due", "type": "date"},
16
+ {"name": "hours", "type": "number"}]}],
17
+ "pages": [
18
+ {"type": "report_form", "table": "project", "page": 2, "form_page": 3, "label": "Projects", "icon": "layers"},
19
+ {"type": "report_form", "table": "task", "page": 4, "form_page": 5, "label": "Tasks", "icon": "check"},
20
+ {"type": "facets", "table": "task", "page": 6, "label": "Find tasks", "icon": "filter"},
21
+ {"type": "calendar", "table": "task", "page": 7, "label": "Due dates", "icon": "calendar"}],
22
+ "dashboard": true,
23
+ "sample_data": [
24
+ {"table": "project", "columns": ["id", "name", "owner", "status", "start_date", "end_date"], "rows": [
25
+ [1, "Website relaunch", "Ann", "Active", "2026-09-01", "2026-12-15"],
26
+ [2, "Customer portal", "Ben", "Planned", "2026-11-01", "2027-03-31"],
27
+ [3, "Office move", "Cleo", "Done", "2026-05-01", "2026-08-30"]]},
28
+ {"table": "task", "columns": ["project_id", "title", "assignee", "status", "priority", "due", "hours"], "rows": [
29
+ [1, "Design the home page", "Dana", "Done", "High", "2026-09-20", 16],
30
+ [1, "Write the copy", "Eli", "In progress", "Normal", "2026-10-25", 12],
31
+ [1, "Move the content", "Dana", "To do", "Normal", "2026-11-15", 24],
32
+ [1, "Test on phones", "Finn", "To do", "High", "2026-12-01", 8],
33
+ [2, "Gather requirements", "Ben", "In progress", "High", "2026-11-10", 20],
34
+ [2, "Choose the sign-in", "Gus", "Blocked", "Normal", "2026-11-20", 4],
35
+ [3, "Pack the archive", "Cleo", "Done", "Low", "2026-08-10", 10]]}]}
@@ -47,4 +47,4 @@ values ('HR demo staff', 'Departments, employees and leave requests for trying o
47
47
  {"column": "decision_note", "generator": "skip", "options": "", "nulls": 0},
48
48
  {"column": "created_at", "generator": "timestamp", "options": "2025-10-01..2026-10-01", "nulls": 0}]}
49
49
  ]$json$::jsonb, 'admin', 'admin')
50
- on conflict (name) do nothing;
50
+ on conflict (workspace_id, name) do nothing;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pgkiln",
3
- "version": "0.36.0",
3
+ "version": "0.38.0",
4
4
  "description": "Open source low-code, SQL-driven application builder for PostgreSQL, inspired by Oracle APEX",
5
5
  "keywords": [
6
6
  "postgresql",