@pgpmjs/core 7.17.0 → 7.17.2
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/apply/materialize.js +18 -7
- package/esm/apply/materialize.js +19 -8
- package/package.json +13 -13
package/apply/materialize.js
CHANGED
|
@@ -50,9 +50,11 @@ function makeSubsystemStripper(source, spec, instanceName) {
|
|
|
50
50
|
`referenced object, or keep the subsystem.`);
|
|
51
51
|
}
|
|
52
52
|
// A change whose deploy consists entirely of subsystem statements (plus
|
|
53
|
-
// transaction control) is
|
|
54
|
-
//
|
|
55
|
-
//
|
|
53
|
+
// transaction control) is dropped *as a change* — removed from the plan and
|
|
54
|
+
// deploy order rather than emitted as an empty script (empty scripts collide
|
|
55
|
+
// on the deploy ledger's script-hash uniqueness). Its verify/revert scripts
|
|
56
|
+
// target dropped objects the classifier can't always see (bare DROPs, catalog
|
|
57
|
+
// probes), which is exactly why the whole change is dropped, not just blanked.
|
|
56
58
|
const excludedChanges = new Set();
|
|
57
59
|
for (const change of source.changes) {
|
|
58
60
|
if (!change.deploy)
|
|
@@ -63,7 +65,10 @@ function makeSubsystemStripper(source, spec, instanceName) {
|
|
|
63
65
|
excludedChanges.add(change.name);
|
|
64
66
|
}
|
|
65
67
|
}
|
|
66
|
-
|
|
68
|
+
// Surviving changes may still contain stray subsystem statements (a change
|
|
69
|
+
// that both creates a survivor and touches the excluded subsystem); strip
|
|
70
|
+
// those in place. Fully-excluded changes are dropped via `excludedChanges`.
|
|
71
|
+
const strip = (sql) => (0, slice_1.stripSubsystemSql)(sql, selector).sql;
|
|
67
72
|
return { strip, excludedChanges };
|
|
68
73
|
}
|
|
69
74
|
/**
|
|
@@ -113,14 +118,20 @@ async function materializeApplyModule(options) {
|
|
|
113
118
|
assumeSchemasExist: targetSchemas
|
|
114
119
|
}
|
|
115
120
|
});
|
|
116
|
-
// Excluded changes
|
|
117
|
-
//
|
|
121
|
+
// Excluded changes are dropped from the artifact entirely (plan + deploy
|
|
122
|
+
// order + dependency refs); surviving changes get their stray subsystem
|
|
123
|
+
// statements stripped before the namespace transform.
|
|
118
124
|
const transpiled = (0, bundle_1.transpileBundle)(source, {
|
|
125
|
+
excludeChange: stripSubsystem
|
|
126
|
+
? (name) => stripSubsystem.excludedChanges.has(name)
|
|
127
|
+
: undefined,
|
|
128
|
+
// Excluded changes keep their source identity so the plan-prune (which
|
|
129
|
+
// matches source names) can find them; survivors route normally.
|
|
119
130
|
renameChange: stripSubsystem
|
|
120
131
|
? (name) => (stripSubsystem.excludedChanges.has(name) ? name : renameChange(name))
|
|
121
132
|
: renameChange,
|
|
122
133
|
transformScript: stripSubsystem
|
|
123
|
-
? (sql, ctx) => transformScript(stripSubsystem.strip(sql
|
|
134
|
+
? (sql, ctx) => transformScript(stripSubsystem.strip(sql), ctx)
|
|
124
135
|
: transformScript,
|
|
125
136
|
renameModule: instanceName,
|
|
126
137
|
provenance: {
|
package/esm/apply/materialize.js
CHANGED
|
@@ -3,7 +3,7 @@ import { tmpdir } from 'os';
|
|
|
3
3
|
import { join, resolve } from 'path';
|
|
4
4
|
import { bundleFromModule, materializeBundle, transpileBundle, verifyBundle } from '@pgpmjs/bundle';
|
|
5
5
|
import { buildSchemaRouter, loadModule, makeSchemaTranspiler } from '@pgpmjs/transform';
|
|
6
|
-
import {
|
|
6
|
+
import { excludeSubsystem, stripSubsystemSql } from '@pgpmjs/slice';
|
|
7
7
|
import { hasApplySpec, readApplySpec } from './apply-spec';
|
|
8
8
|
import { loadWorkspaceRoutingProfile, resolveEffectiveApplySpec } from './profile';
|
|
9
9
|
import { isReuseSpec, materializeReuseModule, resolveSharedModuleName } from './reuse';
|
|
@@ -45,9 +45,11 @@ function makeSubsystemStripper(source, spec, instanceName) {
|
|
|
45
45
|
`referenced object, or keep the subsystem.`);
|
|
46
46
|
}
|
|
47
47
|
// A change whose deploy consists entirely of subsystem statements (plus
|
|
48
|
-
// transaction control) is
|
|
49
|
-
//
|
|
50
|
-
//
|
|
48
|
+
// transaction control) is dropped *as a change* — removed from the plan and
|
|
49
|
+
// deploy order rather than emitted as an empty script (empty scripts collide
|
|
50
|
+
// on the deploy ledger's script-hash uniqueness). Its verify/revert scripts
|
|
51
|
+
// target dropped objects the classifier can't always see (bare DROPs, catalog
|
|
52
|
+
// probes), which is exactly why the whole change is dropped, not just blanked.
|
|
51
53
|
const excludedChanges = new Set();
|
|
52
54
|
for (const change of source.changes) {
|
|
53
55
|
if (!change.deploy)
|
|
@@ -58,7 +60,10 @@ function makeSubsystemStripper(source, spec, instanceName) {
|
|
|
58
60
|
excludedChanges.add(change.name);
|
|
59
61
|
}
|
|
60
62
|
}
|
|
61
|
-
|
|
63
|
+
// Surviving changes may still contain stray subsystem statements (a change
|
|
64
|
+
// that both creates a survivor and touches the excluded subsystem); strip
|
|
65
|
+
// those in place. Fully-excluded changes are dropped via `excludedChanges`.
|
|
66
|
+
const strip = (sql) => stripSubsystemSql(sql, selector).sql;
|
|
62
67
|
return { strip, excludedChanges };
|
|
63
68
|
}
|
|
64
69
|
/**
|
|
@@ -108,14 +113,20 @@ export async function materializeApplyModule(options) {
|
|
|
108
113
|
assumeSchemasExist: targetSchemas
|
|
109
114
|
}
|
|
110
115
|
});
|
|
111
|
-
// Excluded changes
|
|
112
|
-
//
|
|
116
|
+
// Excluded changes are dropped from the artifact entirely (plan + deploy
|
|
117
|
+
// order + dependency refs); surviving changes get their stray subsystem
|
|
118
|
+
// statements stripped before the namespace transform.
|
|
113
119
|
const transpiled = transpileBundle(source, {
|
|
120
|
+
excludeChange: stripSubsystem
|
|
121
|
+
? (name) => stripSubsystem.excludedChanges.has(name)
|
|
122
|
+
: undefined,
|
|
123
|
+
// Excluded changes keep their source identity so the plan-prune (which
|
|
124
|
+
// matches source names) can find them; survivors route normally.
|
|
114
125
|
renameChange: stripSubsystem
|
|
115
126
|
? (name) => (stripSubsystem.excludedChanges.has(name) ? name : renameChange(name))
|
|
116
127
|
: renameChange,
|
|
117
128
|
transformScript: stripSubsystem
|
|
118
|
-
? (sql, ctx) => transformScript(stripSubsystem.strip(sql
|
|
129
|
+
? (sql, ctx) => transformScript(stripSubsystem.strip(sql), ctx)
|
|
119
130
|
: transformScript,
|
|
120
131
|
renameModule: instanceName,
|
|
121
132
|
provenance: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pgpmjs/core",
|
|
3
|
-
"version": "7.17.
|
|
3
|
+
"version": "7.17.2",
|
|
4
4
|
"author": "Constructive <developers@constructive.io>",
|
|
5
5
|
"description": "PGPM Package and Migration Tools",
|
|
6
6
|
"main": "index.js",
|
|
@@ -48,24 +48,24 @@
|
|
|
48
48
|
"makage": "^0.3.0"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@pgpmjs/ast": "^0.9.
|
|
52
|
-
"@pgpmjs/bundle": "^0.12.
|
|
53
|
-
"@pgpmjs/env": "^2.39.
|
|
54
|
-
"@pgpmjs/logger": "^2.22.
|
|
55
|
-
"@pgpmjs/server-utils": "^3.23.
|
|
56
|
-
"@pgpmjs/slice": "^0.11.
|
|
57
|
-
"@pgpmjs/transform": "^0.12.
|
|
58
|
-
"@pgpmjs/types": "^2.48.
|
|
59
|
-
"csv-to-pg": "^4.8.
|
|
51
|
+
"@pgpmjs/ast": "^0.9.5",
|
|
52
|
+
"@pgpmjs/bundle": "^0.12.4",
|
|
53
|
+
"@pgpmjs/env": "^2.39.2",
|
|
54
|
+
"@pgpmjs/logger": "^2.22.1",
|
|
55
|
+
"@pgpmjs/server-utils": "^3.23.4",
|
|
56
|
+
"@pgpmjs/slice": "^0.11.2",
|
|
57
|
+
"@pgpmjs/transform": "^0.12.2",
|
|
58
|
+
"@pgpmjs/types": "^2.48.1",
|
|
59
|
+
"csv-to-pg": "^4.8.1",
|
|
60
60
|
"genomic": "^5.6.2",
|
|
61
61
|
"glob": "^13.0.6",
|
|
62
62
|
"parse-package-name": "^1.0.0",
|
|
63
63
|
"pg": "^8.21.0",
|
|
64
|
-
"pg-cache": "^3.23.
|
|
65
|
-
"pg-env": "^1.26.
|
|
64
|
+
"pg-cache": "^3.23.4",
|
|
65
|
+
"pg-env": "^1.26.1",
|
|
66
66
|
"pgsql-deparser": "^18.1.1",
|
|
67
67
|
"pgsql-parser": "^18.1.1",
|
|
68
68
|
"yanse": "^0.2.1"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "a430897efa1488ec24fc636f0d5023207bba7ba7"
|
|
71
71
|
}
|