@pgpm/metaschema-modules 0.27.0 → 0.28.1
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/deploy/schemas/metaschema_modules_public/tables/graph_execution_module/table.sql +83 -0
- package/package.json +4 -4
- package/pgpm.plan +1 -0
- package/revert/schemas/metaschema_modules_public/tables/graph_execution_module/table.sql +7 -0
- package/verify/schemas/metaschema_modules_public/tables/graph_execution_module/table.sql +7 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
-- Deploy schemas/metaschema_modules_public/tables/graph_execution_module/table to pg
|
|
2
|
+
|
|
3
|
+
-- requires: schemas/metaschema_modules_public/schema
|
|
4
|
+
-- requires: schemas/metaschema_modules_public/tables/graph_module/table
|
|
5
|
+
|
|
6
|
+
BEGIN;
|
|
7
|
+
|
|
8
|
+
CREATE TABLE metaschema_modules_public.graph_execution_module (
|
|
9
|
+
id uuid PRIMARY KEY DEFAULT uuidv7(),
|
|
10
|
+
database_id uuid NOT NULL,
|
|
11
|
+
|
|
12
|
+
-- Schema references (if uuid_nil, resolved from schema name or default)
|
|
13
|
+
schema_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
14
|
+
private_schema_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
15
|
+
|
|
16
|
+
-- Optional schema name overrides (used when schema IDs are not provided)
|
|
17
|
+
public_schema_name text,
|
|
18
|
+
private_schema_name text,
|
|
19
|
+
|
|
20
|
+
-- Reference to the graph module this execution module operates against.
|
|
21
|
+
-- The execution module resolves definition tables (graphs, merkle store)
|
|
22
|
+
-- from the linked graph_module at provision time.
|
|
23
|
+
graph_module_id uuid NOT NULL,
|
|
24
|
+
|
|
25
|
+
-- Scope: determines the security level for this module instance.
|
|
26
|
+
-- Can differ from graph_module scope (e.g., platform definitions + entity executions).
|
|
27
|
+
scope text NOT NULL DEFAULT 'app',
|
|
28
|
+
|
|
29
|
+
-- Table name prefix. Auto-derived from scope by the trigger when empty.
|
|
30
|
+
prefix text NOT NULL DEFAULT '',
|
|
31
|
+
|
|
32
|
+
-- Generated table IDs (populated by BEFORE INSERT trigger)
|
|
33
|
+
-- Execution state tables (partitioned by time)
|
|
34
|
+
executions_table_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
35
|
+
outputs_table_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
36
|
+
node_states_table_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
-- Configurable table names (bare names without scope prefix).
|
|
40
|
+
-- The trigger prepends the scope prefix automatically.
|
|
41
|
+
executions_table_name text NOT NULL DEFAULT 'function_graph_executions',
|
|
42
|
+
outputs_table_name text NOT NULL DEFAULT 'function_graph_execution_outputs',
|
|
43
|
+
node_states_table_name text NOT NULL DEFAULT 'function_graph_execution_node_states',
|
|
44
|
+
|
|
45
|
+
-- API routing (get-or-create: if set, schema is added to this API; if NULL, no API is added)
|
|
46
|
+
api_name text,
|
|
47
|
+
private_api_name text,
|
|
48
|
+
|
|
49
|
+
-- Entity table for RLS and billing attribution.
|
|
50
|
+
-- When set, executions are scoped to the entity (org, app) for billing/metering.
|
|
51
|
+
entity_table_id uuid NULL,
|
|
52
|
+
|
|
53
|
+
-- Configurable security policies (NULL = use defaults based on scope).
|
|
54
|
+
policies jsonb NULL,
|
|
55
|
+
|
|
56
|
+
-- Per-table provisions overrides from blueprint config.
|
|
57
|
+
-- Keys are table keys (executions, outputs, node_states).
|
|
58
|
+
provisions jsonb NULL,
|
|
59
|
+
|
|
60
|
+
-- Default permissions: permission names auto-granted to new members.
|
|
61
|
+
default_permissions text[] DEFAULT NULL,
|
|
62
|
+
|
|
63
|
+
-- Timestamps
|
|
64
|
+
created_at timestamptz NOT NULL DEFAULT now(),
|
|
65
|
+
|
|
66
|
+
-- Constraints
|
|
67
|
+
CONSTRAINT graph_execution_module_db_fkey FOREIGN KEY (database_id) REFERENCES metaschema_public.database (id) ON DELETE CASCADE,
|
|
68
|
+
CONSTRAINT graph_execution_module_schema_fkey FOREIGN KEY (schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE,
|
|
69
|
+
CONSTRAINT graph_execution_module_private_schema_fkey FOREIGN KEY (private_schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE,
|
|
70
|
+
CONSTRAINT graph_execution_module_graph_module_fkey FOREIGN KEY (graph_module_id) REFERENCES metaschema_modules_public.graph_module (id) ON DELETE CASCADE,
|
|
71
|
+
CONSTRAINT graph_execution_module_executions_table_fkey FOREIGN KEY (executions_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
|
|
72
|
+
CONSTRAINT graph_execution_module_outputs_table_fkey FOREIGN KEY (outputs_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
|
|
73
|
+
CONSTRAINT graph_execution_module_node_states_table_fkey FOREIGN KEY (node_states_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
|
|
74
|
+
|
|
75
|
+
CONSTRAINT graph_execution_module_entity_table_fkey FOREIGN KEY (entity_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
CREATE INDEX graph_execution_module_database_id_idx ON metaschema_modules_public.graph_execution_module ( database_id );
|
|
79
|
+
|
|
80
|
+
-- One execution module per (database, scope, prefix).
|
|
81
|
+
CREATE UNIQUE INDEX graph_execution_module_unique_scope ON metaschema_modules_public.graph_execution_module ( database_id, scope, prefix );
|
|
82
|
+
|
|
83
|
+
COMMIT;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pgpm/metaschema-modules",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.1",
|
|
4
4
|
"description": "Module metadata handling and dependency tracking",
|
|
5
5
|
"author": "Dan Lynch <pyramation@gmail.com>",
|
|
6
6
|
"contributors": [
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"test:watch": "jest --watch"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@pgpm/metaschema-schema": "0.
|
|
25
|
-
"@pgpm/verify": "0.
|
|
24
|
+
"@pgpm/metaschema-schema": "0.28.0",
|
|
25
|
+
"@pgpm/verify": "0.28.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"pgpm": "^4.23.2"
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"bugs": {
|
|
36
36
|
"url": "https://github.com/constructive-io/pgpm-modules/issues"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "3cf474eaace345b601e946afbd2693d38323ddb7"
|
|
39
39
|
}
|
package/pgpm.plan
CHANGED
|
@@ -66,3 +66,4 @@ schemas/metaschema_modules_public/tables/user_credentials_module/table [schemas/
|
|
|
66
66
|
schemas/metaschema_modules_public/tables/user_settings_module/table [schemas/metaschema_modules_public/schema] 2026-05-28T00:00:00Z devin <devin@cognition.ai> # add user_settings_module for extensible per-user preferences (1:1 with users)
|
|
67
67
|
|
|
68
68
|
schemas/metaschema_modules_public/tables/i18n_module/table [schemas/metaschema_modules_public/schema] 2026-05-28T00:00:00Z devin <devin@cognition.ai> # add i18n_module config table for internationalization settings
|
|
69
|
+
schemas/metaschema_modules_public/tables/graph_execution_module/table [schemas/metaschema_modules_public/schema schemas/metaschema_modules_public/tables/graph_module/table] 2026-06-12T00:00:00Z devin <devin@cognition.ai> # add graph_execution_module config table for partitioned execution state + merkle tree time-travel debugging
|