@intentius/chant-lexicon-sql 0.115.0 → 0.117.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/codegen/registry.d.ts.map +1 -1
- package/dist/config.d.ts +20 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/integrity.json +5 -5
- package/dist/lint/rules/sqlpg001.d.ts.map +1 -1
- package/dist/lsp/postgres-template.d.ts.map +1 -1
- package/dist/manifest.json +1 -1
- package/dist/meta.json +35 -0
- package/dist/okf/index.md +7 -0
- package/dist/okf/types/PostgresDefaultPrivileges.md +9 -0
- package/dist/okf/types/PostgresFunction.md +9 -0
- package/dist/okf/types/PostgresGrant.md +9 -0
- package/dist/okf/types/PostgresPolicy.md +9 -0
- package/dist/okf/types/PostgresProcedure.md +9 -0
- package/dist/okf/types/PostgresRole.md +9 -0
- package/dist/okf/types/PostgresTrigger.md +9 -0
- package/dist/op/activities/postgres-migration.d.ts.map +1 -1
- package/dist/op/activity-contracts.d.ts +10 -0
- package/dist/op/activity-contracts.d.ts.map +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/postgres/access/acl.d.ts +119 -0
- package/dist/postgres/access/acl.d.ts.map +1 -0
- package/dist/postgres/access/import.d.ts +13 -0
- package/dist/postgres/access/import.d.ts.map +1 -0
- package/dist/postgres/access/live.d.ts +24 -0
- package/dist/postgres/access/live.d.ts.map +1 -0
- package/dist/postgres/apply/apply.d.ts +6 -1
- package/dist/postgres/apply/apply.d.ts.map +1 -1
- package/dist/postgres/apply/statements.d.ts +12 -2
- package/dist/postgres/apply/statements.d.ts.map +1 -1
- package/dist/postgres/entities.d.ts +212 -3
- package/dist/postgres/entities.d.ts.map +1 -1
- package/dist/postgres/entity-types.d.ts +7 -0
- package/dist/postgres/entity-types.d.ts.map +1 -1
- package/dist/postgres/import/generator.d.ts +4 -1
- package/dist/postgres/import/generator.d.ts.map +1 -1
- package/dist/postgres/import/live-export.d.ts +6 -0
- package/dist/postgres/import/live-export.d.ts.map +1 -1
- package/dist/postgres/live/bind.d.ts +2 -0
- package/dist/postgres/live/bind.d.ts.map +1 -1
- package/dist/postgres/live/catalog.d.ts +25 -4
- package/dist/postgres/live/catalog.d.ts.map +1 -1
- package/dist/postgres/live/describe-resources.d.ts +15 -1
- package/dist/postgres/live/describe-resources.d.ts.map +1 -1
- package/dist/postgres/migrate/op.d.ts +29 -0
- package/dist/postgres/migrate/op.d.ts.map +1 -1
- package/dist/postgres/parser.d.ts +155 -5
- package/dist/postgres/parser.d.ts.map +1 -1
- package/dist/postgres/plan/commands.d.ts +12 -0
- package/dist/postgres/plan/commands.d.ts.map +1 -1
- package/dist/postgres/plan/deep.d.ts.map +1 -1
- package/dist/postgres/plan/diff.d.ts +11 -2
- package/dist/postgres/plan/diff.d.ts.map +1 -1
- package/dist/postgres/plan/normalize.d.ts +28 -2
- package/dist/postgres/plan/normalize.d.ts.map +1 -1
- package/dist/postgres/plan/rules.d.ts +14 -0
- package/dist/postgres/plan/rules.d.ts.map +1 -1
- package/dist/postgres/plan/schema.d.ts +12 -1
- package/dist/postgres/plan/schema.d.ts.map +1 -1
- package/dist/postgres/plan/server-normalize.d.ts +4 -1
- package/dist/postgres/plan/server-normalize.d.ts.map +1 -1
- package/dist/postgres.d.ts +1 -1
- package/dist/postgres.d.ts.map +1 -1
- package/dist/rules/postgres-templates.ts +2 -2
- package/dist/rules/sqlpg001.ts +10 -4
- package/dist/validate.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/codegen/postgres-classifier-page.ts +1 -1
- package/src/codegen/registry.ts +7 -0
- package/src/config.ts +10 -0
- package/src/generated/lexicon-sql.json +35 -0
- package/src/index.ts +1 -1
- package/src/lint/rules/postgres-templates.ts +2 -2
- package/src/lint/rules/sqlpg001.ts +10 -4
- package/src/lsp/postgres-template.ts +8 -0
- package/src/mcp/postgres.ts +1 -1
- package/src/migration-statements.ts +7 -0
- package/src/op/activities/postgres-migration.ts +27 -2
- package/src/op/activity-contracts.ts +1 -0
- package/src/plugin.ts +6 -0
- package/src/postgres/access/access.e2e.test.ts +191 -0
- package/src/postgres/access/access.test.ts +147 -0
- package/src/postgres/access/acl.ts +400 -0
- package/src/postgres/access/import.ts +64 -0
- package/src/postgres/access/live.ts +123 -0
- package/src/postgres/apply/apply.ts +135 -6
- package/src/postgres/apply/statements.ts +104 -16
- package/src/postgres/entities.ts +613 -14
- package/src/postgres/entity-types.ts +7 -0
- package/src/postgres/import/generator.ts +18 -5
- package/src/postgres/import/live-export.ts +16 -2
- package/src/postgres/live/bind.ts +3 -0
- package/src/postgres/live/catalog.ts +155 -5
- package/src/postgres/live/describe-resources.ts +43 -9
- package/src/postgres/live/routines.e2e.test.ts +173 -0
- package/src/postgres/migrate/batches.e2e.test.ts +2 -1
- package/src/postgres/migrate/migrate.e2e.test.ts +2 -1
- package/src/postgres/migrate/migrate.test.ts +24 -1
- package/src/postgres/migrate/op.ts +80 -35
- package/src/postgres/migrate/outer.e2e.test.ts +163 -0
- package/src/postgres/parser.ts +554 -9
- package/src/postgres/plan/commands.ts +61 -8
- package/src/postgres/plan/deep.ts +79 -18
- package/src/postgres/plan/diff.ts +114 -9
- package/src/postgres/plan/normalize.ts +272 -5
- package/src/postgres/plan/rules.ts +80 -0
- package/src/postgres/plan/schema.ts +27 -6
- package/src/postgres/plan/server-normalize.ts +53 -1
- package/src/postgres/routines.test.ts +150 -0
- package/src/postgres.ts +22 -0
- package/src/skill-defs.ts +1 -1
- package/src/skills/chant-sql-postgres-migration.md +3 -1
- package/src/skills/chant-sql-postgres.md +25 -2
- package/src/validate.ts +7 -0
|
@@ -2,7 +2,15 @@
|
|
|
2
2
|
* A hand-written, lossless parser for the Postgres statements the dialect
|
|
3
3
|
* declares (chant #3278, #3279): `CREATE SCHEMA`, `TABLE`, `INDEX`, `VIEW`,
|
|
4
4
|
* `MATERIALIZED VIEW`, `SEQUENCE`, `TYPE ... AS ENUM`, `DOMAIN`, `EXTENSION`,
|
|
5
|
-
* and `
|
|
5
|
+
* `FUNCTION`, `PROCEDURE` and `TRIGGER` (#3680), `POLICY` and `ROLE`, `GRANT`,
|
|
6
|
+
* `REVOKE` and `ALTER DEFAULT PRIVILEGES` on schemas, tables, columns,
|
|
7
|
+
* sequences and routines, `ALTER TABLE ... ROW LEVEL SECURITY` (#3681), and
|
|
8
|
+
* `COMMENT ON` for those objects.
|
|
9
|
+
*
|
|
10
|
+
* A function's or procedure's body is a string (`AS $$ ... $$`), kept
|
|
11
|
+
* verbatim: Postgres stores it as written and prints it back unchanged. A
|
|
12
|
+
* SQL-standard body (`RETURN expr`, `BEGIN ATOMIC ... END`) is refused, since
|
|
13
|
+
* the server stores it parsed and prints it back rewritten.
|
|
6
14
|
*
|
|
7
15
|
* As for ClickHouse (#3196), statement structure is parsed and expressions are
|
|
8
16
|
* not: a default, a check, a generated expression, an index element, a
|
|
@@ -22,7 +30,8 @@
|
|
|
22
30
|
* Grammar source: the Postgres 18 reference pages for each statement
|
|
23
31
|
* (sql-createtable, sql-createindex, sql-createview,
|
|
24
32
|
* sql-creatematerializedview, sql-createsequence, sql-createtype,
|
|
25
|
-
* sql-createdomain, sql-createextension, sql-createschema, sql-
|
|
33
|
+
* sql-createdomain, sql-createextension, sql-createschema, sql-createfunction,
|
|
34
|
+
* sql-createprocedure, sql-createtrigger, sql-comment) and
|
|
26
35
|
* `src/backend/parser/gram.y` at `REL_18_6` where a page is silent.
|
|
27
36
|
*/
|
|
28
37
|
import { type Span } from "../core/cursor.js";
|
|
@@ -197,17 +206,158 @@ export interface ExtensionNode {
|
|
|
197
206
|
version?: Span;
|
|
198
207
|
cascade: boolean;
|
|
199
208
|
}
|
|
209
|
+
/** One parameter of a function or procedure: `[mode] [name] type [DEFAULT expr]`. */
|
|
210
|
+
export interface RoutineArgNode {
|
|
211
|
+
mode?: "IN" | "OUT" | "INOUT" | "VARIADIC";
|
|
212
|
+
name?: string;
|
|
213
|
+
nameSpan?: Span;
|
|
214
|
+
type: Span;
|
|
215
|
+
default?: Span;
|
|
216
|
+
}
|
|
217
|
+
export interface RoutineNode {
|
|
218
|
+
statement: "function" | "procedure";
|
|
219
|
+
orReplace: boolean;
|
|
220
|
+
name: NameNode;
|
|
221
|
+
args: RoutineArgNode[];
|
|
222
|
+
/** `RETURNS [SETOF] type`: the type, `SETOF` excluded. */
|
|
223
|
+
returns?: {
|
|
224
|
+
setof: boolean;
|
|
225
|
+
type: Span;
|
|
226
|
+
};
|
|
227
|
+
/** `RETURNS TABLE (name type, ...)`. */
|
|
228
|
+
returnsTable?: Array<{
|
|
229
|
+
name: string;
|
|
230
|
+
nameSpan: Span;
|
|
231
|
+
type: Span;
|
|
232
|
+
}>;
|
|
233
|
+
language?: Span;
|
|
234
|
+
/** The attributes after the signature, by their key word: `VOLATILITY` (IMMUTABLE, STABLE, VOLATILE), `STRICT`, `SECURITY`, `LEAKPROOF`, `PARALLEL`, `COST`, `ROWS`, `SUPPORT`, `WINDOW`, `TRANSFORM`. */
|
|
235
|
+
options: Array<{
|
|
236
|
+
option: string;
|
|
237
|
+
value?: Span;
|
|
238
|
+
flag?: boolean;
|
|
239
|
+
}>;
|
|
240
|
+
/** `SET name { TO | = } value`: the parameter, folded, and its value as written. */
|
|
241
|
+
set: Array<{
|
|
242
|
+
name: string;
|
|
243
|
+
value: Span;
|
|
244
|
+
}>;
|
|
245
|
+
/** `AS 'definition'`, or `AS 'obj_file', 'link_symbol'`: the string constants. */
|
|
246
|
+
body: Span[];
|
|
247
|
+
}
|
|
248
|
+
export interface TriggerNode {
|
|
249
|
+
statement: "trigger";
|
|
250
|
+
orReplace: boolean;
|
|
251
|
+
constraint: boolean;
|
|
252
|
+
name: NameNode;
|
|
253
|
+
timing: "BEFORE" | "AFTER" | "INSTEAD OF";
|
|
254
|
+
events: Array<{
|
|
255
|
+
event: "INSERT" | "UPDATE" | "DELETE" | "TRUNCATE";
|
|
256
|
+
columns: Array<{
|
|
257
|
+
name: string;
|
|
258
|
+
span: Span;
|
|
259
|
+
}>;
|
|
260
|
+
}>;
|
|
261
|
+
table: NameNode;
|
|
262
|
+
/** A constraint trigger's `FROM referenced_table`. */
|
|
263
|
+
from?: NameNode;
|
|
264
|
+
deferrable?: boolean;
|
|
265
|
+
initiallyDeferred?: boolean;
|
|
266
|
+
/** `REFERENCING OLD TABLE AS o NEW TABLE AS n`. */
|
|
267
|
+
referencing: Array<{
|
|
268
|
+
which: "OLD" | "NEW";
|
|
269
|
+
name: string;
|
|
270
|
+
}>;
|
|
271
|
+
forEach?: "ROW" | "STATEMENT";
|
|
272
|
+
/** The `WHEN (...)` condition, parentheses excluded. */
|
|
273
|
+
when?: Span;
|
|
274
|
+
function: NameNode;
|
|
275
|
+
args: Span[];
|
|
276
|
+
}
|
|
277
|
+
export interface PolicyNode {
|
|
278
|
+
statement: "policy";
|
|
279
|
+
name: NameNode;
|
|
280
|
+
table: NameNode;
|
|
281
|
+
/** `AS PERMISSIVE` (true, the default) or `AS RESTRICTIVE` (false). */
|
|
282
|
+
permissive?: boolean;
|
|
283
|
+
command?: "ALL" | "SELECT" | "INSERT" | "UPDATE" | "DELETE";
|
|
284
|
+
/** `TO role, ...`: role names, `public` for PUBLIC. */
|
|
285
|
+
roles: Array<{
|
|
286
|
+
name: string;
|
|
287
|
+
span: Span;
|
|
288
|
+
}>;
|
|
289
|
+
/** `USING (...)`, parentheses excluded. */
|
|
290
|
+
using?: Span;
|
|
291
|
+
/** `WITH CHECK (...)`, parentheses excluded. */
|
|
292
|
+
check?: Span;
|
|
293
|
+
}
|
|
294
|
+
export interface RoleNode {
|
|
295
|
+
statement: "role";
|
|
296
|
+
name: NameNode;
|
|
297
|
+
/** The options, each by its key word (`LOGIN`, `NOINHERIT`, `CONNECTION LIMIT`, `VALID UNTIL`), with a value where it takes one. */
|
|
298
|
+
options: Array<{
|
|
299
|
+
option: string;
|
|
300
|
+
value?: Span;
|
|
301
|
+
}>;
|
|
302
|
+
}
|
|
303
|
+
/** What a GRANT or REVOKE is on: an object kind, or (for default privileges) a kind of object created later. */
|
|
304
|
+
export type GrantTarget = "TABLE" | "SEQUENCE" | "SCHEMA" | "FUNCTION" | "PROCEDURE" | "ROUTINE" | "TABLES" | "SEQUENCES" | "FUNCTIONS" | "ROUTINES" | "TYPES" | "SCHEMAS";
|
|
305
|
+
export interface GrantNode {
|
|
306
|
+
statement: "grant";
|
|
307
|
+
revoke: boolean;
|
|
308
|
+
/** `REVOKE GRANT OPTION FOR ...`. */
|
|
309
|
+
grantOptionFor: boolean;
|
|
310
|
+
/** Each privilege, upper case (`ALL` for ALL [PRIVILEGES]), with the columns it is limited to. */
|
|
311
|
+
privileges: Array<{
|
|
312
|
+
privilege: string;
|
|
313
|
+
columns: Array<{
|
|
314
|
+
name: string;
|
|
315
|
+
span: Span;
|
|
316
|
+
}>;
|
|
317
|
+
}>;
|
|
318
|
+
on: GrantTarget;
|
|
319
|
+
/** The objects, each with a routine's parameter list as written (parentheses excluded). Empty for default privileges. */
|
|
320
|
+
objects: Array<{
|
|
321
|
+
name: NameNode;
|
|
322
|
+
args?: Span;
|
|
323
|
+
}>;
|
|
324
|
+
/** Role names, `public` for PUBLIC. */
|
|
325
|
+
grantees: Array<{
|
|
326
|
+
name: string;
|
|
327
|
+
span: Span;
|
|
328
|
+
}>;
|
|
329
|
+
withGrantOption: boolean;
|
|
330
|
+
/** `ALTER DEFAULT PRIVILEGES FOR ROLE ...`. */
|
|
331
|
+
forRoles?: Array<{
|
|
332
|
+
name: string;
|
|
333
|
+
span: Span;
|
|
334
|
+
}>;
|
|
335
|
+
/** `ALTER DEFAULT PRIVILEGES IN SCHEMA ...`. */
|
|
336
|
+
inSchemas?: Array<{
|
|
337
|
+
name: string;
|
|
338
|
+
span: Span;
|
|
339
|
+
}>;
|
|
340
|
+
/** True for `ALTER DEFAULT PRIVILEGES`. */
|
|
341
|
+
defaults: boolean;
|
|
342
|
+
}
|
|
343
|
+
export interface RowSecurityNode {
|
|
344
|
+
statement: "rowSecurity";
|
|
345
|
+
table: NameNode;
|
|
346
|
+
action: "ENABLE" | "DISABLE" | "FORCE" | "NO FORCE";
|
|
347
|
+
}
|
|
200
348
|
export interface CommentNode {
|
|
201
349
|
statement: "comment";
|
|
202
|
-
/** TABLE, COLUMN, INDEX, VIEW, MATERIALIZED VIEW, SEQUENCE, TYPE, DOMAIN, SCHEMA, EXTENSION, CONSTRAINT, DOMAIN CONSTRAINT. */
|
|
350
|
+
/** TABLE, COLUMN, INDEX, VIEW, MATERIALIZED VIEW, SEQUENCE, TYPE, DOMAIN, SCHEMA, EXTENSION, FUNCTION, PROCEDURE, TRIGGER, CONSTRAINT, DOMAIN CONSTRAINT. */
|
|
203
351
|
objectType: string;
|
|
204
352
|
target: NameNode;
|
|
205
|
-
/** For `COMMENT ON CONSTRAINT c ON [DOMAIN] t`: the table or domain. */
|
|
353
|
+
/** For `COMMENT ON CONSTRAINT c ON [DOMAIN] t` and `COMMENT ON TRIGGER t ON table`: the table or domain. */
|
|
206
354
|
on?: NameNode;
|
|
355
|
+
/** For `COMMENT ON FUNCTION f(...)`: the parameter list, parentheses excluded. */
|
|
356
|
+
args?: Span;
|
|
207
357
|
/** The comment, a string, or undefined for `IS NULL`. */
|
|
208
358
|
text?: Span;
|
|
209
359
|
}
|
|
210
|
-
export type StatementNode = TableNode | IndexNode | ViewNode | SequenceNode | SchemaNode | EnumNode | DomainNode | ExtensionNode | CommentNode;
|
|
360
|
+
export type StatementNode = TableNode | IndexNode | ViewNode | SequenceNode | SchemaNode | EnumNode | DomainNode | ExtensionNode | RoutineNode | TriggerNode | PolicyNode | RoleNode | GrantNode | RowSecurityNode | CommentNode;
|
|
211
361
|
/**
|
|
212
362
|
* Parse a template: one CREATE, optionally followed by COMMENT ON statements,
|
|
213
363
|
* separated by `;`. Throws {@link SqlSyntaxError} located in the template.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/postgres/parser.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G,aAAa,EAAE,CAEhE"}
|
|
@@ -43,6 +43,8 @@ export interface PgServerPlan {
|
|
|
43
43
|
diff: PgSchemaDiff;
|
|
44
44
|
/** The major the changes were classified for: the server's, else the one asked for. */
|
|
45
45
|
major?: number;
|
|
46
|
+
/** The schemas the read was limited to; undefined is every schema. */
|
|
47
|
+
scope?: string[];
|
|
46
48
|
}
|
|
47
49
|
/**
|
|
48
50
|
* The declared objects (a build's, keyed by export name) against what a
|
|
@@ -56,6 +58,16 @@ export declare function planAgainstClient(client: PostgresClient, target: Postgr
|
|
|
56
58
|
readLive?: typeof readLiveSchema;
|
|
57
59
|
serverNormalize?: typeof serverNormalized;
|
|
58
60
|
}): Promise<PgServerPlan>;
|
|
61
|
+
/**
|
|
62
|
+
* The declarations a plan compares: all of them where the profile manages
|
|
63
|
+
* access; otherwise none of the policies, roles, grants and default
|
|
64
|
+
* privileges, and no table's row-level security, so a project that manages
|
|
65
|
+
* access elsewhere is not affected. `unmanaged` counts what was left out.
|
|
66
|
+
*/
|
|
67
|
+
export declare function accessScoped(objects: readonly PgSchemaObject[], managed: boolean): {
|
|
68
|
+
kept: PgSchemaObject[];
|
|
69
|
+
unmanaged: number;
|
|
70
|
+
};
|
|
59
71
|
/** The declared objects against the server, keys by qualified name and labels with the export name. */
|
|
60
72
|
export declare function planPgAgainstServer(environment: string, buildFile: string, options?: Omit<BindOptions, "environment">): Promise<PgSchemaDiff>;
|
|
61
73
|
//# sourceMappingURL=commands.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../src/postgres/plan/commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAA+B,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAClG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAqB,cAAc,EAAE,KAAK,YAAY,EAAE,MAAM,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OAAO,CAAC,qBAAqB,CAAC,CA0DhC"}
|
|
@@ -16,11 +16,18 @@ import { type ChangeSet, type ClassifiedChange } from "../../core/classifier.js"
|
|
|
16
16
|
import { matchByIdentity } from "../../core/diff.js";
|
|
17
17
|
import { type PgChangeClass, type PgClassifierRuleId } from "./rules.js";
|
|
18
18
|
import { type CanonicalConstraint } from "./normalize.js";
|
|
19
|
-
import
|
|
19
|
+
import { type AccessChange } from "../access/acl.js";
|
|
20
|
+
import { type PgDiffObject, type PgSchemaObject } from "./schema.js";
|
|
20
21
|
import type { PostgresMigrationOpSuggestion } from "../migrate/handoff.js";
|
|
21
22
|
/** What the diff needs to know beyond the two schemas: the server's major (`sql.postgresMajor`, else the newest pinned). */
|
|
22
23
|
export interface PgDiffOptions {
|
|
23
24
|
major?: number;
|
|
25
|
+
/**
|
|
26
|
+
* Whether to compare the access the two sides declare (grants, revokes,
|
|
27
|
+
* default privileges). On by default, for a diff between two builds; a plan
|
|
28
|
+
* against a server compares the server's access itself (`./commands.ts`).
|
|
29
|
+
*/
|
|
30
|
+
access?: boolean;
|
|
24
31
|
}
|
|
25
32
|
export type PgChange = ClassifiedChange<PgClassifierRuleId, PgChangeClass>;
|
|
26
33
|
export interface PgSchemaDiff extends ChangeSet<PgChange> {
|
|
@@ -28,6 +35,8 @@ export interface PgSchemaDiff extends ChangeSet<PgChange> {
|
|
|
28
35
|
refused: PgChange[];
|
|
29
36
|
/** The `PostgresMigrationOp` to run for each refused column rename or type change (#3281). */
|
|
30
37
|
migrationOps?: PostgresMigrationOpSuggestion[];
|
|
38
|
+
/** The access changes among `changes`, each with its GRANT, REVOKE or ALTER DEFAULT PRIVILEGES statements (#3681). */
|
|
39
|
+
access?: AccessChange[];
|
|
31
40
|
}
|
|
32
41
|
/** The rule adding a constraint falls under. */
|
|
33
42
|
export declare function addConstraintRule(c: CanonicalConstraint): PgClassifierRuleId;
|
|
@@ -41,5 +50,5 @@ export declare function addConstraintRule(c: CanonicalConstraint): PgClassifierR
|
|
|
41
50
|
* (`../apply/`) match the same way.
|
|
42
51
|
*/
|
|
43
52
|
export declare function matchPgObjects(before: readonly PgSchemaObject[], after: readonly PgSchemaObject[]): ReturnType<typeof matchByIdentity<PgDiffObject>>;
|
|
44
|
-
export declare function diffPgSchemas(
|
|
53
|
+
export declare function diffPgSchemas(beforeAll: readonly PgSchemaObject[], afterAll: readonly PgSchemaObject[], options?: PgDiffOptions): PgSchemaDiff;
|
|
45
54
|
//# sourceMappingURL=diff.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../../src/postgres/plan/diff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAoB,KAAK,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAChG,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAuB,KAAK,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC3F,OAAO,
|
|
1
|
+
{"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../../src/postgres/plan/diff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAoB,KAAK,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAChG,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAuB,KAAK,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC3F,OAAO,EAAkE,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvH,OAAO,EAAmE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AACnH,OAAO,EAAe,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/E,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAExE,4HAA4H;AAC5H,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,MAAM,QAAQ,GAAG,gBAAgB,CAAC,kBAAkB,EAAE,aAAa,CAAC,CAAC;AAE3E,MAAM,WAAW,YAAa,SAAQ,SAAS,CAAC,QAAQ,CAAC;IACvD,6EAA6E;IAC7E,OAAO,EAAE,QAAQ,EAAE,CAAC;IACpB,8FAA8F;IAC9F,YAAY,CAAC,EAAE,6BAA6B,EAAE,CAAC;IAC/C,sHAAsH;IACtH,MAAM,CAAC,EAAE,YAAY,EAAE,CAAC;CACzB;AAqHD,gDAAgD;AAChD,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,mBAAmB,GAAG,kBAAkB,CAa5E;AA6KD;;;GAGG;AACH;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,cAAc,EAAE,EAAE,KAAK,EAAE,SAAS,cAAc,EAAE,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,YAAY,CAAC,CAAC,CAUpJ;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,SAAS,cAAc,EAAE,EAAE,QAAQ,EAAE,SAAS,cAAc,EAAE,EAAE,OAAO,GAAE,aAAkB,GAAG,YAAY,CAqClJ"}
|
|
@@ -27,13 +27,22 @@
|
|
|
27
27
|
* column's columns are `NOT NULL` whether or not that is written;
|
|
28
28
|
* - an identity column's or a sequence's options at their defaults are left
|
|
29
29
|
* out; storage parameters compare as a map;
|
|
30
|
-
* - an index's access method defaults to `btree
|
|
30
|
+
* - an index's access method defaults to `btree`;
|
|
31
|
+
* - a function's or procedure's parameter types drop their modifiers (the
|
|
32
|
+
* catalog keeps none: `varchar(20)` is `character varying`), a parameter's
|
|
33
|
+
* mode is `in` unless written, its attributes at their defaults (VOLATILE,
|
|
34
|
+
* CALLED ON NULL INPUT, SECURITY INVOKER, PARALLEL UNSAFE, COST 100 or 1,
|
|
35
|
+
* ROWS 1000 or 0) are left out, and its body is compared as written, since
|
|
36
|
+
* the server keeps it verbatim;
|
|
37
|
+
* - a trigger's events compare as a set, `UPDATE OF` columns sorted, and its
|
|
38
|
+
* arguments as the strings the catalog stores.
|
|
31
39
|
*
|
|
32
40
|
* What the rules cannot see (a view's `SELECT *`, which the server expands, or
|
|
33
41
|
* an expression it parenthesizes) is asked of the live server itself when a
|
|
34
42
|
* plan or a deep read has one (`./server-normalize.ts`). Offline, between two
|
|
35
43
|
* builds, only the rules apply.
|
|
36
44
|
*/
|
|
45
|
+
import type { RoutineProps } from "../entities.js";
|
|
37
46
|
/** The integer type a serial spelling stands for, or undefined for any other type. */
|
|
38
47
|
export declare const serialBase: (type: string | undefined) => string | undefined;
|
|
39
48
|
/** A qualified name in canonical form: each piece unquoted where it can be, the default schema added to a bare one. */
|
|
@@ -76,11 +85,21 @@ export interface CanonicalConstraint {
|
|
|
76
85
|
notValid?: boolean;
|
|
77
86
|
comment?: string;
|
|
78
87
|
}
|
|
79
|
-
export type CanonicalKind = "schema" | "table" | "index" | "view" | "materializedView" | "sequence" | "enum" | "domain" | "extension";
|
|
88
|
+
export type CanonicalKind = "schema" | "table" | "index" | "view" | "materializedView" | "sequence" | "enum" | "domain" | "extension" | "function" | "procedure" | "trigger" | "policy" | "role" | "grant" | "defaultPrivileges";
|
|
89
|
+
/** The kinds whose declarations are privileges, compared as the access they add up to (`../access/`), not one by one. */
|
|
90
|
+
export declare const ACCESS_KINDS: ReadonlySet<CanonicalKind>;
|
|
91
|
+
/** The kinds a profile manages only when it says so (`sql.profiles.<env>.access`). */
|
|
92
|
+
export declare const ACCESS_MANAGED_KINDS: ReadonlySet<CanonicalKind>;
|
|
80
93
|
export interface CanonicalPgObject {
|
|
81
94
|
kind: CanonicalKind;
|
|
82
95
|
schema?: string;
|
|
83
96
|
name: string;
|
|
97
|
+
/**
|
|
98
|
+
* What tells the object from another of the same name: a routine's input
|
|
99
|
+
* parameter types, `(integer,text)`; a trigger's table, ` ON app.users`.
|
|
100
|
+
* Written as SQL names the object after its name.
|
|
101
|
+
*/
|
|
102
|
+
signature?: string;
|
|
84
103
|
/** Everything else that is compared, by field, each field canonical. */
|
|
85
104
|
fields: Record<string, unknown>;
|
|
86
105
|
columns: CanonicalColumn[];
|
|
@@ -96,6 +115,13 @@ export declare function canonicalSequenceOptions(o: {
|
|
|
96
115
|
cache?: string;
|
|
97
116
|
cycle?: boolean;
|
|
98
117
|
}, ownerType?: string): string;
|
|
118
|
+
/** A parameter's or result's type as the catalog keeps it: canonical, its modifiers dropped (`varchar(20)` is `character varying`). */
|
|
119
|
+
export declare function canonicalArgType(text: string, defaultSchema: string): string;
|
|
120
|
+
/** A routine's identity among its overloads: its input parameter types, `(integer,text)`. */
|
|
121
|
+
export declare function routineSignature(p: Pick<RoutineProps, "args">, defaultSchema: string): string;
|
|
122
|
+
/** A routine named with its parameters as a GRANT writes it (`app.f(int, text)`), as the target the catalog names: `app.f(integer,text)`. */
|
|
123
|
+
export declare function canonicalRoutineTarget(text: string, defaultSchema: string): string;
|
|
124
|
+
export declare function canonicalRoleAttributes(options: readonly string[]): string[];
|
|
99
125
|
/**
|
|
100
126
|
* A definition in canonical form. `props` is an entity's props, declared or
|
|
101
127
|
* parsed from what the server printed; `defaultSchema` qualifies a bare name.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../../src/postgres/plan/normalize.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../../src/postgres/plan/normalize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAQH,OAAO,KAAK,EAeV,YAAY,EAKb,MAAM,aAAa,CAAC;AAsCrB,sFAAsF;AACtF,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,GAAG,SAAS,KA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CAAC,YAAY,EAAE,MAAM,CAAC,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAE7F;AAsED,6IAA6I;AAC7I,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAalF;AAKD,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAW5E;AAiCD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,SAAW,GAAG,iBAAiB,CAuMjI;AAED,kHAAkH;AAClH,wBAAgB,cAAc,CAAC,CAAC,EAAE,mBAAmB,EAAE,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAEtF;AAED,gEAAgE;AAChE,eAAO,MAAM,WAAW,GAAI,2BAA2B,eAAe,KAAG,MAA8B,CAAC"}
|
|
@@ -78,6 +78,20 @@ export declare const PG_CLASSIFIER_RULES: {
|
|
|
78
78
|
readonly SQLPG266: PgClassifierRule;
|
|
79
79
|
readonly SQLPG267: PgClassifierRule;
|
|
80
80
|
readonly SQLPG268: PgClassifierRule;
|
|
81
|
+
readonly SQLPG280: PgClassifierRule;
|
|
82
|
+
readonly SQLPG281: PgClassifierRule;
|
|
83
|
+
readonly SQLPG282: PgClassifierRule;
|
|
84
|
+
readonly SQLPG283: PgClassifierRule;
|
|
85
|
+
readonly SQLPG284: PgClassifierRule;
|
|
86
|
+
readonly SQLPG285: PgClassifierRule;
|
|
87
|
+
readonly SQLPG290: PgClassifierRule;
|
|
88
|
+
readonly SQLPG291: PgClassifierRule;
|
|
89
|
+
readonly SQLPG292: PgClassifierRule;
|
|
90
|
+
readonly SQLPG293: PgClassifierRule;
|
|
91
|
+
readonly SQLPG294: PgClassifierRule;
|
|
92
|
+
readonly SQLPG296: PgClassifierRule;
|
|
93
|
+
readonly SQLPG297: PgClassifierRule;
|
|
94
|
+
readonly SQLPG298: PgClassifierRule;
|
|
81
95
|
readonly SQLPG270: PgClassifierRule;
|
|
82
96
|
};
|
|
83
97
|
export type PgClassifierRuleId = keyof typeof PG_CLASSIFIER_RULES;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../../src/postgres/plan/rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAkB,KAAK,aAAa,EAAE,KAAK,cAAc,IAAI,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAErH,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,UAAU,GAAG,cAAc,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEhH,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,CAAC,aAAa,CAAC,CAAC;AAEhE,eAAO,MAAM,iBAAiB,EAAE,aAAa,CAAC,aAAa,CAY1D,CAAC;AASF,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../../src/postgres/plan/rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAkB,KAAK,aAAa,EAAE,KAAK,cAAc,IAAI,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAErH,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,UAAU,GAAG,cAAc,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEhH,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,CAAC,aAAa,CAAC,CAAC;AAEhE,eAAO,MAAM,iBAAiB,EAAE,aAAa,CAAC,aAAa,CAY1D,CAAC;AASF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAySqB,CAAC;AAEtD,MAAM,MAAM,kBAAkB,GAAG,MAAM,OAAO,mBAAmB,CAAC"}
|
|
@@ -22,6 +22,8 @@ export interface PgDiffObject extends CanonicalPgObject {
|
|
|
22
22
|
foreign?: string;
|
|
23
23
|
/** The export name, against a server. */
|
|
24
24
|
exportName?: string;
|
|
25
|
+
/** What depends on a routine on the server (a view, a trigger, a default), which a DROP FUNCTION would refuse. */
|
|
26
|
+
dependents?: string[];
|
|
25
27
|
}
|
|
26
28
|
export type PgSchemaObject = Keyed<PgDiffObject>;
|
|
27
29
|
/** The rename hints in a statement: the object's (a comment before the CREATE) and each column's (a comment on its line). */
|
|
@@ -37,11 +39,20 @@ export declare function pgSchemaFromBuildOutput(json: string, defaultSchema?: st
|
|
|
37
39
|
export declare function pgBuildMajor(json: string): number | undefined;
|
|
38
40
|
export declare function pgBuildFileMajor(path: string): number | undefined;
|
|
39
41
|
export declare function pgSchemaFromBuildFile(path: string, defaultSchema?: string): PgSchemaObject[];
|
|
40
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* The namespace an object's name is unique in: relations (tables, views,
|
|
44
|
+
* sequences, indexes) share one per schema, types and domains another,
|
|
45
|
+
* functions and procedures a third (told apart by their parameter types),
|
|
46
|
+
* a trigger's or a policy's name is unique on its table, and a role's in the
|
|
47
|
+
* cluster.
|
|
48
|
+
*/
|
|
49
|
+
export declare function pgNamespace(kind: string): string;
|
|
50
|
+
/** The identity an object has on a server: its kind's namespace, its qualified name, and its signature where it has one. */
|
|
41
51
|
export declare function qualifiedKey(o: {
|
|
42
52
|
kind: string;
|
|
43
53
|
schema?: string;
|
|
44
54
|
name: string;
|
|
55
|
+
signature?: string;
|
|
45
56
|
}): string;
|
|
46
57
|
/** The declared objects re-keyed by qualified name, the only identity a server has. */
|
|
47
58
|
export declare function keyedByQualifiedName(objects: readonly PgSchemaObject[]): PgSchemaObject[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/postgres/plan/schema.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,EAAqB,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGxE,oHAAoH;AACpH,MAAM,WAAW,YAAa,SAAQ,iBAAiB;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2DAA2D;IAC3D,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,0CAA0C;IAC1C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,yCAAyC;IACzC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,sGAAsG;IACtG,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yCAAyC;IACzC,UAAU,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/postgres/plan/schema.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,EAAqB,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGxE,oHAAoH;AACpH,MAAM,WAAW,YAAa,SAAQ,iBAAiB;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2DAA2D;IAC3D,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,0CAA0C;IAC1C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,yCAAyC;IACzC,OAAO,CAAC,EAAE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CAAC,OAAO,EAAE,SAAS,cAAc,EAAE,GAAG,cAAc,EAAE,CAEzF;AAED,wEAAwE;AACxE,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,YAAY,EAAE,EAAE,aAAa,EAAE,MAAM,GAAG,cAAc,EAAE,CAUvG"}
|
|
@@ -8,7 +8,10 @@
|
|
|
8
8
|
* (`CREATE TEMP VIEW`, or a `CREATE TEMP TABLE` holding the columns' types,
|
|
9
9
|
* defaults and generated expressions and the checks) inside a transaction
|
|
10
10
|
* that is always rolled back, with a short `lock_timeout`, and read back with
|
|
11
|
-
* the same printers the catalog read uses.
|
|
11
|
+
* the same printers the catalog read uses. A trigger's `WHEN` and a policy's
|
|
12
|
+
* `USING` and `WITH CHECK`, which the server prints with the casts it
|
|
13
|
+
* resolved, are read back from a trigger or policy on a temporary copy of the
|
|
14
|
+
* table (`CREATE TEMP TABLE ... (LIKE table)`). Nothing is left behind: Postgres
|
|
12
15
|
* DDL is transactional and a temporary object lives in the session's own
|
|
13
16
|
* schema. A server that refuses (no TEMP privilege, a lock not granted in
|
|
14
17
|
* time, an expression it rejects) leaves the rules' answer standing.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-normalize.d.ts","sourceRoot":"","sources":["../../../src/postgres/plan/server-normalize.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"server-normalize.d.ts","sourceRoot":"","sources":["../../../src/postgres/plan/server-normalize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EAAiB,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAiHpE;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,SAAS,iBAAiB,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC,EAAE,CAAC,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAmC5J"}
|
package/dist/postgres.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* the statements are Postgres's own DDL, parsed at build time into entities,
|
|
6
6
|
* and the names fold and quote as Postgres folds and quotes them.
|
|
7
7
|
*/
|
|
8
|
-
export { schema, table, index, view, sequence, type, domain, extension, literal, SqlLiteral, SqlTemplateError, PostgresObject, POSTGRES_ENTITY_TYPES, isPostgresObject, isColumnRef, quoteIdent, type PostgresEntityType, type PostgresSchema, type PostgresRelation, type PostgresTable, type PostgresView, type PostgresIndex, type PostgresSequence, type PostgresEnum, type PostgresDomain, type PostgresExtension, type ColumnDef, type KeyDef, type CheckDef, type ForeignKeyDef, type ExclusionDef, type SchemaProps, type TableProps, type IndexProps, type ViewProps, type SequenceProps, type EnumProps, type DomainProps, type ExtensionProps, type LineageEdge, } from "./postgres/entities.js";
|
|
8
|
+
export { schema, table, index, view, sequence, type, domain, extension, func, procedure, trigger, policy, role, grant, literal, SqlLiteral, SqlTemplateError, PostgresObject, POSTGRES_ENTITY_TYPES, isPostgresObject, isColumnRef, quoteIdent, type PostgresEntityType, type PostgresSchema, type PostgresRelation, type PostgresTable, type PostgresView, type PostgresIndex, type PostgresSequence, type PostgresEnum, type PostgresDomain, type PostgresExtension, type PostgresFunction, type PostgresProcedure, type PostgresTrigger, type PostgresPolicy, type PostgresRole, type PostgresGrant, type ColumnDef, type KeyDef, type CheckDef, type ForeignKeyDef, type ExclusionDef, type SchemaProps, type TableProps, type IndexProps, type ViewProps, type SequenceProps, type EnumProps, type DomainProps, type ExtensionProps, type RoutineProps, type RoutineArgDef, type FunctionProps, type ProcedureProps, type TriggerProps, type PolicyProps, type RoleProps, type GrantProps, type DefaultPrivilegesProps, type PrivilegeDef, type LineageEdge, } from "./postgres/entities.js";
|
|
9
9
|
export { POSTGRES_PROVIDERS, COMMON_REFUSED, providerData, isPostgresProvider, providerAllowsExtension, isProviderOwned, refusedStatement, normalizeStatement, type PostgresProvider, type ProviderData, type ProviderSource, type RefusedStatement, type LiveObjectRef, } from "./postgres/providers/index.js";
|
|
10
10
|
export { PostgresMigrationOp, type PostgresMigrationOpConfig, type PostgresMigrationOpResources, type PostgresMigrationArgs, } from "./postgres/migrate/op.js";
|
|
11
11
|
export { POSTGRES_RECEIPTS_TABLE } from "./postgres/migrate/receipts.js";
|
package/dist/postgres.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postgres.d.ts","sourceRoot":"","sources":["../src/postgres.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,MAAM,EACN,KAAK,EACL,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,SAAS,EACT,OAAO,EACP,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,MAAM,EACX,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,WAAW,GACjB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,uBAAuB,EACvB,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,aAAa,GACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,mBAAmB,EACnB,KAAK,yBAAyB,EAC9B,KAAK,4BAA4B,EACjC,KAAK,qBAAqB,GAC3B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,cAAc,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"postgres.d.ts","sourceRoot":"","sources":["../src/postgres.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,MAAM,EACN,KAAK,EACL,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,SAAS,EACT,IAAI,EACJ,SAAS,EACT,OAAO,EACP,MAAM,EACN,IAAI,EACJ,KAAK,EACL,OAAO,EACP,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,MAAM,EACX,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,sBAAsB,EAC3B,KAAK,YAAY,EACjB,KAAK,WAAW,GACjB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,uBAAuB,EACvB,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,aAAa,GACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,mBAAmB,EACnB,KAAK,yBAAyB,EAC9B,KAAK,4BAA4B,EACjC,KAAK,qBAAqB,GAC3B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,cAAc,uBAAuB,CAAC"}
|
|
@@ -17,12 +17,12 @@ export const POSTGRES_TEMPLATE_SOURCES: readonly TemplateSource<PostgresTag>[] =
|
|
|
17
17
|
{
|
|
18
18
|
dialect: "postgres",
|
|
19
19
|
modules: ["@intentius/chant-lexicon-sql/postgres"],
|
|
20
|
-
tags: ["schema", "table", "index", "view", "sequence", "type", "domain", "extension"],
|
|
20
|
+
tags: ["schema", "table", "index", "view", "sequence", "type", "domain", "extension", "func", "procedure", "trigger", "policy", "role", "grant"],
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
dialect: "postgres",
|
|
24
24
|
modules: ["@intentius/chant-lexicon-sql"],
|
|
25
|
-
tags: ["schema", "index", "sequence", "type", "domain", "extension"],
|
|
25
|
+
tags: ["schema", "index", "sequence", "type", "domain", "extension", "func", "procedure", "trigger", "policy", "role", "grant"],
|
|
26
26
|
},
|
|
27
27
|
];
|
|
28
28
|
|
package/dist/rules/sqlpg001.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { LintContext, LintDiagnostic, LintRule } from "@intentius/chant/lint/rule";
|
|
2
2
|
import { parseStatements, SqlSyntaxError } from "../../postgres/parser";
|
|
3
|
-
import { STATEMENT_NAMES, type PostgresTag } from "../../postgres/entities";
|
|
3
|
+
import { followOnStray, STATEMENT_NAMES, type PostgresTag } from "../../postgres/entities";
|
|
4
4
|
import { findPostgresTemplates, postgresTokensOf, templatePosition, tokenPosition } from "./postgres-templates";
|
|
5
5
|
|
|
6
6
|
/** The statement each tag holds. */
|
|
@@ -13,6 +13,12 @@ const STATEMENT: Record<PostgresTag, string> = {
|
|
|
13
13
|
type: "enum",
|
|
14
14
|
domain: "domain",
|
|
15
15
|
extension: "extension",
|
|
16
|
+
func: "function",
|
|
17
|
+
procedure: "procedure",
|
|
18
|
+
trigger: "trigger",
|
|
19
|
+
policy: "policy",
|
|
20
|
+
role: "role",
|
|
21
|
+
grant: "grant",
|
|
16
22
|
};
|
|
17
23
|
|
|
18
24
|
const TAG_OF: Record<string, PostgresTag> = Object.fromEntries(Object.entries(STATEMENT).map(([tag, statement]) => [statement, tag as PostgresTag]));
|
|
@@ -59,15 +65,15 @@ export const sqlpg001: LintRule = {
|
|
|
59
65
|
report(
|
|
60
66
|
use
|
|
61
67
|
? `${found.tag}\`...\` holds a ${STATEMENT_NAMES[node!.statement]}; use the ${use} tag`
|
|
62
|
-
: `${found.tag}\`...\` starts with a
|
|
68
|
+
: `${found.tag}\`...\` starts with a ${STATEMENT_NAMES[node!.statement]}; it goes after the CREATE it belongs to`,
|
|
63
69
|
templatePosition(source, found, 0, 0),
|
|
64
70
|
);
|
|
65
71
|
continue;
|
|
66
72
|
}
|
|
67
|
-
const stray =
|
|
73
|
+
const stray = followOnStray(found.tag, rest);
|
|
68
74
|
if (stray) {
|
|
69
75
|
report(
|
|
70
|
-
`${found.tag}\`...\` holds a second statement (${STATEMENT_NAMES[stray.statement]}); a template declares one object, followed only by COMMENT ON statements for it`,
|
|
76
|
+
`${found.tag}\`...\` holds a second statement (${STATEMENT_NAMES[stray.statement]}); a template declares one object, followed only by COMMENT ON statements for it${found.tag === "table" ? " and ALTER TABLE ... ROW LEVEL SECURITY" : ""}`,
|
|
71
77
|
templatePosition(source, found, 0, 0),
|
|
72
78
|
);
|
|
73
79
|
}
|
package/dist/validate.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,EAAgD,KAAK,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAMtH,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,EAAgD,KAAK,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAMtH,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAoEvF,wBAAsB,QAAQ,CAAC,IAAI,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,cAAc,CAAC,CAoEpF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentius/chant-lexicon-sql",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.117.0",
|
|
4
4
|
"description": "SQL lexicon for chant — database schema as typed declarations, one dialect at a time; ClickHouse first, with types read from a pinned server's catalog",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://intentius.io/chant",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"typescript": "^5.9.3"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
|
-
"@intentius/chant": "^0.
|
|
73
|
+
"@intentius/chant": "^0.117.0",
|
|
74
74
|
"typescript": "^5.9.3"
|
|
75
75
|
}
|
|
76
76
|
}
|
|
@@ -70,7 +70,7 @@ Two rules change class across the supported majors: a STORED generated column's
|
|
|
70
70
|
|
|
71
71
|
## Identity and renames
|
|
72
72
|
|
|
73
|
-
An object is identified by its export name between two builds, and by its schema-qualified name against a server, which has no export names. Tables, views, materialized views, sequences and indexes share one namespace per schema, types and domains another, and schemas and extensions are matched by name.
|
|
73
|
+
An object is identified by its export name between two builds, and by its schema-qualified name against a server, which has no export names. Tables, views, materialized views, sequences and indexes share one namespace per schema, types and domains another, and schemas and extensions are matched by name. Functions and procedures share a namespace of their own and are told apart by their input parameter types, so an overload is another object; a trigger is matched by its name on its table.
|
|
74
74
|
|
|
75
75
|
A rename is declared where it happens. Before a CREATE, \`-- previously: <old name>\` says the object had another name; on a column's line, it says the column did:
|
|
76
76
|
|
package/src/codegen/registry.ts
CHANGED
|
@@ -26,6 +26,13 @@ const KINDS: Record<string, string> = {
|
|
|
26
26
|
PostgresEnum: POSTGRES_ENTITY_TYPES.enum,
|
|
27
27
|
PostgresDomain: POSTGRES_ENTITY_TYPES.domain,
|
|
28
28
|
PostgresExtension: POSTGRES_ENTITY_TYPES.extension,
|
|
29
|
+
PostgresFunction: POSTGRES_ENTITY_TYPES.function,
|
|
30
|
+
PostgresProcedure: POSTGRES_ENTITY_TYPES.procedure,
|
|
31
|
+
PostgresTrigger: POSTGRES_ENTITY_TYPES.trigger,
|
|
32
|
+
PostgresPolicy: POSTGRES_ENTITY_TYPES.policy,
|
|
33
|
+
PostgresRole: POSTGRES_ENTITY_TYPES.role,
|
|
34
|
+
PostgresGrant: POSTGRES_ENTITY_TYPES.grant,
|
|
35
|
+
PostgresDefaultPrivileges: POSTGRES_ENTITY_TYPES.defaultPrivileges,
|
|
29
36
|
};
|
|
30
37
|
|
|
31
38
|
export function buildRegistry(): string {
|
package/src/config.ts
CHANGED
|
@@ -146,6 +146,16 @@ export const sqlProfileSchema = z.strictObject({
|
|
|
146
146
|
* `CONCURRENTLY` index build), in milliseconds. 0, no limit, when omitted.
|
|
147
147
|
*/
|
|
148
148
|
scanTimeoutMs: z.number().int().nonnegative().optional(),
|
|
149
|
+
/**
|
|
150
|
+
* Postgres: whether chant manages access in this environment (#3681): the
|
|
151
|
+
* declared row-level security policies and each table's row-level security,
|
|
152
|
+
* the declared roles (created when missing, never dropped), and the
|
|
153
|
+
* privileges on the declared objects and the default privileges, which a
|
|
154
|
+
* plan compares and an apply grants and revokes. Off when omitted: the
|
|
155
|
+
* access declarations are not planned or applied, and the server's access
|
|
156
|
+
* is not read, so a project that manages access elsewhere is not affected.
|
|
157
|
+
*/
|
|
158
|
+
access: z.boolean().optional(),
|
|
149
159
|
});
|
|
150
160
|
|
|
151
161
|
const dialectName = z.enum(SQL_DIALECTS);
|