@runa-ai/runa-cli 0.5.65 → 0.5.67
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/commands/ci/machine/actors/db/production-preview.d.ts.map +1 -1
- package/dist/commands/ci/machine/formatters/sections/final-comment.d.ts.map +1 -1
- package/dist/commands/ci/machine/machine.d.ts.map +1 -1
- package/dist/commands/db/apply/actors.d.ts +4 -0
- package/dist/commands/db/apply/actors.d.ts.map +1 -1
- package/dist/commands/db/apply/contract.d.ts +3 -4
- package/dist/commands/db/apply/contract.d.ts.map +1 -1
- package/dist/commands/db/apply/helpers/advisory-lock.d.ts +21 -3
- package/dist/commands/db/apply/helpers/advisory-lock.d.ts.map +1 -1
- package/dist/commands/db/apply/helpers/data-compatibility-checker.d.ts +108 -0
- package/dist/commands/db/apply/helpers/data-compatibility-checker.d.ts.map +1 -0
- package/dist/commands/db/apply/helpers/index.d.ts +9 -5
- package/dist/commands/db/apply/helpers/index.d.ts.map +1 -1
- package/dist/commands/db/apply/helpers/partition-prefilter.d.ts +26 -0
- package/dist/commands/db/apply/helpers/partition-prefilter.d.ts.map +1 -0
- package/dist/commands/db/apply/helpers/partition-validator.d.ts +42 -0
- package/dist/commands/db/apply/helpers/partition-validator.d.ts.map +1 -1
- package/dist/commands/db/apply/helpers/pg-schema-diff-helpers.d.ts +20 -0
- package/dist/commands/db/apply/helpers/pg-schema-diff-helpers.d.ts.map +1 -1
- package/dist/commands/db/apply/helpers/plan-validator.d.ts +33 -0
- package/dist/commands/db/apply/helpers/plan-validator.d.ts.map +1 -1
- package/dist/commands/db/apply/helpers/retry-logic.d.ts +15 -0
- package/dist/commands/db/apply/helpers/retry-logic.d.ts.map +1 -1
- package/dist/commands/db/apply/helpers/shadow-db-manager.d.ts +13 -0
- package/dist/commands/db/apply/helpers/shadow-db-manager.d.ts.map +1 -1
- package/dist/commands/db/apply/machine.d.ts +4 -2
- package/dist/commands/db/apply/machine.d.ts.map +1 -1
- package/dist/commands/db/commands/db-apply.d.ts.map +1 -1
- package/dist/commands/db/commands/db-drizzle.d.ts.map +1 -1
- package/dist/commands/db/commands/db-seed.d.ts.map +1 -1
- package/dist/commands/db/sync/actors.d.ts.map +1 -1
- package/dist/commands/db/sync/contract.d.ts +2 -0
- package/dist/commands/db/sync/contract.d.ts.map +1 -1
- package/dist/commands/db/sync/machine.d.ts +1 -0
- package/dist/commands/db/sync/machine.d.ts.map +1 -1
- package/dist/commands/db/types.d.ts +9 -0
- package/dist/commands/db/types.d.ts.map +1 -1
- package/dist/commands/db/utils/db-target.d.ts.map +1 -1
- package/dist/commands/db/utils/schema-detector.d.ts.map +1 -1
- package/dist/commands/db/utils/sql-table-extractor.d.ts.map +1 -1
- package/dist/config/env-files.d.ts.map +1 -1
- package/dist/index.js +4073 -2299
- package/dist/validators/risk-detector.d.ts.map +1 -1
- package/dist/validators/schema-validator.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"production-preview.d.ts","sourceRoot":"","sources":["../../../../../../src/commands/ci/machine/actors/db/production-preview.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"production-preview.d.ts","sourceRoot":"","sources":["../../../../../../src/commands/ci/machine/actors/db/production-preview.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAOH,OAAO,KAAK,EAAgB,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEtE,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,iFAAiF;IACjF,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,iBAAiB,CAAC;CAC5B;AAgYD;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,mHA4ElC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"final-comment.d.ts","sourceRoot":"","sources":["../../../../../../src/commands/ci/machine/formatters/sections/final-comment.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAQH,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"final-comment.d.ts","sourceRoot":"","sources":["../../../../../../src/commands/ci/machine/formatters/sections/final-comment.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAQH,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAqY1E;;GAEG;AACH,wBAAgB,YAAY,IAAI,SAAS,CAMxC;AAkDD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CA+C/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"machine.d.ts","sourceRoot":"","sources":["../../../../src/commands/ci/machine/machine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,OAAO,EAAU,KAAK,YAAY,EAAS,MAAM,QAAQ,CAAC;AAkD1D,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAqB,MAAM,YAAY,CAAC;AAexE,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"machine.d.ts","sourceRoot":"","sources":["../../../../src/commands/ci/machine/machine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,OAAO,EAAU,KAAK,YAAY,EAAS,MAAM,QAAQ,CAAC;AAkD1D,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAqB,MAAM,YAAY,CAAC;AAexE,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwlCpB,CAAC;AAMH,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC;AACzC,MAAM,MAAM,UAAU,GAAG,YAAY,CAAC,OAAO,SAAS,CAAC,CAAC;AAMxD;;GAEG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,UAAU,GAAG,MAAM,CAEzD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,UAAU,GAAG,OAAO,CAExD;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,CAE5D;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,UAAU,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAE3D"}
|
|
@@ -12,6 +12,10 @@ export interface PgSchemaDiffResult {
|
|
|
12
12
|
retryAttempts?: number;
|
|
13
13
|
/** Total time spent waiting between retries (ms) */
|
|
14
14
|
retryWaitMs?: number;
|
|
15
|
+
/** Number of pre-apply data compatibility violations detected */
|
|
16
|
+
dataViolations?: number;
|
|
17
|
+
/** Warning when SSOT enforcement had issues (schemas applied but cleanup incomplete) */
|
|
18
|
+
ssotWarning?: string;
|
|
15
19
|
}
|
|
16
20
|
/**
|
|
17
21
|
* Apply idempotent schemas (extensions, RBAC, cleanup) and set role passwords.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actors.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/apply/actors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"actors.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/apply/actors.ts"],"names":[],"mappings":"AAwCA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAyFlD,MAAM,WAAW,WAAW;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,kDAAkD;IAClD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oDAAoD;IACpD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iEAAiE;IACjE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,wFAAwF;IACxF,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AA2gCD;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB;WAExB,YAAY;eAAa,MAAM;UAAQ,KAAK,GAAG,MAAM;gCA+C9D,CAAC;AAEH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB;WAEnB,YAAY;eAAa,MAAM;gCAgPxC,CAAC;AAkCH;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB;cACjB,MAAM,EAAE;;WACX,YAAY;eAAa,MAAM;gCAwBxC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,UAAU;aACV,OAAO;;WACT,YAAY;eAAa,MAAM;gCAmExC,CAAC"}
|
|
@@ -23,6 +23,7 @@ export declare const DbApplyInputSchema: z.ZodObject<{
|
|
|
23
23
|
allowDataLoss: z.ZodDefault<z.ZodBoolean>;
|
|
24
24
|
confirmAuthzUpdate: z.ZodDefault<z.ZodBoolean>;
|
|
25
25
|
check: z.ZodDefault<z.ZodBoolean>;
|
|
26
|
+
skipDataCheck: z.ZodDefault<z.ZodBoolean>;
|
|
26
27
|
maxLockWaitMs: z.ZodDefault<z.ZodNumber>;
|
|
27
28
|
freshDbCheckSql: z.ZodOptional<z.ZodString>;
|
|
28
29
|
}, z.core.$strict>;
|
|
@@ -33,9 +34,7 @@ export type DbApplyInput = z.infer<typeof DbApplyInputSchema>;
|
|
|
33
34
|
export declare const DbApplyMetricsSchema: z.ZodObject<{
|
|
34
35
|
totalMs: z.ZodNumber;
|
|
35
36
|
idempotentMs: z.ZodOptional<z.ZodNumber>;
|
|
36
|
-
planMs: z.ZodOptional<z.ZodNumber>;
|
|
37
37
|
applyMs: z.ZodOptional<z.ZodNumber>;
|
|
38
|
-
codegenMs: z.ZodOptional<z.ZodNumber>;
|
|
39
38
|
seedMs: z.ZodOptional<z.ZodNumber>;
|
|
40
39
|
retryAttempts: z.ZodOptional<z.ZodNumber>;
|
|
41
40
|
}, z.core.$strip>;
|
|
@@ -51,13 +50,13 @@ export declare const DbApplyOutputSchema: z.ZodObject<{
|
|
|
51
50
|
error: z.ZodOptional<z.ZodString>;
|
|
52
51
|
planSql: z.ZodOptional<z.ZodString>;
|
|
53
52
|
checkOnly: z.ZodOptional<z.ZodBoolean>;
|
|
53
|
+
dataViolations: z.ZodOptional<z.ZodNumber>;
|
|
54
|
+
ssotWarning: z.ZodOptional<z.ZodString>;
|
|
54
55
|
partitionWarnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
55
56
|
metrics: z.ZodOptional<z.ZodObject<{
|
|
56
57
|
totalMs: z.ZodNumber;
|
|
57
58
|
idempotentMs: z.ZodOptional<z.ZodNumber>;
|
|
58
|
-
planMs: z.ZodOptional<z.ZodNumber>;
|
|
59
59
|
applyMs: z.ZodOptional<z.ZodNumber>;
|
|
60
|
-
codegenMs: z.ZodOptional<z.ZodNumber>;
|
|
61
60
|
seedMs: z.ZodOptional<z.ZodNumber>;
|
|
62
61
|
retryAttempts: z.ZodOptional<z.ZodNumber>;
|
|
63
62
|
}, z.core.$strip>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/apply/contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/apply/contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;kBA0CpB,CAAC;AAEZ,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;iBAW/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;iBA2C9B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -3,16 +3,34 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Purpose: Prevent concurrent migrations using PostgreSQL advisory locks
|
|
5
5
|
* Pattern: Acquire before migration, release after completion
|
|
6
|
+
*
|
|
7
|
+
* Architecture:
|
|
8
|
+
* Uses a persistent psql process (via spawn) to hold the lock throughout
|
|
9
|
+
* the entire migration. This prevents the session-scope issue where
|
|
10
|
+
* spawnSync psql exits and releases the lock before migration completes.
|
|
11
|
+
*
|
|
12
|
+
* Lock lifecycle:
|
|
13
|
+
* 1. spawn('psql') → persistent connection
|
|
14
|
+
* 2. pg_try_advisory_lock(MIGRATION_LOCK_ID) → acquire lock
|
|
15
|
+
* 3. process stays alive → lock held
|
|
16
|
+
* 4. releaseAdvisoryLock() → stdin.end() + kill → session ends → lock released
|
|
6
17
|
*/
|
|
7
18
|
/** Unique lock ID for runa db migrations (chosen to be unlikely to conflict) */
|
|
8
19
|
export declare const MIGRATION_LOCK_ID = 88888;
|
|
9
20
|
/**
|
|
10
21
|
* Acquire advisory lock to prevent concurrent migrations.
|
|
22
|
+
*
|
|
23
|
+
* Spawns a persistent psql process that holds the PostgreSQL session open,
|
|
24
|
+
* keeping the advisory lock active until releaseAdvisoryLock() is called.
|
|
25
|
+
*
|
|
11
26
|
* Returns true if lock was acquired, false if another migration is running.
|
|
12
27
|
*/
|
|
13
|
-
export declare function acquireAdvisoryLock(dbUrl: string, verbose: boolean): boolean
|
|
28
|
+
export declare function acquireAdvisoryLock(dbUrl: string, verbose: boolean): Promise<boolean>;
|
|
14
29
|
/**
|
|
15
|
-
* Release advisory lock
|
|
30
|
+
* Release advisory lock by terminating the persistent psql process.
|
|
31
|
+
*
|
|
32
|
+
* When the PostgreSQL session ends (process killed), the advisory lock
|
|
33
|
+
* is automatically released by PostgreSQL.
|
|
16
34
|
*/
|
|
17
|
-
export declare function releaseAdvisoryLock(
|
|
35
|
+
export declare function releaseAdvisoryLock(_dbUrl: string, verbose: boolean): void;
|
|
18
36
|
//# sourceMappingURL=advisory-lock.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"advisory-lock.d.ts","sourceRoot":"","sources":["../../../../../src/commands/db/apply/helpers/advisory-lock.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"advisory-lock.d.ts","sourceRoot":"","sources":["../../../../../src/commands/db/apply/helpers/advisory-lock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAQH,gFAAgF;AAChF,eAAO,MAAM,iBAAiB,QAAQ,CAAC;AAqBvC;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CA4E3F;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAe1E"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI HINT: Pre-Apply Data Compatibility Checker
|
|
3
|
+
*
|
|
4
|
+
* Purpose: Validate that existing data is compatible with schema changes
|
|
5
|
+
* BEFORE applying them, preventing runtime failures.
|
|
6
|
+
*
|
|
7
|
+
* Detected patterns:
|
|
8
|
+
* 1. SET NOT NULL - fails if NULL values exist
|
|
9
|
+
* 2. ALTER TYPE - fails if values can't be cast
|
|
10
|
+
* 3. ADD CHECK - fails if data violates constraint
|
|
11
|
+
* 4. ADD UNIQUE / CREATE UNIQUE INDEX - fails if duplicates exist
|
|
12
|
+
*
|
|
13
|
+
* Performance: All queries use LIMIT 100000 subquery cap + 10s timeout.
|
|
14
|
+
*/
|
|
15
|
+
import type { ValidatedPlan } from './plan-validator.js';
|
|
16
|
+
export type DataViolationType = 'not_null' | 'type_cast' | 'check_constraint' | 'unique_constraint';
|
|
17
|
+
export interface DataViolation {
|
|
18
|
+
statementIndex: number;
|
|
19
|
+
sql: string;
|
|
20
|
+
type: DataViolationType;
|
|
21
|
+
table: string;
|
|
22
|
+
column?: string;
|
|
23
|
+
columns?: string[];
|
|
24
|
+
violationCount: number;
|
|
25
|
+
sampleValues?: string[];
|
|
26
|
+
fixSuggestion: string;
|
|
27
|
+
}
|
|
28
|
+
export interface DataCompatibilityResult {
|
|
29
|
+
violations: DataViolation[];
|
|
30
|
+
checkedStatements: number;
|
|
31
|
+
skippedStatements: number;
|
|
32
|
+
errors: string[];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Parse SET NOT NULL from ALTER TABLE statement.
|
|
36
|
+
* Pattern: ALTER TABLE [IF EXISTS] ["schema"]."table" ALTER COLUMN ["col"] SET NOT NULL
|
|
37
|
+
*/
|
|
38
|
+
export declare function parseSetNotNull(sql: string): {
|
|
39
|
+
schema: string;
|
|
40
|
+
table: string;
|
|
41
|
+
column: string;
|
|
42
|
+
} | null;
|
|
43
|
+
/**
|
|
44
|
+
* Parse ALTER TYPE from ALTER TABLE statement.
|
|
45
|
+
* Pattern: ALTER TABLE ["schema"]."table" ALTER COLUMN ["col"] [SET DATA] TYPE target_type [USING ...]
|
|
46
|
+
*
|
|
47
|
+
* Handles:
|
|
48
|
+
* - Precision types: character varying(100), numeric(10,2)
|
|
49
|
+
* - Schema-qualified types: extensions.vector, public.citext
|
|
50
|
+
* - Array types: integer[], text[]
|
|
51
|
+
*/
|
|
52
|
+
export declare function parseAlterType(sql: string): {
|
|
53
|
+
schema: string;
|
|
54
|
+
table: string;
|
|
55
|
+
column: string;
|
|
56
|
+
targetType: string;
|
|
57
|
+
} | null;
|
|
58
|
+
/**
|
|
59
|
+
* Parse ADD CHECK from ALTER TABLE statement.
|
|
60
|
+
* Pattern: ALTER TABLE ["schema"]."table" ADD [CONSTRAINT name] CHECK (expr)
|
|
61
|
+
*
|
|
62
|
+
* Filters out pg-schema-diff internal temporary constraints (pgschemadiff_tmpnn_*)
|
|
63
|
+
* which are used for online NOT NULL migrations and would cause duplicate reports
|
|
64
|
+
* alongside parseSetNotNull.
|
|
65
|
+
*/
|
|
66
|
+
export declare function parseAddCheck(sql: string): {
|
|
67
|
+
schema: string;
|
|
68
|
+
table: string;
|
|
69
|
+
constraintName: string;
|
|
70
|
+
checkExpr: string;
|
|
71
|
+
} | null;
|
|
72
|
+
/**
|
|
73
|
+
* Parse ADD UNIQUE from ALTER TABLE statement.
|
|
74
|
+
* Pattern: ALTER TABLE ["schema"]."table" ADD [CONSTRAINT name] UNIQUE [NULLS [NOT] DISTINCT] (col1, col2)
|
|
75
|
+
*/
|
|
76
|
+
export declare function parseAddUnique(sql: string): {
|
|
77
|
+
schema: string;
|
|
78
|
+
table: string;
|
|
79
|
+
columns: string[];
|
|
80
|
+
} | null;
|
|
81
|
+
/**
|
|
82
|
+
* Parse CREATE UNIQUE INDEX statement.
|
|
83
|
+
* Pattern: CREATE UNIQUE INDEX [CONCURRENTLY] [IF NOT EXISTS] name ON ["schema"]."table" (columns) [WHERE ...]
|
|
84
|
+
*
|
|
85
|
+
* Handles:
|
|
86
|
+
* - Functional indexes: lower(email), upper(name)
|
|
87
|
+
* - Partial indexes: WHERE deleted_at IS NULL (excluded from column capture)
|
|
88
|
+
* - NULLS NOT DISTINCT (PostgreSQL 15+)
|
|
89
|
+
*/
|
|
90
|
+
export declare function parseCreateUniqueIndex(sql: string): {
|
|
91
|
+
schema: string;
|
|
92
|
+
table: string;
|
|
93
|
+
columns: string[];
|
|
94
|
+
} | null;
|
|
95
|
+
/**
|
|
96
|
+
* Check data compatibility for all statements in a plan.
|
|
97
|
+
*
|
|
98
|
+
* Non-blocking: query errors are collected in `errors` but do not throw.
|
|
99
|
+
*/
|
|
100
|
+
export declare function checkDataCompatibility(dbUrl: string, plan: ValidatedPlan, options?: {
|
|
101
|
+
verbose?: boolean;
|
|
102
|
+
timeout?: number;
|
|
103
|
+
}): DataCompatibilityResult;
|
|
104
|
+
/**
|
|
105
|
+
* Display data compatibility results to the user.
|
|
106
|
+
*/
|
|
107
|
+
export declare function displayDataCompatibilityResults(result: DataCompatibilityResult, verbose: boolean): void;
|
|
108
|
+
//# sourceMappingURL=data-compatibility-checker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-compatibility-checker.d.ts","sourceRoot":"","sources":["../../../../../src/commands/db/apply/helpers/data-compatibility-checker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;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AM,CAAA;CAAE,GAAG,IAAI,CAqBrF;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EAAE,MAAM,GACV;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,IAAI,CAY7D;AAwBD;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,MAAM,GACV;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,IAAI,CAqB7D;AA8QD;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,aAAa,EACnB,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GAChD,uBAAuB,CAyBzB;AAMD;;GAEG;AACH,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,uBAAuB,EAC/B,OAAO,EAAE,OAAO,GACf,IAAI,CAgCN"}
|
|
@@ -4,14 +4,18 @@
|
|
|
4
4
|
* Purpose: Export all helper functions for db apply actors
|
|
5
5
|
*/
|
|
6
6
|
export { acquireAdvisoryLock, MIGRATION_LOCK_ID, releaseAdvisoryLock, } from './advisory-lock.js';
|
|
7
|
-
export type { PlanHazard, PlanStatement, ValidatedPlan } from './plan-validator.js';
|
|
8
|
-
export { parsePlanOutput, validatePlanForExecution } from './plan-validator.js';
|
|
7
|
+
export type { FilterResult, PlanHazard, PlanStatement, ValidatedPlan } from './plan-validator.js';
|
|
8
|
+
export { filterIdempotentProtectedStatements, parsePlanOutput, validatePlanForExecution, } from './plan-validator.js';
|
|
9
9
|
export type { ParsedHazard, PgSchemaDiffPlanOptions } from './pg-schema-diff-helpers.js';
|
|
10
10
|
export type { ShadowDbConfig, ShadowDbResult } from './shadow-db-manager.js';
|
|
11
|
-
export { buildAllowedHazards, displayCheckModeResults, displayHazards, displayHazardsWithContext, executePgSchemaDiffPlan, filterFalsePositiveHazards, getIdempotentRoles, handleHazards, handleHazardsWithContext, handleProductionAuthzProtection, handleProductionDataProtection, isIdempotentRoleHazard, parseHazardsFromOutput, parseHazardsWithContext, resetIdempotentRolesCache, verifyDatabaseConnection, verifyPgSchemaDiffBinary, } from './pg-schema-diff-helpers.js';
|
|
11
|
+
export { buildAllowedHazards, detectDropTableStatements, displayCheckModeResults, displayHazards, displayHazardsWithContext, executePgSchemaDiffPlan, filterFalsePositiveHazards, getIdempotentProtectedTables, getIdempotentRoles, handleHazards, handleHazardsWithContext, handleProductionAuthzProtection, handleProductionDataProtection, isIdempotentRoleHazard, parseHazardsFromOutput, parseHazardsWithContext, PG_SCHEMA_DIFF_APPLY_TIMEOUT_MS, resetIdempotentRolesCache, resetIdempotentTablesCache, verifyDatabaseConnection, verifyPgSchemaDiffBinary, } from './pg-schema-diff-helpers.js';
|
|
12
12
|
export type { PlanSqlRetryConfig, RetryConfig, RetryResult } from './retry-logic.js';
|
|
13
13
|
export { BASE_DELAY_MS, calculateBackoffDelay, DEFAULT_MAX_DELAY_MS, executeApplyWithRetry, executePlanSqlWithRetry, isLockTimeoutError, MAX_RETRIES, sleep, } from './retry-logic.js';
|
|
14
|
-
export { createShadowDbWithExtensions, needsShadowDb } from './shadow-db-manager.js';
|
|
14
|
+
export { cleanupOrphanShadowDatabases, createShadowDbWithExtensions, needsShadowDb, } from './shadow-db-manager.js';
|
|
15
|
+
export type { DataCompatibilityResult, DataViolation, DataViolationType, } from './data-compatibility-checker.js';
|
|
16
|
+
export { checkDataCompatibility, displayDataCompatibilityResults, parseAddCheck, parseAddUnique, parseAlterType, parseCreateUniqueIndex, parseSetNotNull, } from './data-compatibility-checker.js';
|
|
17
|
+
export type { DetectedPartitionStub, PrefilterResult } from './partition-prefilter.js';
|
|
18
|
+
export { prefilterPartitionStubs } from './partition-prefilter.js';
|
|
15
19
|
export type { ExpectedPartition, PartitionDrift } from './partition-validator.js';
|
|
16
|
-
export { detectPartitionDrift, formatPartitionWarnings, parseExpectedPartitions, queryActualPartitions, } from './partition-validator.js';
|
|
20
|
+
export { blankDollarQuotedBodies, detectPartitionDrift, formatPartitionWarnings, parseExpectedPartitions, queryActualPartitions, } from './partition-validator.js';
|
|
17
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/commands/db/apply/helpers/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/commands/db/apply/helpers/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAClG,OAAO,EACL,mCAAmC,EACnC,eAAe,EACf,wBAAwB,GACzB,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACzF,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7E,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,uBAAuB,EACvB,cAAc,EACd,yBAAyB,EACzB,uBAAuB,EACvB,0BAA0B,EAC1B,4BAA4B,EAC5B,kBAAkB,EAClB,aAAa,EACb,wBAAwB,EACxB,+BAA+B,EAC/B,8BAA8B,EAC9B,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,+BAA+B,EAC/B,yBAAyB,EACzB,0BAA0B,EAC1B,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,6BAA6B,CAAC;AACrC,YAAY,EAAE,kBAAkB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAErF,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,kBAAkB,EAClB,WAAW,EACX,KAAK,GACN,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,4BAA4B,EAC5B,4BAA4B,EAC5B,aAAa,GACd,MAAM,wBAAwB,CAAC;AAEhC,YAAY,EACV,uBAAuB,EACvB,aAAa,EACb,iBAAiB,GAClB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,sBAAsB,EACtB,+BAA+B,EAC/B,aAAa,EACb,cAAc,EACd,cAAc,EACd,sBAAsB,EACtB,eAAe,GAChB,MAAM,iCAAiC,CAAC;AAEzC,YAAY,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,YAAY,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAClF,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface DetectedPartitionStub {
|
|
2
|
+
/** Qualified child table name (e.g., "events.location_events_2026_01") */
|
|
3
|
+
child: string;
|
|
4
|
+
/** Qualified parent table name (e.g., "events.location_events") */
|
|
5
|
+
parent: string;
|
|
6
|
+
/** Source SQL file name (e.g., "30_partitions.sql") */
|
|
7
|
+
sourceFile: string;
|
|
8
|
+
}
|
|
9
|
+
export interface PrefilterResult {
|
|
10
|
+
/** Temp dir with partition stubs removed (use as pg-schema-diff --to-dir) */
|
|
11
|
+
filteredDir: string;
|
|
12
|
+
/** All detected partition stubs */
|
|
13
|
+
detectedStubs: DetectedPartitionStub[];
|
|
14
|
+
/** Qualified table names to add to configExclusions (prevents DROP TABLE) */
|
|
15
|
+
autoProtectedTables: string[];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Scan declarative SQL files and remove PARTITION OF statements.
|
|
19
|
+
*
|
|
20
|
+
* Returns null if no partition stubs are found (zero overhead fast path).
|
|
21
|
+
* Returns PrefilterResult with temp dir if stubs were detected and removed.
|
|
22
|
+
*
|
|
23
|
+
* @param schemasDir Path to supabase/schemas/declarative
|
|
24
|
+
*/
|
|
25
|
+
export declare function prefilterPartitionStubs(schemasDir: string): PrefilterResult | null;
|
|
26
|
+
//# sourceMappingURL=partition-prefilter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"partition-prefilter.d.ts","sourceRoot":"","sources":["../../../../../src/commands/db/apply/helpers/partition-prefilter.ts"],"names":[],"mappings":"AAsCA,MAAM,WAAW,qBAAqB;IACpC,0EAA0E;IAC1E,KAAK,EAAE,MAAM,CAAC;IACd,mEAAmE;IACnE,MAAM,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,6EAA6E;IAC7E,WAAW,EAAE,MAAM,CAAC;IACpB,mCAAmC;IACnC,aAAa,EAAE,qBAAqB,EAAE,CAAC;IACvC,6EAA6E;IAC7E,mBAAmB,EAAE,MAAM,EAAE,CAAC;CAC/B;AA6BD;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CA6ElF"}
|
|
@@ -10,6 +10,48 @@ export interface PartitionDrift {
|
|
|
10
10
|
/** Partitions expected in SQL but missing from the database */
|
|
11
11
|
missing: ExpectedPartition[];
|
|
12
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Strip SQL comments while preserving quoted text.
|
|
15
|
+
* Handles: -- line comments, nested block comments, single/double/dollar-quoted strings,
|
|
16
|
+
* and PostgreSQL E-string literals (E'...' with backslash escapes).
|
|
17
|
+
*/
|
|
18
|
+
export declare function stripSqlComments(content: string): string;
|
|
19
|
+
/**
|
|
20
|
+
* Qualified name pattern: optional schema prefix + table name.
|
|
21
|
+
* Matches: schema.table, "schema"."table", or bare table (no schema).
|
|
22
|
+
*
|
|
23
|
+
* Capture groups (4 per usage):
|
|
24
|
+
* 1 = quoted schema (or undefined if no schema)
|
|
25
|
+
* 2 = unquoted schema (or undefined if no schema)
|
|
26
|
+
* 3 = quoted table
|
|
27
|
+
* 4 = unquoted table
|
|
28
|
+
*/
|
|
29
|
+
export declare const QUALIFIED_NAME = "(?:(?:\"([^\"]+)\"|([a-zA-Z_][a-zA-Z0-9_]*))\\s*\\.\\s*)?(?:\"([^\"]+)\"|([a-zA-Z_][a-zA-Z0-9_]*))";
|
|
30
|
+
/**
|
|
31
|
+
* Regex for: CREATE TABLE [IF NOT EXISTS] <child> PARTITION OF <parent>
|
|
32
|
+
*
|
|
33
|
+
* Capture groups:
|
|
34
|
+
* 1,2 = child schema (quoted or unquoted)
|
|
35
|
+
* 3,4 = child table (quoted or unquoted)
|
|
36
|
+
* 5,6 = parent schema (quoted or unquoted)
|
|
37
|
+
* 7,8 = parent table (quoted or unquoted)
|
|
38
|
+
*/
|
|
39
|
+
export declare const PARTITION_OF_REGEX: RegExp;
|
|
40
|
+
/**
|
|
41
|
+
* Extract a qualified name from regex match groups.
|
|
42
|
+
* Groups come in pairs: (quoted, unquoted) for schema and table.
|
|
43
|
+
* Returns "schema.table" when schema is present, or just "table" when absent.
|
|
44
|
+
*/
|
|
45
|
+
export declare function extractQualifiedName(quotedSchema: string | undefined, unquotedSchema: string | undefined, quotedTable: string | undefined, unquotedTable: string | undefined): string;
|
|
46
|
+
/**
|
|
47
|
+
* Replace content inside dollar-quoted strings with spaces.
|
|
48
|
+
* This prevents false-positive PARTITION OF matches inside PL/pgSQL function bodies.
|
|
49
|
+
*
|
|
50
|
+
* Input is already comment-stripped (from stripSqlComments), so we only need to
|
|
51
|
+
* handle dollar-quoted strings — single/double quotes are already handled by the
|
|
52
|
+
* regex (they can't span the CREATE TABLE ... PARTITION OF ... ; pattern).
|
|
53
|
+
*/
|
|
54
|
+
export declare function blankDollarQuotedBodies(content: string): string;
|
|
13
55
|
/**
|
|
14
56
|
* Parse all expected partitions from idempotent SQL directory.
|
|
15
57
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"partition-validator.d.ts","sourceRoot":"","sources":["../../../../../src/commands/db/apply/helpers/partition-validator.ts"],"names":[],"mappings":"AAuBA,MAAM,WAAW,iBAAiB;IAChC,0EAA0E;IAC1E,KAAK,EAAE,MAAM,CAAC;IACd,mEAAmE;IACnE,MAAM,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,+DAA+D;IAC/D,OAAO,EAAE,iBAAiB,EAAE,CAAC;CAC9B;
|
|
1
|
+
{"version":3,"file":"partition-validator.d.ts","sourceRoot":"","sources":["../../../../../src/commands/db/apply/helpers/partition-validator.ts"],"names":[],"mappings":"AAuBA,MAAM,WAAW,iBAAiB;IAChC,0EAA0E;IAC1E,KAAK,EAAE,MAAM,CAAC;IACd,mEAAmE;IACnE,MAAM,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,+DAA+D;IAC/D,OAAO,EAAE,iBAAiB,EAAE,CAAC;CAC9B;AAMD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAwIxD;AAMD;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,uGACqE,CAAC;AAEjG;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,QAG9B,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,cAAc,EAAE,MAAM,GAAG,SAAS,EAClC,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,aAAa,EAAE,MAAM,GAAG,SAAS,GAChC,MAAM,CAIR;AAMD;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAwC/D;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,aAAa,EAAE,MAAM,GAAG,iBAAiB,EAAE,CA+BlF;AAWD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAoC3F;AAMD;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,iBAAiB,EAAE,EAC7B,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAC1B,cAAc,CAGhB;AAMD;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,EAAE,CAKvE"}
|
|
@@ -41,6 +41,18 @@ export declare function filterFalsePositiveHazards(hazards: ParsedHazard[], sche
|
|
|
41
41
|
* Useful for testing or when schema files change.
|
|
42
42
|
*/
|
|
43
43
|
export declare function resetIdempotentRolesCache(): void;
|
|
44
|
+
/**
|
|
45
|
+
* Extract table names from idempotent SQL files.
|
|
46
|
+
* These tables are managed outside pg-schema-diff and must not be dropped.
|
|
47
|
+
*
|
|
48
|
+
* Also merges tables from `excludeFromOrphanDetection` config.
|
|
49
|
+
*/
|
|
50
|
+
export declare function getIdempotentProtectedTables(schemasDir?: string, configExclusions?: string[]): string[];
|
|
51
|
+
/**
|
|
52
|
+
* Reset the cached idempotent tables.
|
|
53
|
+
* Useful for testing or when schema files change.
|
|
54
|
+
*/
|
|
55
|
+
export declare function resetIdempotentTablesCache(): void;
|
|
44
56
|
/**
|
|
45
57
|
* Verify pg-schema-diff binary is available.
|
|
46
58
|
*/
|
|
@@ -130,6 +142,12 @@ export declare function detectMissingExtensionType(errorOutput: string): Missing
|
|
|
130
142
|
* Format actionable hint for missing extension type errors.
|
|
131
143
|
*/
|
|
132
144
|
export declare function formatExtensionErrorHint(detection: MissingExtensionDetection): string;
|
|
145
|
+
/**
|
|
146
|
+
* Detect DROP TABLE statements in plan output.
|
|
147
|
+
* Returns list of "schema.table" names that would be dropped.
|
|
148
|
+
* Used for pre-apply warnings (separate from idempotent protection).
|
|
149
|
+
*/
|
|
150
|
+
export declare function detectDropTableStatements(planOutput: string): string[];
|
|
133
151
|
/**
|
|
134
152
|
* Options for pg-schema-diff plan execution.
|
|
135
153
|
*/
|
|
@@ -146,6 +164,8 @@ export interface PgSchemaDiffPlanOptions {
|
|
|
146
164
|
*/
|
|
147
165
|
tempDbDsn?: string;
|
|
148
166
|
}
|
|
167
|
+
/** Timeout for pg-schema-diff apply / SSOT cleanup (10 minutes) */
|
|
168
|
+
export declare const PG_SCHEMA_DIFF_APPLY_TIMEOUT_MS = 600000;
|
|
149
169
|
/**
|
|
150
170
|
* Execute pg-schema-diff plan and handle errors.
|
|
151
171
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pg-schema-diff-helpers.d.ts","sourceRoot":"","sources":["../../../../../src/commands/db/apply/helpers/pg-schema-diff-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAOH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"pg-schema-diff-helpers.d.ts","sourceRoot":"","sources":["../../../../../src/commands/db/apply/helpers/pg-schema-diff-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AA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,CAyBrF;AAMD;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CAWtE;AAMD;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;;;;;;;OASG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAKD,mEAAmE;AACnE,eAAO,MAAM,+BAA+B,SAAU,CAAC;AAEvD;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,MAAM,EAAE,EACxB,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,uBAAuB,GAChC;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CA8D5C"}
|
|
@@ -49,6 +49,39 @@ export type ValidatedPlan = z.infer<typeof ValidatedPlanSchema>;
|
|
|
49
49
|
* @throws ZodError if parsed result fails structural validation
|
|
50
50
|
*/
|
|
51
51
|
export declare function parsePlanOutput(planOutput: string): ValidatedPlan;
|
|
52
|
+
export interface FilterResult {
|
|
53
|
+
filteredPlan: ValidatedPlan;
|
|
54
|
+
removedStatements: PlanStatement[];
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Check if a DROP statement targets a protected (idempotent-managed) table or index.
|
|
58
|
+
*
|
|
59
|
+
* Matching rules:
|
|
60
|
+
* - DROP TABLE [IF EXISTS] schema.table → exact match or glob match
|
|
61
|
+
* - DROP INDEX [IF EXISTS] schema.idx_* → index in same schema as protected table
|
|
62
|
+
*
|
|
63
|
+
* Glob support: patterns with `*` (e.g., `location_data.location_events_*`)
|
|
64
|
+
* are converted to regex for matching partition child tables.
|
|
65
|
+
*/
|
|
66
|
+
declare function isDropStatementForProtected(sql: string, protectedTables: string[]): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Extract unique schema names from protected table patterns.
|
|
69
|
+
* e.g., ['location_data.events', 'accounts.clients'] → ['location_data', 'accounts']
|
|
70
|
+
*/
|
|
71
|
+
declare function extractProtectedSchemas(protectedTables: string[]): string[];
|
|
72
|
+
/**
|
|
73
|
+
* Check if a SQL statement is a DROP SCHEMA targeting a protected schema.
|
|
74
|
+
* Returns the schema name if protected, null otherwise.
|
|
75
|
+
*/
|
|
76
|
+
declare function isDropSchemaForProtected(sql: string, protectedTables: string[]): string | null;
|
|
77
|
+
/**
|
|
78
|
+
* Filter out DROP TABLE/INDEX statements targeting idempotent-managed tables.
|
|
79
|
+
* BLOCKS (throws error) on DROP SCHEMA targeting protected schemas.
|
|
80
|
+
*/
|
|
81
|
+
export declare function filterIdempotentProtectedStatements(plan: ValidatedPlan, protectedTables: string[]): FilterResult;
|
|
82
|
+
export { isDropStatementForProtected as _isDropStatementForProtected };
|
|
83
|
+
export { extractProtectedSchemas as _extractProtectedSchemas };
|
|
84
|
+
export { isDropSchemaForProtected as _isDropSchemaForProtected };
|
|
52
85
|
/**
|
|
53
86
|
* Validate that all hazards in the plan are in the allowed list.
|
|
54
87
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan-validator.d.ts","sourceRoot":"","sources":["../../../../../src/commands/db/apply/helpers/plan-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,gBAAgB;;;iBAG3B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;iBAI9B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;iBAI9B,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,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,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,CAYvF;AAED;;;GAGG;AACH,wBAAgB,mCAAmC,CACjD,IAAI,EAAE,aAAa,EACnB,eAAe,EAAE,MAAM,EAAE,GACxB,YAAY,CAkDd;AAGD,OAAO,EAAE,2BAA2B,IAAI,4BAA4B,EAAE,CAAC;AACvE,OAAO,EAAE,uBAAuB,IAAI,wBAAwB,EAAE,CAAC;AAC/D,OAAO,EAAE,wBAAwB,IAAI,yBAAyB,EAAE,CAAC;AAMjE;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,EAAE,GAAG,IAAI,CAehG"}
|
|
@@ -48,6 +48,16 @@ export declare function isLockTimeoutError(errorOutput: string): boolean;
|
|
|
48
48
|
* Enhanced with configurable options and metrics.
|
|
49
49
|
*/
|
|
50
50
|
export declare function executeApplyWithRetry(applyArgs: string[], verbose: boolean, config?: RetryConfig): Promise<RetryResult>;
|
|
51
|
+
/**
|
|
52
|
+
* Wrap plan SQL for execution.
|
|
53
|
+
*
|
|
54
|
+
* PostgreSQL DDL is transactional (except CREATE INDEX CONCURRENTLY),
|
|
55
|
+
* so we wrap in BEGIN/COMMIT to prevent partial apply on failure.
|
|
56
|
+
*
|
|
57
|
+
* If the plan contains CREATE INDEX CONCURRENTLY, we skip the transaction
|
|
58
|
+
* wrapper because CONCURRENTLY cannot run inside a transaction block.
|
|
59
|
+
*/
|
|
60
|
+
export declare function wrapPlanSql(planSql: string): string;
|
|
51
61
|
/**
|
|
52
62
|
* Options for plan+psql execution with retry.
|
|
53
63
|
*/
|
|
@@ -63,6 +73,11 @@ export interface PlanSqlRetryConfig extends RetryConfig {
|
|
|
63
73
|
* If omitted, hazard validation is skipped (primary check in actors.ts handles it).
|
|
64
74
|
*/
|
|
65
75
|
allowedHazardTypes?: string[];
|
|
76
|
+
/**
|
|
77
|
+
* Tables managed by idempotent SQL — DROP statements for these are filtered.
|
|
78
|
+
* Prevents pg-schema-diff from dropping tables it doesn't know about.
|
|
79
|
+
*/
|
|
80
|
+
protectedTables?: string[];
|
|
66
81
|
}
|
|
67
82
|
/**
|
|
68
83
|
* Execute plan SQL via psql with retry logic.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retry-logic.d.ts","sourceRoot":"","sources":["../../../../../src/commands/db/apply/helpers/retry-logic.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"retry-logic.d.ts","sourceRoot":"","sources":["../../../../../src/commands/db/apply/helpers/retry-logic.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAkBH,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,aAAa,OAAO,CAAC;AAClC,eAAO,MAAM,oBAAoB,QAAQ,CAAC;AAE1C;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,uCAAuC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kEAAkE;IAClE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oCAAoC;IACpC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,iEAAiE;IACjE,QAAQ,EAAE,MAAM,CAAC;IACjB,oDAAoD;IACpD,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE/C;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,SAAuB,GAAG,MAAM,CAIhG;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAO/D;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CACzC,SAAS,EAAE,MAAM,EAAE,EACnB,OAAO,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,WAAW,CAAC,CA4EtB;AAMD;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAKnD;AAMD;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,WAAW;IACrD;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IAC/B;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED;;;;;;;GAOG;AACH,wBAAsB,uBAAuB,CAC3C,KAAK,EAAE,MAAM,EACb,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,kBAAkB,GAC1B,OAAO,CAAC,WAAW,CAAC,CAoHtB"}
|
|
@@ -38,6 +38,19 @@ export interface ShadowDbResult {
|
|
|
38
38
|
/** Cleanup function to drop the shadow database */
|
|
39
39
|
cleanup: () => Promise<void>;
|
|
40
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Clean up orphaned shadow databases from previous interrupted runs.
|
|
43
|
+
*
|
|
44
|
+
* Shadow DBs follow the naming pattern: pg_schema_diff_shadow_{id}
|
|
45
|
+
* where {id} is either a timestamp (legacy) or a UUID hex fragment (current).
|
|
46
|
+
* If a process was killed (SIGKILL) or crashed, the shadow DB may remain.
|
|
47
|
+
*
|
|
48
|
+
* Uses pg_stat_file() on the database directory to determine age,
|
|
49
|
+
* which works regardless of the naming format.
|
|
50
|
+
*
|
|
51
|
+
* Non-fatal: any failure is logged and silently ignored.
|
|
52
|
+
*/
|
|
53
|
+
export declare function cleanupOrphanShadowDatabases(sourceDbUrl: string): void;
|
|
41
54
|
/**
|
|
42
55
|
* Create a shadow database with specified extensions installed.
|
|
43
56
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shadow-db-manager.d.ts","sourceRoot":"","sources":["../../../../../src/commands/db/apply/helpers/shadow-db-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;
|
|
1
|
+
{"version":3,"file":"shadow-db-manager.d.ts","sourceRoot":"","sources":["../../../../../src/commands/db/apply/helpers/shadow-db-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAYH,MAAM,WAAW,cAAc;IAC7B,yCAAyC;IACzC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,oDAAoD;IACpD,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,cAAc;IAC7B,2CAA2C;IAC3C,GAAG,EAAE,MAAM,CAAC;IACZ,4BAA4B;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B;AAkUD;;;;;;;;;;;GAWG;AACH,wBAAgB,4BAA4B,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CA6BtE;AAMD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,4BAA4B,CAChD,MAAM,EAAE,cAAc,GACrB,OAAO,CAAC,cAAc,CAAC,CA2CzB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,SAAS,GAAG,OAAO,CAEvE"}
|
|
@@ -42,11 +42,13 @@ interface DbApplyContext {
|
|
|
42
42
|
idempotentPostSkipped: number;
|
|
43
43
|
rolePasswordsSet: number;
|
|
44
44
|
schemaChangesApplied: boolean;
|
|
45
|
+
dataViolations: number;
|
|
45
46
|
hazards: string[];
|
|
46
47
|
seedsApplied: boolean;
|
|
47
48
|
partitionWarnings: string[];
|
|
48
49
|
error: string | null;
|
|
49
50
|
planSql: string | null;
|
|
51
|
+
ssotWarning: string | null;
|
|
50
52
|
startTime: number;
|
|
51
53
|
idempotentPreStartTime: number | null;
|
|
52
54
|
idempotentPreEndTime: number | null;
|
|
@@ -129,13 +131,13 @@ export declare const dbApplyMachine: import("xstate").StateMachine<DbApplyContex
|
|
|
129
131
|
error?: string | undefined;
|
|
130
132
|
planSql?: string | undefined;
|
|
131
133
|
checkOnly?: boolean | undefined;
|
|
134
|
+
dataViolations?: number | undefined;
|
|
135
|
+
ssotWarning?: string | undefined;
|
|
132
136
|
partitionWarnings?: string[] | undefined;
|
|
133
137
|
metrics?: {
|
|
134
138
|
totalMs: number;
|
|
135
139
|
idempotentMs?: number | undefined;
|
|
136
|
-
planMs?: number | undefined;
|
|
137
140
|
applyMs?: number | undefined;
|
|
138
|
-
codegenMs?: number | undefined;
|
|
139
141
|
seedMs?: number | undefined;
|
|
140
142
|
retryAttempts?: number | undefined;
|
|
141
143
|
} | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"machine.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/apply/machine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,EAAU,KAAK,YAAY,EAAS,MAAM,QAAQ,CAAC;AAE1D,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,EAAE,YAAY,EAAiC,MAAM,eAAe,CAAC;AAuGjF,UAAU,cAAc;IACtB,KAAK,EAAE,YAAY,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAElB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,gBAAgB,EAAE,MAAM,CAAC;IACzB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,OAAO,EAAE,MAA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,MAAM,GAAG,IAAI,CAAC;IACvC,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;CACvB;AAID,eAAO,MAAM,cAAc;UAFC,OAAO;;UAAa,gBAAgB;WAAS,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAI1D,YAAY;eAAa,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqRjD,CAAC;AAGH,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAC;AACnD,MAAM,MAAM,eAAe,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC;AAGlE,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,CAErE;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,eAAe,GAAG,OAAO,CAEpE;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,GAAG,IAAI,CAExE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db-apply.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/commands/db-apply.ts"],"names":[],"mappings":"AAoCA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"db-apply.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/commands/db-apply.ts"],"names":[],"mappings":"AAoCA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA6NpC;;GAEG;AACH,eAAO,MAAM,YAAY,SAuDrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db-drizzle.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/commands/db-drizzle.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"db-drizzle.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/commands/db-drizzle.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAwTpC;;;;;;;;;GASG;AACH,eAAO,MAAM,WAAW,SAgCrB,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,WAAW,SAiCpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db-seed.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/commands/db-seed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAmBH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"db-seed.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/commands/db-seed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAmBH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGpD;;GAEG;AACH,eAAO,MAAM,eAAe,SAqBxB,CAAC;AAEL;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,gBAAgB,EACzB,OAAO,CAAC,EAAE,OAAO,GAChB,OAAO,CAAC,IAAI,CAAC,CA0Hf;AAmDD;;GAEG;AACH,eAAO,MAAM,mBAAmB,SA2B5B,CAAC;AAEL;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,SA6B5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actors.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/sync/actors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAwBH,OAAO,KAAK,EACV,kBAAkB,EAIlB,WAAW,EAEZ,MAAM,eAAe,CAAC;AAMvB,MAAM,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,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AA+CD;;GAEG;AACH,eAAO,MAAM,YAAY,2FAiCxB,CAAC;AAMF,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,WAAW,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;GAEG;AACH,eAAO,MAAM,SAAS;;;;;gDA8FrB,CAAC;AAMF,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,WAAW,CAAC;CAClB;AAED;;GAEG;AACH,eAAO,MAAM,SAAS;;;;gDA2BrB,CAAC;AAMF,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,WAAW,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;CACvB;AAED;;GAEG;AACH,eAAO,MAAM,QAAQ;;;;;+CAsCpB,CAAC;AAMF,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,WAAW,CAAC;CAClB;AAED;;GAEG;AACH,eAAO,MAAM,UAAU;;;;2CAiCtB,CAAC;AAMF,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,WAAW,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,eAAO,MAAM,WAAW,6FA0FvB,CAAC"}
|
|
@@ -108,6 +108,7 @@ export declare const StepContextSchema: z.ZodObject<{
|
|
|
108
108
|
skipCodegen: z.ZodBoolean;
|
|
109
109
|
fromProduction: z.ZodBoolean;
|
|
110
110
|
autoSnapshot: z.ZodBoolean;
|
|
111
|
+
noSeed: z.ZodBoolean;
|
|
111
112
|
reportJson: z.ZodOptional<z.ZodString>;
|
|
112
113
|
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
113
114
|
configTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
@@ -150,6 +151,7 @@ export declare const DbSyncMachineInputSchema: z.ZodObject<{
|
|
|
150
151
|
targetDir: z.ZodOptional<z.ZodString>;
|
|
151
152
|
fromProduction: z.ZodOptional<z.ZodBoolean>;
|
|
152
153
|
autoSnapshot: z.ZodOptional<z.ZodBoolean>;
|
|
154
|
+
noSeed: z.ZodOptional<z.ZodBoolean>;
|
|
153
155
|
reportJson: z.ZodOptional<z.ZodString>;
|
|
154
156
|
reconcile: z.ZodOptional<z.ZodBoolean>;
|
|
155
157
|
timeoutMs: z.ZodOptional<z.ZodNumber>;
|