@intentius/chant-lexicon-sql 0.112.1 → 0.113.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/dist/clickhouse/apply/apply.d.ts.map +1 -1
- package/dist/clickhouse/apply/statements.d.ts +77 -1
- package/dist/clickhouse/apply/statements.d.ts.map +1 -1
- package/dist/clickhouse/plan/commands.d.ts +6 -1
- package/dist/clickhouse/plan/commands.d.ts.map +1 -1
- package/dist/clickhouse/topology.d.ts +100 -0
- package/dist/clickhouse/topology.d.ts.map +1 -0
- package/dist/codegen/classifier-page.d.ts.map +1 -1
- package/dist/codegen/postgres-classifier-page.d.ts.map +1 -1
- package/dist/core/statements.d.ts +104 -0
- package/dist/core/statements.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/integrity.json +2 -2
- package/dist/manifest.json +1 -1
- package/dist/migration-statements.d.ts +55 -0
- package/dist/migration-statements.d.ts.map +1 -0
- package/dist/postgres/apply/apply.d.ts.map +1 -1
- package/dist/postgres/apply/statements.d.ts +91 -1
- package/dist/postgres/apply/statements.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/clickhouse/apply/apply.ts +25 -53
- package/src/clickhouse/apply/statements.ts +149 -31
- package/src/clickhouse/plan/commands.ts +30 -6
- package/src/clickhouse/topology.e2e.test.ts +100 -0
- package/src/clickhouse/topology.test.ts +276 -0
- package/src/clickhouse/topology.ts +451 -0
- package/src/codegen/classifier-page.ts +17 -0
- package/src/codegen/postgres-classifier-page.ts +17 -0
- package/src/core/statements.ts +127 -0
- package/src/index.ts +15 -0
- package/src/migration-statements.test.ts +265 -0
- package/src/migration-statements.ts +252 -0
- package/src/op/__snapshots__/watch-pipeline.test.ts.snap +93 -0
- package/src/op/watch-drift.e2e.test.ts +302 -0
- package/src/op/watch-pipeline.test.ts +113 -0
- package/src/postgres/apply/apply.ts +38 -96
- package/src/postgres/apply/statements.ts +145 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/apply/apply.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EACL,aAAa,
|
|
1
|
+
{"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/apply/apply.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EACL,aAAa,EAIb,KAAK,eAAe,EACrB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAe,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAIxD,OAAO,EAA6B,KAAK,cAAc,EAAiC,MAAM,cAAc,CAAC;AAG7G,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,eAAe,SAAY,GAAG,cAAc,EAAE,CAY3F;AAED,0FAA0F;AAC1F,eAAO,MAAM,QAAQ,GAAI,UAAU,SAAS,cAAc,EAAE,KAAG,QAAQ,EAA0D,CAAC;AAElI,MAAM,WAAW,sBAAsB;IACrC,8FAA8F;IAC9F,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,6FAA6F;IAC7F,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,wEAAwE;IACxE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,wDAAwD;IACxD,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9B;AAED;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,eAAe,CAAC;AAErD,sGAAsG;AACtG,qBAAa,oBAAqB,SAAQ,aAAa,CAAC,sBAAsB,CAAC;gBACjE,OAAO,EAAE,sBAAsB;CAI5C;AAgBD;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,SAAS,cAAc,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAMzJ;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,SAAS,cAAc,EAAE,EAAE,IAAI,GAAE,sBAA2B,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAgFvK"}
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
import type { OwnershipMarker } from "@intentius/chant/ownership";
|
|
18
18
|
import { type CanonicalObject } from "../plan/normalize.js";
|
|
19
19
|
import type { Change } from "../plan/diff.js";
|
|
20
|
+
import { type ChangeClass, type ClassifierRuleId } from "../plan/rules.js";
|
|
20
21
|
import { type ClickHouseEntityType } from "../entities.js";
|
|
21
22
|
/** A backquoted identifier. */
|
|
22
23
|
export declare const ident: (name: string) => string;
|
|
@@ -41,12 +42,18 @@ export interface DeclaredObject {
|
|
|
41
42
|
/** The export names this object references. */
|
|
42
43
|
dependsOn: string[];
|
|
43
44
|
}
|
|
44
|
-
/** One statement to send, and whether it starts a background rewrite to wait on. */
|
|
45
|
+
/** One statement to send, the change it makes, and whether it starts a background rewrite to wait on. */
|
|
45
46
|
export interface Step {
|
|
46
47
|
sql: string;
|
|
47
48
|
/** A mutation follows on the server; wait on `system.mutations` before the next step. */
|
|
48
49
|
rewrite: boolean;
|
|
50
|
+
/** The classifier rule of the change it makes. */
|
|
51
|
+
rule: ClassifierRuleId;
|
|
52
|
+
/** That rule's class. */
|
|
53
|
+
class: ChangeClass;
|
|
49
54
|
}
|
|
55
|
+
/** The step for a statement that makes a change under `rule`: a rewrite-class rule waits on its mutation. */
|
|
56
|
+
export declare function stepFor(sql: string, rule: ClassifierRuleId): Step;
|
|
50
57
|
/** The object's name on the server, quoted. */
|
|
51
58
|
export declare const objectIdent: (obj: DeclaredObject) => string;
|
|
52
59
|
/**
|
|
@@ -96,4 +103,73 @@ export declare function alterSteps(obj: DeclaredObject, changes: readonly Change
|
|
|
96
103
|
}): Step[];
|
|
97
104
|
/** Whether the steps for these changes already set the object's comment (a plain view replaced whole). */
|
|
98
105
|
export declare function stepsSetComment(obj: DeclaredObject, changes: readonly Change[]): boolean;
|
|
106
|
+
/**
|
|
107
|
+
* What one declared object takes, as the applier and the offline renderer
|
|
108
|
+
* (`../../migration-statements.ts`) both see it:
|
|
109
|
+
*
|
|
110
|
+
* - `create` or `alter`: the statements, in the order they run. An `alter`
|
|
111
|
+
* with none is an object already as declared.
|
|
112
|
+
* - `rebuild`: a change ALTER cannot make; nothing is sent for the object and
|
|
113
|
+
* the rebuild migration Op makes it (`detail` names the Op).
|
|
114
|
+
* - `withheld`: a column drop, which destroys data, in a plan not allowed to
|
|
115
|
+
* delete.
|
|
116
|
+
*/
|
|
117
|
+
export type ObjectStatements = {
|
|
118
|
+
verdict: "create" | "alter";
|
|
119
|
+
obj: DeclaredObject;
|
|
120
|
+
changes: Change[];
|
|
121
|
+
steps: Step[];
|
|
122
|
+
} | {
|
|
123
|
+
verdict: "rebuild";
|
|
124
|
+
obj: DeclaredObject;
|
|
125
|
+
changes: Change[];
|
|
126
|
+
refused: Change[];
|
|
127
|
+
detail: string;
|
|
128
|
+
} | {
|
|
129
|
+
verdict: "withheld";
|
|
130
|
+
obj: DeclaredObject;
|
|
131
|
+
changes: Change[];
|
|
132
|
+
withheld: Change[];
|
|
133
|
+
detail: string;
|
|
134
|
+
};
|
|
135
|
+
/** An object a schema no longer declares, and the `DROP` for it. */
|
|
136
|
+
export interface DropStatement {
|
|
137
|
+
/** The key the changes name it by. */
|
|
138
|
+
key: string;
|
|
139
|
+
type: ClickHouseEntityType;
|
|
140
|
+
database?: string;
|
|
141
|
+
name: string;
|
|
142
|
+
step: Step;
|
|
143
|
+
}
|
|
144
|
+
export interface StatementPlanInput {
|
|
145
|
+
/** The declared objects, in creation order. */
|
|
146
|
+
declared: readonly DeclaredObject[];
|
|
147
|
+
/** The classified changes from the current schema to the declared one. */
|
|
148
|
+
changes: readonly Change[];
|
|
149
|
+
/** The current definitions, keyed as the changes key objects. */
|
|
150
|
+
current: ReadonlyMap<string, CanonicalObject>;
|
|
151
|
+
/** How the changes key a declared object: `database.name` against a server (the default), the export name between two builds. */
|
|
152
|
+
keyOf?: (obj: DeclaredObject) => string;
|
|
153
|
+
/** The marker every `CREATE` and restamped comment carries. */
|
|
154
|
+
marker?: OwnershipMarker;
|
|
155
|
+
/** Column drops are planned, not withheld. Default: off. */
|
|
156
|
+
allowDestructive?: boolean;
|
|
157
|
+
/** Whether the current object (by its key in `current`) carries the marker already; one that does not is restamped. Default: it does. */
|
|
158
|
+
carriesMarker?: (currentKey: string) => boolean;
|
|
159
|
+
}
|
|
160
|
+
export interface StatementPlan {
|
|
161
|
+
/** One entry per declared object, in creation order. */
|
|
162
|
+
objects: ObjectStatements[];
|
|
163
|
+
/** The objects the declarations no longer hold, in drop order: what reads from a table first, a database last. */
|
|
164
|
+
drops: DropStatement[];
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* The statements that take the current schema to the declared one, from the
|
|
168
|
+
* classified changes between them. Pure: nothing is read or sent. The applier
|
|
169
|
+
* (`./apply.ts`) runs the steps against a server; `diffStatements`
|
|
170
|
+
* (`../../migration-statements.ts`) renders the same steps for a migration
|
|
171
|
+
* file. Anything that changes the SQL sent for a change belongs here, so
|
|
172
|
+
* both see it.
|
|
173
|
+
*/
|
|
174
|
+
export declare function planStatements(input: StatementPlanInput): StatementPlan;
|
|
99
175
|
//# sourceMappingURL=statements.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statements.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/apply/statements.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAGlE,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"statements.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/apply/statements.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAGlE,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAoB,KAAK,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAE1F,OAAO,EAA2B,KAAK,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEjF,+BAA+B;AAC/B,eAAO,MAAM,KAAK,GAAI,MAAM,MAAM,KAAG,MAA2C,CAAC;AAEjF,6DAA6D;AAC7D,eAAO,MAAM,cAAc,GAAI,UAAU,MAAM,GAAG,SAAS,EAAE,MAAM,MAAM,KAAG,MACA,CAAC;AAE7E,sCAAsC;AACtC,eAAO,MAAM,SAAS,GAAI,OAAO,MAAM,KAAG,MAAkE,CAAC;AAE7G,wCAAwC;AACxC,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,QAA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
+
* chant sql diff <before.json> <after.json> [--json] [--statements]
|
|
8
8
|
* chant sql plan <env> <build.json> [--json]
|
|
9
9
|
*
|
|
10
10
|
* `diff` is offline: it compares two `chant build` outputs, say a pull
|
|
@@ -14,6 +14,11 @@
|
|
|
14
14
|
* rebuild, which a plan refuses to make in place, and 0 otherwise; for each
|
|
15
15
|
* refused table they name the `ClickHouseRebuildOp` to run instead
|
|
16
16
|
* (`rebuildOps` in `--json`, `./rebuild-handoff.ts`).
|
|
17
|
+
*
|
|
18
|
+
* `diff --statements` prints the statements instead, for a migration file:
|
|
19
|
+
* each one the applier would send, with its change's rule and class, and a
|
|
20
|
+
* refused change as the Op that makes it (`../../migration-statements.ts`).
|
|
21
|
+
* The marker in each `CREATE` is the project's `ownership` config's.
|
|
17
22
|
*/
|
|
18
23
|
import type { CommandGroup, CommandGroupContext } from "@intentius/chant/cli/command-group";
|
|
19
24
|
import { type SchemaDiff } from "./diff.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/plan/commands.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/plan/commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAC5F,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,QAAQ,CAAC;AAItD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAwC9C,wBAAsB,OAAO,CAAC,GAAG,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC,CAevE;AAED,mFAAmF;AACnF,wBAAsB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,GAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAevJ;AAED,wBAAsB,OAAO,CAAC,GAAG,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC,CAYvE;AAED,eAAO,MAAM,WAAW,EAAE,YAOzB,CAAC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One ClickHouse statement rendered for the topology it runs on (#3645):
|
|
3
|
+
* a single node, a cluster (`ON CLUSTER`), a `Replicated` database, or
|
|
4
|
+
* ClickHouse Cloud.
|
|
5
|
+
*
|
|
6
|
+
* A migration source is written once. What differs between topologies is
|
|
7
|
+
* two things, and this module rewrites only those:
|
|
8
|
+
*
|
|
9
|
+
* - `ON CLUSTER`. A cluster's DDL carries it so every host runs the
|
|
10
|
+
* statement. A single node has no cluster to name. A `Replicated`
|
|
11
|
+
* database replicates its own DDL and refuses `ON CLUSTER` naming any
|
|
12
|
+
* other cluster ("ON CLUSTER is not allowed for Replicated database",
|
|
13
|
+
* code 80 on 26.8) unless `ignore_on_cluster_for_replicated_database` is
|
|
14
|
+
* set (default 0). Cloud's databases are Replicated, so the same holds
|
|
15
|
+
* there.
|
|
16
|
+
* - The table engine. A MergeTree-family table replicates its rows only as
|
|
17
|
+
* `Replicated*MergeTree`. On a cluster that engine names its Keeper path
|
|
18
|
+
* and replica; inside a `Replicated` database it takes no path arguments,
|
|
19
|
+
* since `database_replicated_allow_replicated_engine_arguments` defaults to
|
|
20
|
+
* 0 (refuse them) and the database supplies its own. A single node has no
|
|
21
|
+
* Keeper to replicate through, so it gets the plain family. Cloud converts
|
|
22
|
+
* every MergeTree and `Replicated*` engine to its `Shared*` equivalent
|
|
23
|
+
* itself ("You don't add a `Shared` or `Replicated` prefix yourself",
|
|
24
|
+
* https://clickhouse.com/docs/whats-new/cloud-compatibility), so it gets
|
|
25
|
+
* the plain family as well, with no path arguments to clash.
|
|
26
|
+
*
|
|
27
|
+
* Every function here is pure: SQL in, SQL out, nothing sent. Statements
|
|
28
|
+
* this module does not recognize (`INSERT`, `SELECT`, `SYSTEM`) come back
|
|
29
|
+
* unchanged, so a caller can pass every statement it sends.
|
|
30
|
+
*/
|
|
31
|
+
/** Where the statements run. */
|
|
32
|
+
export type Topology = {
|
|
33
|
+
kind: "single";
|
|
34
|
+
} | {
|
|
35
|
+
kind: "cluster";
|
|
36
|
+
/** The cluster's name in `remote_servers`, or a macro such as `{cluster}`. */
|
|
37
|
+
cluster: string;
|
|
38
|
+
/** Keeper path for a `Replicated*MergeTree` the renderer writes. Default {@link DEFAULT_REPLICA_PATH}. */
|
|
39
|
+
replicaPath?: string;
|
|
40
|
+
/** Replica name for a `Replicated*MergeTree` the renderer writes. Default {@link DEFAULT_REPLICA_NAME}. */
|
|
41
|
+
replicaName?: string;
|
|
42
|
+
} | {
|
|
43
|
+
kind: "replicated";
|
|
44
|
+
/**
|
|
45
|
+
* A cluster to create and drop the `Replicated` databases themselves
|
|
46
|
+
* on, as `CREATE DATABASE ... ON CLUSTER` reaches every replica.
|
|
47
|
+
* Statements inside the database never carry it.
|
|
48
|
+
*/
|
|
49
|
+
cluster?: string;
|
|
50
|
+
} | {
|
|
51
|
+
kind: "cloud";
|
|
52
|
+
};
|
|
53
|
+
export type TopologyKind = Topology["kind"];
|
|
54
|
+
/**
|
|
55
|
+
* The Keeper path a cluster's `Replicated*MergeTree` gets: the server's own
|
|
56
|
+
* `default_replica_path`. `{uuid}` is the same on every host because the
|
|
57
|
+
* `CREATE` runs `ON CLUSTER`, and it does not change when the table is
|
|
58
|
+
* renamed or exchanged, so a rebuild's new table never shares the old one's
|
|
59
|
+
* path.
|
|
60
|
+
*/
|
|
61
|
+
export declare const DEFAULT_REPLICA_PATH = "/clickhouse/tables/{uuid}/{shard}";
|
|
62
|
+
/** The replica name a cluster's `Replicated*MergeTree` gets: the server's `default_replica_name`. */
|
|
63
|
+
export declare const DEFAULT_REPLICA_NAME = "{replica}";
|
|
64
|
+
/** The Keeper path a `Replicated` database is created with in the `replicated` topology. */
|
|
65
|
+
export declare const replicatedDatabasePath: (database: string) => string;
|
|
66
|
+
/**
|
|
67
|
+
* Read a topology from its string form, as a command-line flag or an
|
|
68
|
+
* environment variable gives it: `single`, `cluster:<name>`, `replicated`,
|
|
69
|
+
* `replicated:<cluster>`, `cloud`.
|
|
70
|
+
*/
|
|
71
|
+
export declare function parseTopology(value: string): Topology;
|
|
72
|
+
/** An engine as a statement names it: its name and, if it has a parenthesised list, each argument's text. */
|
|
73
|
+
export interface EngineClause {
|
|
74
|
+
name: string;
|
|
75
|
+
args?: string[];
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The engine a table gets on a topology. A MergeTree-family engine becomes
|
|
79
|
+
* `Replicated*` on a cluster (with the path and replica it declared, or the
|
|
80
|
+
* topology's) and in a Replicated database (with none); the plain family on
|
|
81
|
+
* a single node and on Cloud. Any other engine is returned as declared.
|
|
82
|
+
*/
|
|
83
|
+
export declare function renderEngine(engine: EngineClause, topology: Topology): EngineClause;
|
|
84
|
+
/** `ON CLUSTER` and the name after it: a backquoted identifier, or a string literal for a macro (`'{cluster}'`). */
|
|
85
|
+
export declare function onClusterClause(cluster: string): string;
|
|
86
|
+
/**
|
|
87
|
+
* One statement as it runs on `topology`: `ON CLUSTER` added, replaced or
|
|
88
|
+
* removed, and in a `CREATE`, the engine the topology needs. Comments,
|
|
89
|
+
* spacing and everything else in the statement are kept as written.
|
|
90
|
+
* A statement that is not DDL on a database, table or view is returned
|
|
91
|
+
* unchanged, as is `KILL QUERY`/`KILL MUTATION` everywhere but a cluster,
|
|
92
|
+
* where it gains `ON CLUSTER` (inside a Replicated database
|
|
93
|
+
* `KILL QUERY ON CLUSTER '<db>'` names the database's own cluster and is kept).
|
|
94
|
+
*/
|
|
95
|
+
export declare function renderStatement(sql: string, topology: Topology): string;
|
|
96
|
+
/** Each step's statement rendered for `topology`; every other field of a step is kept. */
|
|
97
|
+
export declare function renderSteps<S extends {
|
|
98
|
+
sql: string;
|
|
99
|
+
}>(steps: readonly S[], topology: Topology): S[];
|
|
100
|
+
//# sourceMappingURL=topology.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"topology.d.ts","sourceRoot":"","sources":["../../src/clickhouse/topology.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAKH,gCAAgC;AAChC,MAAM,MAAM,QAAQ,GAChB;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAClB;IACE,IAAI,EAAE,SAAS,CAAC;IAChB,8EAA8E;IAC9E,OAAO,EAAE,MAAM,CAAC;IAChB,0GAA0G;IAC1G,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2GAA2G;IAC3G,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GACD;IACE,IAAI,EAAE,YAAY,CAAC;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GACD;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAEtB,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;AAE5C;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,sCAAsC,CAAC;AACxE,qGAAqG;AACrG,eAAO,MAAM,oBAAoB,cAAc,CAAC;AAEhD,4FAA4F;AAC5F,eAAO,MAAM,sBAAsB,GAAI,UAAU,MAAM,KAAG,MAA6C,CAAC;AAExG;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,CAiBrD;AAID,6GAA6G;AAC7G,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AA0BD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,GAAG,YAAY,CAgBnF;AAMD,oHAAoH;AACpH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEvD;AA6OD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAuCvE;AAED,0FAA0F;AAC1F,wBAAgB,WAAW,CAAC,CAAC,SAAS;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,EAAE,QAAQ,EAAE,QAAQ,GAAG,CAAC,EAAE,CAEnG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"classifier-page.d.ts","sourceRoot":"","sources":["../../src/codegen/classifier-page.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH,wBAAgB,oBAAoB,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"classifier-page.d.ts","sourceRoot":"","sources":["../../src/codegen/classifier-page.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH,wBAAgB,oBAAoB,IAAI,MAAM,CA2E7C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postgres-classifier-page.d.ts","sourceRoot":"","sources":["../../src/codegen/postgres-classifier-page.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,wBAAgB,4BAA4B,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"postgres-classifier-page.d.ts","sourceRoot":"","sources":["../../src/codegen/postgres-classifier-page.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,wBAAgB,4BAA4B,IAAI,MAAM,CAuFrD"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The statements a schema change takes, rendered offline (#3644), the same
|
|
3
|
+
* shape in every dialect: what `diffStatements`
|
|
4
|
+
* (`../migration-statements.ts`) returns and `chant sql diff --statements
|
|
5
|
+
* --json` prints, for a migration file to hold.
|
|
6
|
+
*
|
|
7
|
+
* Every value is plain JSON: strings, booleans, arrays and objects, no
|
|
8
|
+
* `undefined` left in, so the document reads back as it was written. Steps
|
|
9
|
+
* are in the order they run.
|
|
10
|
+
*/
|
|
11
|
+
/** A classified change, as a step names the changes it makes. */
|
|
12
|
+
export interface StatementChange {
|
|
13
|
+
/** The classifier rule, e.g. `SQLCH201`, `SQLPG240`. */
|
|
14
|
+
rule: string;
|
|
15
|
+
/** That rule's class, e.g. `metadata`, `rewrite`, `concurrently`. */
|
|
16
|
+
class: string;
|
|
17
|
+
/** What changed, e.g. `columns.region`, `orderBy`. */
|
|
18
|
+
field: string;
|
|
19
|
+
before?: string;
|
|
20
|
+
after?: string;
|
|
21
|
+
/** Data is removed and not recoverable. */
|
|
22
|
+
destructive?: boolean;
|
|
23
|
+
note?: string;
|
|
24
|
+
}
|
|
25
|
+
/** What every step says about the object it is for. */
|
|
26
|
+
export interface StepObject {
|
|
27
|
+
/** The object's export name: in the newer build, or the older one for an object it drops. */
|
|
28
|
+
object: string;
|
|
29
|
+
/** Its entity type, e.g. `ClickHouse::Table`, `Postgres::Index`. */
|
|
30
|
+
type: string;
|
|
31
|
+
/** Its name on the server: `database.name` or `schema.name`, or a database's, schema's or extension's own name. */
|
|
32
|
+
name: string;
|
|
33
|
+
}
|
|
34
|
+
/** One statement, as the applier would send it. */
|
|
35
|
+
export interface StatementStep extends StepObject {
|
|
36
|
+
kind: "statement";
|
|
37
|
+
sql: string;
|
|
38
|
+
/** The rule of the change it makes. */
|
|
39
|
+
rule: string;
|
|
40
|
+
/** That rule's class. */
|
|
41
|
+
class: string;
|
|
42
|
+
/** False for a statement that may not run inside a transaction block (Postgres `CONCURRENTLY`, `ALTER TYPE ... ADD VALUE`). Always false for ClickHouse, which has none. */
|
|
43
|
+
transactional: boolean;
|
|
44
|
+
/** ClickHouse: the statement starts a mutation; wait for it in `system.mutations` before the next one. */
|
|
45
|
+
waitsForMutation?: boolean;
|
|
46
|
+
/** The statement removes data that is not recoverable (a column or table drop). */
|
|
47
|
+
destructive?: boolean;
|
|
48
|
+
}
|
|
49
|
+
/** A change no statement makes in place, made by a migration Op. */
|
|
50
|
+
export interface OpStep extends StepObject {
|
|
51
|
+
kind: "op";
|
|
52
|
+
/** The Op's export name. */
|
|
53
|
+
op: "ClickHouseRebuildOp" | "PostgresMigrationOp";
|
|
54
|
+
/** The module the Op is imported from. */
|
|
55
|
+
importPath: string;
|
|
56
|
+
/** The Op's options as the hand-off suggests them: `name`, `env`, `table`, and `dualWrite` (ClickHouse) or `column` (Postgres). */
|
|
57
|
+
options: Record<string, unknown>;
|
|
58
|
+
/** The Op's declaration, ready for an `*.op.ts` file. */
|
|
59
|
+
declaration: string;
|
|
60
|
+
/** The changes the Op makes. */
|
|
61
|
+
changes: StatementChange[];
|
|
62
|
+
/** The refusal as the applier reports it: each rule, its restriction, and the Op. */
|
|
63
|
+
detail: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* A change neither a statement nor an Op makes: a rebuild of a view or a
|
|
67
|
+
* database, an expand-and-contract change no Op covers, a change with no
|
|
68
|
+
* in-place statement, or the object's other changes that the applier holds
|
|
69
|
+
* back while one of its changes is refused.
|
|
70
|
+
*/
|
|
71
|
+
export interface ManualStep extends StepObject {
|
|
72
|
+
kind: "manual";
|
|
73
|
+
changes: StatementChange[];
|
|
74
|
+
detail: string;
|
|
75
|
+
}
|
|
76
|
+
export type MigrationStep = StatementStep | OpStep | ManualStep;
|
|
77
|
+
export interface SchemaStatements {
|
|
78
|
+
dialect: "clickhouse" | "postgres";
|
|
79
|
+
/** ClickHouse: the database a bare name means. */
|
|
80
|
+
defaultDatabase?: string;
|
|
81
|
+
/** Postgres: the schema a bare name means; the applier sets `search_path` to it. */
|
|
82
|
+
defaultSchema?: string;
|
|
83
|
+
/** Postgres: the major the changes were classified for. */
|
|
84
|
+
major?: number;
|
|
85
|
+
/** In the order they run: each object's in the newer build's creation order, then the drops. */
|
|
86
|
+
steps: MigrationStep[];
|
|
87
|
+
/** True when a step is an Op or manual: the schema change is more than statements. */
|
|
88
|
+
refused: boolean;
|
|
89
|
+
/** What the diff points out besides the changes (a likely rename written as a drop and an add). */
|
|
90
|
+
hints: string[];
|
|
91
|
+
}
|
|
92
|
+
/** A classified change as a step names it, with no `undefined` fields. */
|
|
93
|
+
export declare function statementChange(c: {
|
|
94
|
+
rule: string;
|
|
95
|
+
class: string;
|
|
96
|
+
field: string;
|
|
97
|
+
before?: string;
|
|
98
|
+
after?: string;
|
|
99
|
+
destructive?: boolean;
|
|
100
|
+
note?: string;
|
|
101
|
+
}): StatementChange;
|
|
102
|
+
/** The steps as a migration file's SQL: each statement after a comment naming its object, rule and class; an Op or manual step as a comment. */
|
|
103
|
+
export declare function renderStatements(doc: SchemaStatements): string;
|
|
104
|
+
//# sourceMappingURL=statements.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"statements.d.ts","sourceRoot":"","sources":["../../src/core/statements.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,iEAAiE;AACjE,MAAM,WAAW,eAAe;IAC9B,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,qEAAqE;IACrE,KAAK,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2CAA2C;IAC3C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,uDAAuD;AACvD,MAAM,WAAW,UAAU;IACzB,6FAA6F;IAC7F,MAAM,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAC;IACb,mHAAmH;IACnH,IAAI,EAAE,MAAM,CAAC;CACd;AAED,mDAAmD;AACnD,MAAM,WAAW,aAAc,SAAQ,UAAU;IAC/C,IAAI,EAAE,WAAW,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,uCAAuC;IACvC,IAAI,EAAE,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C1E,wBAAgB,eAAe,CAAC,CAAC,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,eAAe,CAUzK;AAED,gJAAgJ;AAChJ,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,gBAAgB,GAAG,MAAM,CAa9D"}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,4 +4,5 @@ export { SQL_DIALECTS, type SqlDialect } from "./dialects.js";
|
|
|
4
4
|
export { sqlConfigSchema, type SqlConfig } from "./config.js";
|
|
5
5
|
export { database, table, view, literal } from "./clickhouse/entities.js";
|
|
6
6
|
export { schema, index, sequence, type, domain, extension } from "./postgres/entities.js";
|
|
7
|
+
export { diffStatements, renderStatements, type DiffStatementsOptions, type ManualStep, type MigrationStep, type OpStep, type SchemaStatements, type StatementChange, type StatementStep, type StepObject, } from "./migration-statements.js";
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAM3D,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAMvE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAM3D,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAMvE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAIvF,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,KAAK,qBAAqB,EAC1B,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,UAAU,GAChB,MAAM,wBAAwB,CAAC"}
|
package/dist/integrity.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"algorithm": "sha256",
|
|
3
3
|
"artifacts": {
|
|
4
|
-
"manifest.json": "
|
|
4
|
+
"manifest.json": "7ab753de4cb73a505119a2b83d37d9b946d947c50dedc3a393c18829b64935a5",
|
|
5
5
|
"meta.json": "5b7a5d171aa8bd21c0d55cfbe421143d67da02b7ef924a9b66166790c3fc7b22",
|
|
6
6
|
"types/index.d.ts": "0286ebb367773e84c76818b0f69cb14cff8328fd2f8c65ed87563c8d5815458c",
|
|
7
7
|
"rules/postgres-templates.ts": "f7244417426c441180ccb5c52da32cd812960d6d4eaba1fbdb17f47fcae707b2",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"rules/sqlpg117.ts": "3d5c2d57ccdee3cf91c3ba3cb6363750787a850df8ebd75e9cc3f33113303827",
|
|
58
58
|
"rules/sqlpg118.ts": "e2a40a88a9374c4d99d02118ca4c60877ba0c6eb1ce603a93b24f5fd23d81dde"
|
|
59
59
|
},
|
|
60
|
-
"composite": "
|
|
60
|
+
"composite": "037aaec584d5d150c300e93cf38e051a570ff45b611d7a38eaea5736a39f71b9"
|
|
61
61
|
}
|
package/dist/manifest.json
CHANGED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A schema change's statements, rendered offline (#3644): for two `chant
|
|
3
|
+
* build` outputs, the ordered statements that take the first to the second,
|
|
4
|
+
* each with its change's class and rule, for a migration file. No server is
|
|
5
|
+
* read.
|
|
6
|
+
*
|
|
7
|
+
* The statements are the applier's: each dialect's `planStatements` /
|
|
8
|
+
* `planPgStatements` (`./clickhouse/apply/statements.ts`,
|
|
9
|
+
* `./postgres/apply/statements.ts`) turns classified changes into steps, and
|
|
10
|
+
* both the applier and this renderer call it. What differs is only where the
|
|
11
|
+
* current schema comes from: here the older build, keyed by export name as
|
|
12
|
+
* `chant sql diff` keys it; in the applier the server's catalog.
|
|
13
|
+
*
|
|
14
|
+
* A change the applier refuses in place is a step naming the Op that makes
|
|
15
|
+
* it, never DDL: a ClickHouse rebuild is `ClickHouseRebuildOp`, a Postgres
|
|
16
|
+
* column rename or type change across kinds is `PostgresMigrationOp`. One no
|
|
17
|
+
* Op makes is a manual step. Column and object drops are statements, marked
|
|
18
|
+
* destructive.
|
|
19
|
+
*
|
|
20
|
+
* Where the applier asks the server something, the renderer cannot:
|
|
21
|
+
*
|
|
22
|
+
* - ClickHouse: the applier also asks the server's formatter whether a
|
|
23
|
+
* difference the rules leave is only formatting; the offline diff is the
|
|
24
|
+
* rules' alone, as `chant sql diff` is. Before dropping a database it
|
|
25
|
+
* checks the database is empty.
|
|
26
|
+
* - Postgres: the applier asks the server to normalize expressions the rules
|
|
27
|
+
* leave different, and keeps an extension's own comment (from its control
|
|
28
|
+
* file) under the trailer when the declaration sets none.
|
|
29
|
+
* - Both: the applier restamps an object whose comment lost chant's marker;
|
|
30
|
+
* offline, the older build's objects carry it.
|
|
31
|
+
*/
|
|
32
|
+
import type { OwnershipMarker } from "@intentius/chant/ownership";
|
|
33
|
+
import { type SchemaStatements } from "./core/statements.js";
|
|
34
|
+
export type { ManualStep, MigrationStep, OpStep, SchemaStatements, StatementChange, StatementStep, StepObject } from "./core/statements.js";
|
|
35
|
+
export { renderStatements } from "./core/statements.js";
|
|
36
|
+
export interface DiffStatementsOptions {
|
|
37
|
+
/** The ownership marker every `CREATE` and restamped comment carries, as the applier stamps it. Default: `managed-by=chant` alone. */
|
|
38
|
+
marker?: OwnershipMarker;
|
|
39
|
+
/** The environment an Op step's suggested declaration names. Default: `<env>`. */
|
|
40
|
+
env?: string;
|
|
41
|
+
/** ClickHouse: the database a bare name means. Default: `default`. */
|
|
42
|
+
defaultDatabase?: string;
|
|
43
|
+
/** Postgres: the schema a bare name means. Default: `public`. */
|
|
44
|
+
defaultSchema?: string;
|
|
45
|
+
/** Postgres: the major to classify for. Default: the newer build's `postgresMajor`, else the older's, else the newest pinned. */
|
|
46
|
+
major?: number;
|
|
47
|
+
}
|
|
48
|
+
type BuildInput = string | object;
|
|
49
|
+
/**
|
|
50
|
+
* The statements that take the schema `before` builds to the one `after`
|
|
51
|
+
* builds. Each is a `chant build` output of the sql lexicon, as JSON text or
|
|
52
|
+
* parsed. Both must be the same dialect.
|
|
53
|
+
*/
|
|
54
|
+
export declare function diffStatements(before: BuildInput, after: BuildInput, options?: DiffStatementsOptions): SchemaStatements;
|
|
55
|
+
//# sourceMappingURL=migration-statements.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migration-statements.d.ts","sourceRoot":"","sources":["../src/migration-statements.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAwD,KAAK,gBAAgB,EAAmB,MAAM,mBAAmB,CAAC;AAajI,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,EAAE,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACzI,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,MAAM,WAAW,qBAAqB;IACpC,sIAAsI;IACtI,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,kFAAkF;IAClF,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,sEAAsE;IACtE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iEAAiE;IACjE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iIAAiI;IACjI,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,KAAK,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;AAWlC;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,GAAE,qBAA0B,GAAG,gBAAgB,CAQ3H"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../../src/postgres/apply/apply.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../../src/postgres/apply/apply.ts"],"names":[],"mappings":"AAAA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F,QAAQ,CAAC,EAAE,OAAO,cAAc,CAAC;IACjC,kEAAkE;IAClE,eAAe,CAAC,EAAE,OAAO,gBAAgB,CAAC;CAC3C;AAkCD;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,SAAS,gBAAgB,EAAE,EACrC,IAAI,GAAE,oBAAyB,GAC9B,OAAO,CAAC,oBAAoB,CAAC,CA4M/B"}
|
|
@@ -25,7 +25,7 @@ import { type PostgresEntityType } from "../entity-types.js";
|
|
|
25
25
|
import type { PgChange } from "../plan/diff.js";
|
|
26
26
|
import { type PgChangeClass, type PgClassifierRuleId } from "../plan/rules.js";
|
|
27
27
|
import { type CanonicalConstraint, type CanonicalKind } from "../plan/normalize.js";
|
|
28
|
-
import type { PgDiffObject } from "../plan/schema.js";
|
|
28
|
+
import type { PgDiffObject, PgSchemaObject } from "../plan/schema.js";
|
|
29
29
|
import type { CheckDef, ColumnDef, ExclusionDef, ForeignKeyDef, KeyDef, SequenceProps } from "../entities.js";
|
|
30
30
|
/** One object as a build declares it, in the shape the applier works with. */
|
|
31
31
|
export interface DeclaredPgObject {
|
|
@@ -134,5 +134,95 @@ export declare const scansRows: (cls: PgChangeClass) => boolean;
|
|
|
134
134
|
* `PostgresMigrationOp` for (`../migrate/handoff.ts`).
|
|
135
135
|
*/
|
|
136
136
|
export declare function refusalDetail(changes: readonly PgChange[], name: string, declared?: Pick<PgDiffObject, "kind" | "schema" | "name">): string;
|
|
137
|
+
/**
|
|
138
|
+
* What one declared object takes, as the applier and the offline renderer
|
|
139
|
+
* (`../../migration-statements.ts`) both see it:
|
|
140
|
+
*
|
|
141
|
+
* - `create` or `alter`: the statements, in the order they run. An `alter`
|
|
142
|
+
* with none is an object already as declared.
|
|
143
|
+
* - `foreign`: another tool keeps the object; it is not chant's to change.
|
|
144
|
+
* - `refused`: a change only expand and contract makes; nothing is sent for
|
|
145
|
+
* the object, and `detail` names the migration Op where one makes it.
|
|
146
|
+
* - `unsupported`: a change with no in-place statement; nothing is sent.
|
|
147
|
+
* - `withheld`: a column drop, which destroys data, in a plan not allowed to
|
|
148
|
+
* delete.
|
|
149
|
+
*/
|
|
150
|
+
export type PgObjectStatements = {
|
|
151
|
+
verdict: "create" | "alter";
|
|
152
|
+
obj: DeclaredPgObject;
|
|
153
|
+
changes: PgChange[];
|
|
154
|
+
steps: PgStep[];
|
|
155
|
+
live?: PgDiffObject;
|
|
156
|
+
} | {
|
|
157
|
+
verdict: "foreign";
|
|
158
|
+
obj: DeclaredPgObject;
|
|
159
|
+
changes: PgChange[];
|
|
160
|
+
live: PgDiffObject;
|
|
161
|
+
detail: string;
|
|
162
|
+
} | {
|
|
163
|
+
verdict: "refused";
|
|
164
|
+
obj: DeclaredPgObject;
|
|
165
|
+
changes: PgChange[];
|
|
166
|
+
refused: PgChange[];
|
|
167
|
+
live?: PgDiffObject;
|
|
168
|
+
detail: string;
|
|
169
|
+
} | {
|
|
170
|
+
verdict: "unsupported";
|
|
171
|
+
obj: DeclaredPgObject;
|
|
172
|
+
changes: PgChange[];
|
|
173
|
+
unsupported: UnsupportedChange[];
|
|
174
|
+
live: PgDiffObject;
|
|
175
|
+
detail: string;
|
|
176
|
+
} | {
|
|
177
|
+
verdict: "withheld";
|
|
178
|
+
obj: DeclaredPgObject;
|
|
179
|
+
changes: PgChange[];
|
|
180
|
+
withheld: PgChange[];
|
|
181
|
+
live?: PgDiffObject;
|
|
182
|
+
detail: string;
|
|
183
|
+
};
|
|
184
|
+
/** An object the declarations no longer hold, and the `DROP` for it. */
|
|
185
|
+
export interface PgDropStatement {
|
|
186
|
+
/** The key the changes name it by. */
|
|
187
|
+
key: string;
|
|
188
|
+
kind: CanonicalKind;
|
|
189
|
+
schema?: string;
|
|
190
|
+
name: string;
|
|
191
|
+
step: PgStep;
|
|
192
|
+
}
|
|
193
|
+
export interface PgStatementPlanInput {
|
|
194
|
+
/** The declared objects in creation order, in the canonical form the changes were found for. */
|
|
195
|
+
declared: readonly DeclaredPgObject[];
|
|
196
|
+
/** The classified changes from the current schema to the declared one. */
|
|
197
|
+
changes: readonly PgChange[];
|
|
198
|
+
/** The current schema, keyed as the changes key objects. */
|
|
199
|
+
current: readonly PgSchemaObject[];
|
|
200
|
+
/** How the changes key a declared object: its qualified key against a server (the default), its export name between two builds. */
|
|
201
|
+
keyOf?: (obj: DeclaredPgObject) => string;
|
|
202
|
+
/** The major the statements are for. */
|
|
203
|
+
major: number;
|
|
204
|
+
/** The marker every created object and restamped comment carries. */
|
|
205
|
+
marker?: OwnershipMarker;
|
|
206
|
+
/** Column drops are planned, not withheld. Default: off. */
|
|
207
|
+
allowDestructive?: boolean;
|
|
208
|
+
/** Whether the current object carries the marker already; one that does not is restamped. Default: it does. */
|
|
209
|
+
carriesMarker?: (live: PgDiffObject, currentKey: string) => boolean;
|
|
210
|
+
/** The comment an extension's control file sets, kept under the trailer when the declaration sets none. */
|
|
211
|
+
extensionComment?: (name: string) => string | undefined;
|
|
212
|
+
}
|
|
213
|
+
export interface PgStatementPlan {
|
|
214
|
+
/** One entry per declared object, in creation order. */
|
|
215
|
+
objects: PgObjectStatements[];
|
|
216
|
+
/** The objects the declarations no longer hold, in drop order: views first, a schema last. */
|
|
217
|
+
drops: PgDropStatement[];
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* The statements that take the current schema to the declared one, from the
|
|
221
|
+
* classified changes between them. Pure: nothing is read or sent. The applier
|
|
222
|
+
* (`./apply.ts`) groups the steps into transactions and runs them;
|
|
223
|
+
* `diffStatements` (`../../migration-statements.ts`) renders the same steps
|
|
224
|
+
* for a migration file.
|
|
225
|
+
*/
|
|
226
|
+
export declare function planPgStatements(input: PgStatementPlanInput): PgStatementPlan;
|
|
137
227
|
export {};
|
|
138
228
|
//# sourceMappingURL=statements.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statements.d.ts","sourceRoot":"","sources":["../../../src/postgres/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