@everystack/cli 0.4.60 → 0.4.64
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/package.json +19 -2
- package/src/backfill.ts +3 -3
- package/src/cli/alter-type-dependents.ts +1 -1
- package/src/cli/apply-authority.ts +1 -1
- package/src/cli/apply-execute.ts +10 -10
- package/src/cli/audit-api.ts +4 -4
- package/src/cli/audit-source-api.ts +2 -2
- package/src/cli/authz-adoption-class.ts +4 -4
- package/src/cli/authz-baseline.ts +2 -2
- package/src/cli/authz-canonical.ts +2 -2
- package/src/cli/authz-compile.ts +3 -3
- package/src/cli/authz-contract-io.ts +2 -2
- package/src/cli/authz-contract.ts +4 -4
- package/src/cli/authz-derive.ts +2 -2
- package/src/cli/authz-identity.ts +1 -1
- package/src/cli/authz-ownership.ts +1 -1
- package/src/cli/authz-reconcile.ts +4 -4
- package/src/cli/authz-redteam.ts +1 -1
- package/src/cli/authz-render.ts +2 -2
- package/src/cli/aws.ts +57 -4
- package/src/cli/backfill.ts +3 -3
- package/src/cli/branch-db.ts +5 -5
- package/src/cli/bundle-weight.ts +2 -2
- package/src/cli/commands/analyze.ts +2 -2
- package/src/cli/commands/audit.ts +10 -10
- package/src/cli/commands/bundle.ts +6 -6
- package/src/cli/commands/cache.ts +75 -3
- package/src/cli/commands/console.ts +6 -6
- package/src/cli/commands/db-apply.ts +25 -25
- package/src/cli/commands/db-approvers.ts +4 -4
- package/src/cli/commands/db-authz.ts +15 -15
- package/src/cli/commands/db-backfill.ts +10 -10
- package/src/cli/commands/db-backup.ts +7 -7
- package/src/cli/commands/db-branch.ts +8 -8
- package/src/cli/commands/db-build.ts +7 -7
- package/src/cli/commands/db-check.ts +16 -16
- package/src/cli/commands/db-diff.ts +6 -6
- package/src/cli/commands/db-exec.ts +8 -8
- package/src/cli/commands/db-export.ts +10 -10
- package/src/cli/commands/db-fingerprint.ts +14 -14
- package/src/cli/commands/db-fork.ts +6 -6
- package/src/cli/commands/db-generate.ts +19 -19
- package/src/cli/commands/db-plan.ts +25 -25
- package/src/cli/commands/db-pull.ts +18 -18
- package/src/cli/commands/db-reconcile.ts +14 -14
- package/src/cli/commands/db-refresh.ts +7 -7
- package/src/cli/commands/db-snapshot.ts +5 -5
- package/src/cli/commands/db-swap.ts +26 -26
- package/src/cli/commands/db-sync.ts +18 -18
- package/src/cli/commands/db.ts +283 -18
- package/src/cli/commands/deploy.ts +39 -5
- package/src/cli/commands/diag.ts +10 -10
- package/src/cli/commands/lighthouse.ts +3 -3
- package/src/cli/commands/logs.ts +5 -5
- package/src/cli/commands/pipeline-run.ts +7 -7
- package/src/cli/commands/runbook.ts +5 -5
- package/src/cli/commands/secrets.ts +5 -5
- package/src/cli/commands/security-probe.ts +4 -4
- package/src/cli/commands/security.ts +6 -6
- package/src/cli/commands/status.ts +3 -3
- package/src/cli/commands/task-probe.ts +4 -4
- package/src/cli/commands/ui-audit.ts +5 -5
- package/src/cli/commands/update.ts +64 -8
- package/src/cli/component-audit.ts +5 -5
- package/src/cli/config.ts +2 -2
- package/src/cli/db-build.ts +6 -6
- package/src/cli/db-source.ts +2 -2
- package/src/cli/declared-derived.ts +5 -5
- package/src/cli/declared-diff.ts +5 -5
- package/src/cli/deploy-probe.ts +3 -3
- package/src/cli/derived-apply.ts +5 -5
- package/src/cli/derived-compile.ts +4 -4
- package/src/cli/derived-grants.ts +1 -1
- package/src/cli/derived-introspect.ts +3 -3
- package/src/cli/derived-lint.ts +2 -2
- package/src/cli/derived-plan.ts +5 -5
- package/src/cli/derived-render.ts +6 -6
- package/src/cli/direct-venue.ts +2 -2
- package/src/cli/discover.ts +2 -2
- package/src/cli/edge-plan.ts +8 -8
- package/src/cli/exec-digest.ts +1 -1
- package/src/cli/exec-execute.ts +1 -1
- package/src/cli/exec-log.ts +1 -1
- package/src/cli/exec-run.ts +2 -2
- package/src/cli/git-descent.ts +5 -5
- package/src/cli/index.ts +48 -47
- package/src/cli/migration-compile.ts +7 -7
- package/src/cli/migration-generate.ts +6 -6
- package/src/cli/model-api.ts +16 -16
- package/src/cli/model-render.ts +6 -6
- package/src/cli/mutation-lease.ts +1 -1
- package/src/cli/observability.ts +1 -1
- package/src/cli/refresh-execute.ts +2 -2
- package/src/cli/runbook/generate.ts +3 -3
- package/src/cli/runbook/index.ts +7 -7
- package/src/cli/runbook/sections.ts +2 -2
- package/src/cli/schema-compile.ts +4 -4
- package/src/cli/schema-diff.ts +1 -1
- package/src/cli/schema-fingerprint.ts +7 -7
- package/src/cli/schema-introspect.ts +3 -3
- package/src/cli/schema-source.ts +1 -1
- package/src/cli/schema-swap.ts +4 -4
- package/src/cli/security-catalog.ts +1 -1
- package/src/cli/stage-backup.ts +3 -3
- package/src/cli/stage-read-consistency.ts +6 -6
- package/src/cli/state-apply.ts +7 -7
- package/src/cli/swap-execute.ts +3 -3
- package/src/cli/swap-heartbeat.ts +1 -1
- package/src/cli/swap-pair.ts +7 -7
- package/src/cli/task-poll.ts +2 -2
- package/src/cli/ui-bloat.ts +1 -1
- package/src/cli/utils/secrets.ts +1 -1
- package/src/exec.ts +7 -7
- package/src/reconcile.ts +2 -2
- package/src/refresh.ts +2 -2
- package/src/sst.ts +1 -1
|
@@ -43,31 +43,31 @@
|
|
|
43
43
|
import fs from 'node:fs/promises';
|
|
44
44
|
import { spawnSync } from 'node:child_process';
|
|
45
45
|
import type { ModelDescriptor } from '@everystack/model';
|
|
46
|
-
import { introspectContract, type QueryRunner, type AuthzContract } from '../authz-contract
|
|
47
|
-
import { classifyAdoption, renderAdoptionReport } from '../authz-adoption-class
|
|
48
|
-
import { introspectTableOwners, buildOwnershipReport, renderOwnershipReport } from '../authz-ownership
|
|
49
|
-
import { introspectSchema, type SchemaSnapshot } from '../schema-introspect
|
|
50
|
-
import { readStageStateTwice } from '../stage-read-consistency
|
|
51
|
-
import { FUNCTIONS_SQL, contractFunctionRow } from '../security-catalog
|
|
52
|
-
import { mintEdgePlan, planHash, buildPlanSummary } from '../edge-plan
|
|
53
|
-
import { verifyDescent } from '../git-descent
|
|
54
|
-
import { planBackfills, readBackfillLog } from '../backfill
|
|
55
|
-
import { readSqlDirIfPresent } from './db-sync
|
|
56
|
-
import { currentGitRef } from '../state-apply
|
|
57
|
-
import { resolveDbSource, createUrlRunner, connectingVia, type DbSource } from '../db-source
|
|
58
|
-
import { borrowedSessionRunner, type SessionRunner } from '../session
|
|
59
|
-
import { resolveModelsPath } from '../models-path
|
|
60
|
-
import { resolveConfig, opsFunction } from '../config
|
|
61
|
-
import { resolveOperatorUrlViaStage } from '../direct-venue
|
|
62
|
-
import { lambdaQueryRunner, lambdaSessionRunner } from '../aws
|
|
63
|
-
import { loadModels } from './db-generate
|
|
64
|
-
import { loadDeclaredDerived } from '../declared-derived
|
|
65
|
-
import { governedRoleSet, ungovernedGrants } from '../authz-reconcile
|
|
66
|
-
import { readBaselineFile, checkAgainstBaseline, baselineRefusal } from '../authz-baseline
|
|
67
|
-
import { alterTypeStatementTargets, findAlterTypeDependents, renderAlterTypeRefusal } from '../alter-type-dependents
|
|
68
|
-
import { compileTableContract } from '../authz-compile
|
|
69
|
-
import { reportPipelineLastRun } from './pipeline-run
|
|
70
|
-
import { step, success, fail, info, warn, reserveStdoutForData } from '../output
|
|
46
|
+
import { introspectContract, type QueryRunner, type AuthzContract } from '../authz-contract';
|
|
47
|
+
import { classifyAdoption, renderAdoptionReport } from '../authz-adoption-class';
|
|
48
|
+
import { introspectTableOwners, buildOwnershipReport, renderOwnershipReport } from '../authz-ownership';
|
|
49
|
+
import { introspectSchema, type SchemaSnapshot } from '../schema-introspect';
|
|
50
|
+
import { readStageStateTwice } from '../stage-read-consistency';
|
|
51
|
+
import { FUNCTIONS_SQL, contractFunctionRow } from '../security-catalog';
|
|
52
|
+
import { mintEdgePlan, planHash, buildPlanSummary } from '../edge-plan';
|
|
53
|
+
import { verifyDescent } from '../git-descent';
|
|
54
|
+
import { planBackfills, readBackfillLog } from '../backfill';
|
|
55
|
+
import { readSqlDirIfPresent } from './db-sync';
|
|
56
|
+
import { currentGitRef } from '../state-apply';
|
|
57
|
+
import { resolveDbSource, createUrlRunner, connectingVia, type DbSource } from '../db-source';
|
|
58
|
+
import { borrowedSessionRunner, type SessionRunner } from '../session';
|
|
59
|
+
import { resolveModelsPath } from '../models-path';
|
|
60
|
+
import { resolveConfig, opsFunction } from '../config';
|
|
61
|
+
import { resolveOperatorUrlViaStage } from '../direct-venue';
|
|
62
|
+
import { lambdaQueryRunner, lambdaSessionRunner } from '../aws';
|
|
63
|
+
import { loadModels } from './db-generate';
|
|
64
|
+
import { loadDeclaredDerived } from '../declared-derived';
|
|
65
|
+
import { governedRoleSet, ungovernedGrants } from '../authz-reconcile';
|
|
66
|
+
import { readBaselineFile, checkAgainstBaseline, baselineRefusal } from '../authz-baseline';
|
|
67
|
+
import { alterTypeStatementTargets, findAlterTypeDependents, renderAlterTypeRefusal } from '../alter-type-dependents';
|
|
68
|
+
import { compileTableContract } from '../authz-compile';
|
|
69
|
+
import { reportPipelineLastRun } from './pipeline-run';
|
|
70
|
+
import { step, success, fail, info, warn, reserveStdoutForData } from '../output';
|
|
71
71
|
|
|
72
72
|
const DEFAULT_OUT = 'db.plan.json';
|
|
73
73
|
|
|
@@ -33,24 +33,24 @@
|
|
|
33
33
|
|
|
34
34
|
import fs from 'node:fs/promises';
|
|
35
35
|
import path from 'node:path';
|
|
36
|
-
import { introspectSchema, MATVIEW_COLUMNS_SQL, matviewColumnsByIdentity, type ColumnRow, type ColumnSchema } from '../schema-introspect
|
|
37
|
-
import { fingerprintLive } from '../schema-fingerprint
|
|
38
|
-
import { ungovernedGrants, vestigialSequenceGrants, renderVestigialSequenceGrants, ALWAYS_GOVERNED, type GrantExemption } from '../authz-reconcile
|
|
39
|
-
import { buildStageBaseline, mergeBaseline, readBaselineFile, writeBaselineFile, BASELINE_FILE } from '../authz-baseline
|
|
40
|
-
import { introspectDerived, type DerivedCatalog } from '../derived-introspect
|
|
41
|
-
import { introspectContract, type TableContract, type AuthzContract } from '../authz-contract
|
|
42
|
-
import { introspectTableOwners, buildOwnershipReport, renderOwnershipReport, type TableOwner } from '../authz-ownership
|
|
43
|
-
import { FUNCTIONS_SQL, contractFunctionRow } from '../security-catalog
|
|
44
|
-
import { renderDerivedSource, renderDerivedFile, type DerivedRenderResult } from '../derived-render
|
|
45
|
-
import { renderModelSource, renderModelFiles, pullableTables, skippedInfrastructureTables, modelVarName, ABILITY_PRESETS } from '../model-render
|
|
46
|
-
import { deriveAbilities } from '../authz-derive
|
|
47
|
-
import type { QueryRunner } from '../authz-contract
|
|
48
|
-
import { resolveDbSource, createUrlRunner, connectingVia, type DbSource } from '../db-source
|
|
49
|
-
import { borrowedSessionRunner, type SessionRunner } from '../session
|
|
50
|
-
import { resolveConfig, opsFunction } from '../config
|
|
51
|
-
import { invokeAction, lambdaQueryRunner, lambdaSessionRunner } from '../aws
|
|
52
|
-
import { fail } from '../output
|
|
53
|
-
import { opsAdviceLines } from '../ops-advice
|
|
36
|
+
import { introspectSchema, MATVIEW_COLUMNS_SQL, matviewColumnsByIdentity, type ColumnRow, type ColumnSchema } from '../schema-introspect';
|
|
37
|
+
import { fingerprintLive } from '../schema-fingerprint';
|
|
38
|
+
import { ungovernedGrants, vestigialSequenceGrants, renderVestigialSequenceGrants, ALWAYS_GOVERNED, type GrantExemption } from '../authz-reconcile';
|
|
39
|
+
import { buildStageBaseline, mergeBaseline, readBaselineFile, writeBaselineFile, BASELINE_FILE } from '../authz-baseline';
|
|
40
|
+
import { introspectDerived, type DerivedCatalog } from '../derived-introspect';
|
|
41
|
+
import { introspectContract, type TableContract, type AuthzContract } from '../authz-contract';
|
|
42
|
+
import { introspectTableOwners, buildOwnershipReport, renderOwnershipReport, type TableOwner } from '../authz-ownership';
|
|
43
|
+
import { FUNCTIONS_SQL, contractFunctionRow } from '../security-catalog';
|
|
44
|
+
import { renderDerivedSource, renderDerivedFile, type DerivedRenderResult } from '../derived-render';
|
|
45
|
+
import { renderModelSource, renderModelFiles, pullableTables, skippedInfrastructureTables, modelVarName, ABILITY_PRESETS } from '../model-render';
|
|
46
|
+
import { deriveAbilities } from '../authz-derive';
|
|
47
|
+
import type { QueryRunner } from '../authz-contract';
|
|
48
|
+
import { resolveDbSource, createUrlRunner, connectingVia, type DbSource } from '../db-source';
|
|
49
|
+
import { borrowedSessionRunner, type SessionRunner } from '../session';
|
|
50
|
+
import { resolveConfig, opsFunction } from '../config';
|
|
51
|
+
import { invokeAction, lambdaQueryRunner, lambdaSessionRunner } from '../aws';
|
|
52
|
+
import { fail } from '../output';
|
|
53
|
+
import { opsAdviceLines } from '../ops-advice';
|
|
54
54
|
|
|
55
55
|
// Progress → stderr, so stdout carries only the rendered source (this command is codegen,
|
|
56
56
|
// not a report — the shared output helpers write to stdout, which would corrupt a redirect).
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
* runs it direct. A stage DRY-RUN (no `--apply`) reads through the `db:query` path.
|
|
30
30
|
*/
|
|
31
31
|
|
|
32
|
-
import type { QueryRunner } from '../authz-contract
|
|
33
|
-
import type { SourceObject } from '../derived-source
|
|
34
|
-
import { introspectDerived } from '../derived-introspect
|
|
35
|
-
import { planReconcile, type ReconcilePlan, type ReconcileOptions } from '../derived-plan
|
|
32
|
+
import type { QueryRunner } from '../authz-contract';
|
|
33
|
+
import type { SourceObject } from '../derived-source';
|
|
34
|
+
import { introspectDerived } from '../derived-introspect';
|
|
35
|
+
import { planReconcile, type ReconcilePlan, type ReconcileOptions } from '../derived-plan';
|
|
36
36
|
import {
|
|
37
37
|
renderReconcileSql,
|
|
38
38
|
renderProvenanceUpsert,
|
|
@@ -49,16 +49,16 @@ import {
|
|
|
49
49
|
builderOwnerMode,
|
|
50
50
|
type OwnerApplyMode,
|
|
51
51
|
ENSURE_RECONCILER_SQL,
|
|
52
|
-
} from '../derived-apply
|
|
53
|
-
import { resolveDbSource, createUrlRunner, connectingVia, type DbSource } from '../db-source
|
|
54
|
-
import { borrowedSessionRunner, type SessionRunner } from '../session
|
|
55
|
-
import { resolveOperatorUrlViaStage } from '../direct-venue
|
|
56
|
-
import { withMutationLease, MutationLeaseError } from '../mutation-lease
|
|
57
|
-
import { loadDeclaredDerived, retiredSqlDirAnywhere, retiredSqlDirFlagRefusal, type DeclaredDerived } from '../declared-derived
|
|
58
|
-
import { currentGitRef } from '../state-apply
|
|
59
|
-
import { resolveConfig, opsFunction } from '../config
|
|
60
|
-
import { invokeAction, lambdaQueryRunner, lambdaSessionRunner } from '../aws
|
|
61
|
-
import { step, success, fail, info, warn } from '../output
|
|
52
|
+
} from '../derived-apply';
|
|
53
|
+
import { resolveDbSource, createUrlRunner, connectingVia, type DbSource } from '../db-source';
|
|
54
|
+
import { borrowedSessionRunner, type SessionRunner } from '../session';
|
|
55
|
+
import { resolveOperatorUrlViaStage } from '../direct-venue';
|
|
56
|
+
import { withMutationLease, MutationLeaseError } from '../mutation-lease';
|
|
57
|
+
import { loadDeclaredDerived, retiredSqlDirAnywhere, retiredSqlDirFlagRefusal, type DeclaredDerived } from '../declared-derived';
|
|
58
|
+
import { currentGitRef } from '../state-apply';
|
|
59
|
+
import { resolveConfig, opsFunction } from '../config';
|
|
60
|
+
import { invokeAction, lambdaQueryRunner, lambdaSessionRunner } from '../aws';
|
|
61
|
+
import { step, success, fail, info, warn } from '../output';
|
|
62
62
|
|
|
63
63
|
// ---------------------------------------------------------------------------
|
|
64
64
|
// The testable core.
|
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
* they did not choose.
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
-
import { resolveDbSource, createUrlRunner, connectingVia, type DbSource } from '../db-source
|
|
27
|
-
import { loadDeclaredDerived } from '../declared-derived
|
|
28
|
-
import { executeRefresh, matviewIdentities, type RefreshRun } from '../refresh-execute
|
|
29
|
-
import { resolveConfig, opsFunction } from '../config
|
|
30
|
-
import { resolveOperatorUrlViaStage } from '../direct-venue
|
|
31
|
-
import { invokeAction } from '../aws
|
|
32
|
-
import { step, success, fail, info } from '../output
|
|
26
|
+
import { resolveDbSource, createUrlRunner, connectingVia, type DbSource } from '../db-source';
|
|
27
|
+
import { loadDeclaredDerived } from '../declared-derived';
|
|
28
|
+
import { executeRefresh, matviewIdentities, type RefreshRun } from '../refresh-execute';
|
|
29
|
+
import { resolveConfig, opsFunction } from '../config';
|
|
30
|
+
import { resolveOperatorUrlViaStage } from '../direct-venue';
|
|
31
|
+
import { invokeAction } from '../aws';
|
|
32
|
+
import { step, success, fail, info } from '../output';
|
|
33
33
|
|
|
34
34
|
export async function dbRefreshCommand(flags: Record<string, string>): Promise<void> {
|
|
35
35
|
// The declared matviews, in dependency order (a dependent matview reads its parents' fresh rows).
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
* docs/plans/db-backup-restore.md.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import { resolveConfig, type CliConfig } from '../config
|
|
11
|
-
import { createRdsSnapshot, describeRdsSnapshots, type RdsSnapshotSummary } from '../aws
|
|
12
|
-
import { utcStamp } from '../backup
|
|
13
|
-
import { rdsSnapshotIdentifier } from '../rds-snapshot
|
|
14
|
-
import { step, success, fail, info } from '../output
|
|
10
|
+
import { resolveConfig, type CliConfig } from '../config';
|
|
11
|
+
import { createRdsSnapshot, describeRdsSnapshots, type RdsSnapshotSummary } from '../aws';
|
|
12
|
+
import { utcStamp } from '../backup';
|
|
13
|
+
import { rdsSnapshotIdentifier } from '../rds-snapshot';
|
|
14
|
+
import { step, success, fail, info } from '../output';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Resolve the RDS DB instance identifier: explicit `--instance` wins, else the deployed
|
|
@@ -22,32 +22,32 @@ import { Transform } from 'node:stream';
|
|
|
22
22
|
import { pipeline } from 'node:stream/promises';
|
|
23
23
|
import { Readable } from 'node:stream';
|
|
24
24
|
import type { ModelDescriptor } from '@everystack/model';
|
|
25
|
-
import { fingerprintModels } from '../schema-fingerprint
|
|
26
|
-
import { resolveModelsPath } from '../models-path
|
|
27
|
-
import { loadModels } from './db-generate
|
|
28
|
-
import { loadDeclaredDerived } from '../declared-derived
|
|
29
|
-
import type { SourceObject } from '../derived-source
|
|
30
|
-
import { pairedDerivedSchemas, renderPairedDerivedBuild, renderSwapSchemaUsage, swapSchemaRoles, expectedIncomingObjects, renderPairedProvenance } from '../swap-pair
|
|
31
|
-
import { introspectDerived } from '../derived-introspect
|
|
32
|
-
import { legacyFunctionIdentity } from '../pg-argtypes
|
|
33
|
-
import { createUrlRunner } from '../db-source
|
|
34
|
-
import { borrowedSessionRunner, type SessionRunner } from '../session
|
|
35
|
-
import type { QueryRunner } from '../authz-contract
|
|
36
|
-
import { executeSwap, type SwapVerdict } from '../swap-execute
|
|
37
|
-
import { startHeartbeat, humanElapsed } from '../swap-heartbeat
|
|
38
|
-
import { formatBytes } from '../bundle-weight
|
|
39
|
-
import { rewriteStatementLine, opensCopyData, closesCopyData } from '../schema-rewrite
|
|
40
|
-
import { resolveOperatorUrlViaStage } from '../direct-venue
|
|
41
|
-
import { withMutationLease, MutationLeaseError } from '../mutation-lease
|
|
42
|
-
import { resolveConfig, opsFunction, type CliConfig } from '../config
|
|
43
|
-
import { invokeAction, presignGet, createRdsSnapshot, describeRdsSnapshots } from '../aws
|
|
44
|
-
import { keyForArtifactId, metaKey, utcStamp } from '../backup
|
|
45
|
-
import { rdsSnapshotIdentifier } from '../rds-snapshot
|
|
46
|
-
import { pollTaskUntilStopped } from '../task-poll
|
|
47
|
-
import { decideSnapshotMode, confirmPhysicalSnapshot, interpretBackupPoll, type SnapshotModeRequest } from '../swap-snapshot
|
|
48
|
-
import { runStageBackup, stageBackupDeps } from '../stage-backup
|
|
49
|
-
import { pgEnvFromUrl, pgKeepaliveConninfo } from './db
|
|
50
|
-
import { step, success, fail, warn, info } from '../output
|
|
25
|
+
import { fingerprintModels } from '../schema-fingerprint';
|
|
26
|
+
import { resolveModelsPath } from '../models-path';
|
|
27
|
+
import { loadModels } from './db-generate';
|
|
28
|
+
import { loadDeclaredDerived } from '../declared-derived';
|
|
29
|
+
import type { SourceObject } from '../derived-source';
|
|
30
|
+
import { pairedDerivedSchemas, renderPairedDerivedBuild, renderSwapSchemaUsage, swapSchemaRoles, expectedIncomingObjects, renderPairedProvenance } from '../swap-pair';
|
|
31
|
+
import { introspectDerived } from '../derived-introspect';
|
|
32
|
+
import { legacyFunctionIdentity } from '../pg-argtypes';
|
|
33
|
+
import { createUrlRunner } from '../db-source';
|
|
34
|
+
import { borrowedSessionRunner, type SessionRunner } from '../session';
|
|
35
|
+
import type { QueryRunner } from '../authz-contract';
|
|
36
|
+
import { executeSwap, type SwapVerdict } from '../swap-execute';
|
|
37
|
+
import { startHeartbeat, humanElapsed } from '../swap-heartbeat';
|
|
38
|
+
import { formatBytes } from '../bundle-weight';
|
|
39
|
+
import { rewriteStatementLine, opensCopyData, closesCopyData } from '../schema-rewrite';
|
|
40
|
+
import { resolveOperatorUrlViaStage } from '../direct-venue';
|
|
41
|
+
import { withMutationLease, MutationLeaseError } from '../mutation-lease';
|
|
42
|
+
import { resolveConfig, opsFunction, type CliConfig } from '../config';
|
|
43
|
+
import { invokeAction, presignGet, createRdsSnapshot, describeRdsSnapshots } from '../aws';
|
|
44
|
+
import { keyForArtifactId, metaKey, utcStamp } from '../backup';
|
|
45
|
+
import { rdsSnapshotIdentifier } from '../rds-snapshot';
|
|
46
|
+
import { pollTaskUntilStopped } from '../task-poll';
|
|
47
|
+
import { decideSnapshotMode, confirmPhysicalSnapshot, interpretBackupPoll, type SnapshotModeRequest } from '../swap-snapshot';
|
|
48
|
+
import { runStageBackup, stageBackupDeps } from '../stage-backup';
|
|
49
|
+
import { pgEnvFromUrl, pgKeepaliveConninfo } from './db';
|
|
50
|
+
import { step, success, fail, warn, info } from '../output';
|
|
51
51
|
|
|
52
52
|
/** A COPY-aware line transform that rewrites the schema token on statement lines only. */
|
|
53
53
|
function schemaRewriteStream(from: string, to: string): Transform {
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
import fs from 'node:fs/promises';
|
|
31
31
|
import path from 'node:path';
|
|
32
32
|
import type { ModelDescriptor } from '@everystack/model';
|
|
33
|
-
import { introspectContract, type QueryRunner } from '../authz-contract
|
|
34
|
-
import { introspectSchema } from '../schema-introspect
|
|
35
|
-
import { FUNCTIONS_SQL, contractFunctionRow } from '../security-catalog
|
|
36
|
-
import { generateMigrationSql, unmodeledTables } from '../migration-generate
|
|
33
|
+
import { introspectContract, type QueryRunner } from '../authz-contract';
|
|
34
|
+
import { introspectSchema } from '../schema-introspect';
|
|
35
|
+
import { FUNCTIONS_SQL, contractFunctionRow } from '../security-catalog';
|
|
36
|
+
import { generateMigrationSql, unmodeledTables } from '../migration-generate';
|
|
37
37
|
import type { SequenceDescriptor } from '@everystack/model';
|
|
38
|
-
import type { SourceObject } from '../derived-source
|
|
38
|
+
import type { SourceObject } from '../derived-source';
|
|
39
39
|
import {
|
|
40
40
|
applyStateAndVerify,
|
|
41
41
|
classifyGeneratedStatements,
|
|
@@ -43,19 +43,19 @@ import {
|
|
|
43
43
|
currentGitRef,
|
|
44
44
|
type ClassifiedStatements,
|
|
45
45
|
type StateSyncOutcome,
|
|
46
|
-
} from '../state-apply
|
|
47
|
-
import { fingerprintModels } from '../schema-fingerprint
|
|
48
|
-
import { compileDrizzleSource } from '../schema-source
|
|
49
|
-
import type { SourceFile } from '../derived-source
|
|
50
|
-
import { resolveDbSource, createUrlRunner, connectingVia, type DbSource } from '../db-source
|
|
51
|
-
import { borrowedSessionRunner, type SessionRunner } from '../session
|
|
52
|
-
import { planBackfills, readBackfillLog } from '../backfill
|
|
53
|
-
import { resolveModelsPath } from '../models-path
|
|
54
|
-
import { executeReconcile, buildReconcileReport, type ReconcileRun } from './db-reconcile
|
|
55
|
-
import { loadModels } from './db-generate
|
|
56
|
-
import { loadDeclaredDerived, retiredSqlDirAnywhere, retiredSqlDirFlagRefusal, type DeclaredDerived } from '../declared-derived
|
|
57
|
-
import { reportPipelineLastRun } from './pipeline-run
|
|
58
|
-
import { step, success, fail, info, warn } from '../output
|
|
46
|
+
} from '../state-apply';
|
|
47
|
+
import { fingerprintModels } from '../schema-fingerprint';
|
|
48
|
+
import { compileDrizzleSource } from '../schema-source';
|
|
49
|
+
import type { SourceFile } from '../derived-source';
|
|
50
|
+
import { resolveDbSource, createUrlRunner, connectingVia, type DbSource } from '../db-source';
|
|
51
|
+
import { borrowedSessionRunner, type SessionRunner } from '../session';
|
|
52
|
+
import { planBackfills, readBackfillLog } from '../backfill';
|
|
53
|
+
import { resolveModelsPath } from '../models-path';
|
|
54
|
+
import { executeReconcile, buildReconcileReport, type ReconcileRun } from './db-reconcile';
|
|
55
|
+
import { loadModels } from './db-generate';
|
|
56
|
+
import { loadDeclaredDerived, retiredSqlDirAnywhere, retiredSqlDirFlagRefusal, type DeclaredDerived } from '../declared-derived';
|
|
57
|
+
import { reportPipelineLastRun } from './pipeline-run';
|
|
58
|
+
import { step, success, fail, info, warn } from '../output';
|
|
59
59
|
|
|
60
60
|
const DEFAULT_SCHEMA_OUT = 'db/schema.generated.ts';
|
|
61
61
|
|