@rebasepro/server-postgres 0.25.0-canary.ge06257e → 0.25.1
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/{BranchService-DNg4txyf.js → BranchService-ClklxyAQ.js} +283 -20
- package/dist/BranchService-ClklxyAQ.js.map +1 -0
- package/dist/backup/backup-cli.d.ts +70 -1
- package/dist/backup/backup-service.d.ts +79 -0
- package/dist/backup/pg-binary.d.ts +2 -2
- package/dist/backup/pg-tools.d.ts +60 -1
- package/dist/backup-cli-gijeXe0u.js +1961 -0
- package/dist/backup-cli-gijeXe0u.js.map +1 -0
- package/dist/{boot-ddl-Dnvpmm_T.js → boot-ddl-DYH95Qeg.js} +3 -3
- package/dist/{boot-ddl-Dnvpmm_T.js.map → boot-ddl-DYH95Qeg.js.map} +1 -1
- package/dist/branch-argv.d.ts +15 -0
- package/dist/branch-prune.d.ts +18 -0
- package/dist/{cli-console-C_ISGwJo.js → cli-console-CQrQ0lAY.js} +19 -13
- package/dist/cli-console-CQrQ0lAY.js.map +1 -0
- package/dist/cli-console.d.ts +4 -3
- package/dist/{cli-errors-mx4sSjB8.js → cli-errors-DiA0XFIS.js} +110 -14
- package/dist/{cli-errors-mx4sSjB8.js.map → cli-errors-DiA0XFIS.js.map} +1 -1
- package/dist/cli-errors.d.ts +26 -1
- package/dist/cli-flags.d.ts +51 -0
- package/dist/{cli-prompt-egtNKkZl.js → cli-prompt-DXG0yk-h.js} +39 -4
- package/dist/{cli-prompt-egtNKkZl.js.map → cli-prompt-DXG0yk-h.js.map} +1 -1
- package/dist/cli.js +120 -184
- package/dist/cli.js.map +1 -1
- package/dist/collections/validate-relations.d.ts +8 -2
- package/dist/{column-plan-helpers-D_V4oaZh.js → column-plan-helpers-IG6uFb1s.js} +2 -2
- package/dist/{column-plan-helpers-D_V4oaZh.js.map → column-plan-helpers-IG6uFb1s.js.map} +1 -1
- package/dist/{connection-C938nR3E.js → connection-czvI7TZL.js} +57 -10
- package/dist/connection-czvI7TZL.js.map +1 -0
- package/dist/{databasePoolManager-Yqdw14wY.js → databasePoolManager-3stMNFL-.js} +4 -6
- package/dist/databasePoolManager-3stMNFL-.js.map +1 -0
- package/dist/db-command-line.d.ts +14 -0
- package/dist/{rls-bootstrap-sql-Bd-hJk08.js → db-subcommands-BPoHCxJR.js} +455 -3
- package/dist/db-subcommands-BPoHCxJR.js.map +1 -0
- package/dist/db-subcommands.d.ts +11 -0
- package/dist/{deferred-index-build-Ca6OqKyR.js → deferred-index-build-BE0I6sYU.js} +8 -8
- package/dist/{deferred-index-build-Ca6OqKyR.js.map → deferred-index-build-BE0I6sYU.js.map} +1 -1
- package/dist/{doctor-CJyuhV1n.js → doctor-BT--1kq3.js} +107 -11
- package/dist/doctor-BT--1kq3.js.map +1 -0
- package/dist/{ensure-collection-policies-C1ux3V_z.js → ensure-collection-policies-BnGOURpG.js} +60 -11
- package/dist/ensure-collection-policies-BnGOURpG.js.map +1 -0
- package/dist/{ensure-collection-tables-Do-Bvb64.js → ensure-collection-tables-Cet4650m.js} +9 -9
- package/dist/{ensure-collection-tables-Do-Bvb64.js.map → ensure-collection-tables-Cet4650m.js.map} +1 -1
- package/dist/{ensure-tables-Dl_Eh9ow.js → ensure-tables-l_OgFQjN.js} +5 -5
- package/dist/{ensure-tables-Dl_Eh9ow.js.map → ensure-tables-l_OgFQjN.js.map} +1 -1
- package/dist/{enum-labels-kept-D9eTIWCz.js → enum-labels-kept-nheku1pB.js} +3 -3
- package/dist/{enum-labels-kept-D9eTIWCz.js.map → enum-labels-kept-nheku1pB.js.map} +1 -1
- package/dist/{generate-drizzle-schema-Bf8canaR.js → generate-drizzle-schema-DC0BOUpn.js} +3 -3
- package/dist/{generate-drizzle-schema-Bf8canaR.js.map → generate-drizzle-schema-DC0BOUpn.js.map} +1 -1
- package/dist/{generate-drizzle-schema-logic-BaT0H7Gq.js → generate-drizzle-schema-logic-CPzCRD-8.js} +4 -4
- package/dist/{generate-drizzle-schema-logic-BaT0H7Gq.js.map → generate-drizzle-schema-logic-CPzCRD-8.js.map} +1 -1
- package/dist/{generate-files-D50Pxw1G.js → generate-files-BP-4W_gm.js} +6 -6
- package/dist/{generate-files-D50Pxw1G.js.map → generate-files-BP-4W_gm.js.map} +1 -1
- package/dist/{generate-next-step-DCd7yiJ2.js → generate-next-step-DgK5BlBn.js} +22 -14
- package/dist/{generate-next-step-DCd7yiJ2.js.map → generate-next-step-DgK5BlBn.js.map} +1 -1
- package/dist/{generate-postgres-ddl-logic-B4k9djAV.js → generate-postgres-ddl-logic-DPl1oH_z.js} +4 -4
- package/dist/{generate-postgres-ddl-logic-B4k9djAV.js.map → generate-postgres-ddl-logic-DPl1oH_z.js.map} +1 -1
- package/dist/generated-schema-diff-eZCklRZQ.js +1025 -0
- package/dist/generated-schema-diff-eZCklRZQ.js.map +1 -0
- package/dist/{generated-schema-staleness-FlxM2i4i.js → generated-schema-staleness-BvNF3i-s.js} +2 -2
- package/dist/{generated-schema-staleness-FlxM2i4i.js.map → generated-schema-staleness-BvNF3i-s.js.map} +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +70 -11
- package/dist/index.es.js.map +1 -1
- package/dist/{introspect-db-logic-j2vYhmdP.js → introspect-db-logic-DgQVzccW.js} +2 -2
- package/dist/{introspect-db-logic-j2vYhmdP.js.map → introspect-db-logic-DgQVzccW.js.map} +1 -1
- package/dist/migrate-policy-stamps-3eqfhes6.js +89 -0
- package/dist/migrate-policy-stamps-3eqfhes6.js.map +1 -0
- package/dist/{open-rebase-D8rytTP0.js → open-rebase-EmqVmS14.js} +78 -1027
- package/dist/open-rebase-EmqVmS14.js.map +1 -0
- package/dist/{pg-error-utils-CdsGYMTm.js → pg-error-utils-CFEnm2m9.js} +11 -4
- package/dist/pg-error-utils-CFEnm2m9.js.map +1 -0
- package/dist/{plan-schema-CsNgK0qi.js → plan-schema-Czf3q4-Q.js} +4 -4
- package/dist/{plan-schema-CsNgK0qi.js.map → plan-schema-Czf3q4-Q.js.map} +1 -1
- package/dist/{policy-drift-CY5P1ZRu.js → policy-drift-X4A-xAzv.js} +3 -3
- package/dist/{policy-drift-CY5P1ZRu.js.map → policy-drift-X4A-xAzv.js.map} +1 -1
- package/dist/pool-disconnects.d.ts +28 -0
- package/dist/{push-index-prebuild-BDFcfRPo.js → push-index-prebuild-COd7i6wm.js} +4 -4
- package/dist/{push-index-prebuild-BDFcfRPo.js.map → push-index-prebuild-COd7i6wm.js.map} +1 -1
- package/dist/{push-legacy-renames-D4bvMWAb.js → push-legacy-renames-CLgYYwPE.js} +4 -4
- package/dist/{push-legacy-renames-D4bvMWAb.js.map → push-legacy-renames-CLgYYwPE.js.map} +1 -1
- package/dist/{push-policy-plan-DTXE6aVa.js → push-policy-plan-D2gpQsdv.js} +23 -7
- package/dist/push-policy-plan-D2gpQsdv.js.map +1 -0
- package/dist/{render-ddl-CrfEe__B.js → render-ddl-4v88y-Gv.js} +4 -4
- package/dist/{render-ddl-CrfEe__B.js.map → render-ddl-4v88y-Gv.js.map} +1 -1
- package/dist/{rls-enforcement-D7P4-ZYX.js → rls-enforcement-DDyNoOSy.js} +2 -2
- package/dist/{rls-enforcement-D7P4-ZYX.js.map → rls-enforcement-DDyNoOSy.js.map} +1 -1
- package/dist/schema/atlas-argv.d.ts +3 -1
- package/dist/schema/doctor-cli.js +5 -5
- package/dist/schema/doctor.d.ts +20 -2
- package/dist/schema/ensure-collection-policies.d.ts +28 -1
- package/dist/schema/generate-drizzle-schema.js +1 -1
- package/dist/schema/generate-next-step.d.ts +20 -8
- package/dist/schema/generate-postgres-ddl.js +2 -2
- package/dist/schema/generated-schema-diff.d.ts +21 -0
- package/dist/schema/introspect-db.js +6 -6
- package/dist/schema/introspect-db.js.map +1 -1
- package/dist/schema/migrate-policy-stamps.d.ts +23 -0
- package/dist/schema/push-policy-plan.d.ts +10 -2
- package/dist/services/BranchService.d.ts +85 -0
- package/dist/services/pg-notify-listener.d.ts +2 -0
- package/dist/{source-DB6xJv3p.js → source-fZb92pN8.js} +46 -3
- package/dist/source-fZb92pN8.js.map +1 -0
- package/dist/{vector-index-BFhyEaiz.js → vector-index-DsQ3V2d2.js} +2 -2
- package/dist/{vector-index-BFhyEaiz.js.map → vector-index-DsQ3V2d2.js.map} +1 -1
- package/dist/{websocket-DMeXOoyv.js → websocket-BKZwsjmf.js} +18 -5
- package/dist/websocket-BKZwsjmf.js.map +1 -0
- package/package.json +7 -7
- package/dist/BranchService-DNg4txyf.js.map +0 -1
- package/dist/backup-cli-HCEkPcQj.js +0 -556
- package/dist/backup-cli-HCEkPcQj.js.map +0 -1
- package/dist/backup-service-D-UpT7DH.js +0 -857
- package/dist/backup-service-D-UpT7DH.js.map +0 -1
- package/dist/cli-console-C_ISGwJo.js.map +0 -1
- package/dist/cli-flags-DUozBFyK.js +0 -205
- package/dist/cli-flags-DUozBFyK.js.map +0 -1
- package/dist/connection-C938nR3E.js.map +0 -1
- package/dist/databasePoolManager-Yqdw14wY.js.map +0 -1
- package/dist/doctor-CJyuhV1n.js.map +0 -1
- package/dist/ensure-collection-policies-C1ux3V_z.js.map +0 -1
- package/dist/open-rebase-D8rytTP0.js.map +0 -1
- package/dist/pg-error-utils-CdsGYMTm.js.map +0 -1
- package/dist/push-policy-plan-DTXE6aVa.js.map +0 -1
- package/dist/rls-bootstrap-sql-Bd-hJk08.js.map +0 -1
- package/dist/rolldown-runtime-V7rFbMRe.js +0 -39
- package/dist/source-DB6xJv3p.js.map +0 -1
- package/dist/websocket-DMeXOoyv.js.map +0 -1
|
@@ -1,556 +0,0 @@
|
|
|
1
|
-
import { createRequire as __createRequire } from "module";
|
|
2
|
-
__createRequire(import.meta.url);
|
|
3
|
-
import { $ as redactConnectionPasswords, t as checkDatabaseConnectivity } from "./cli-errors-mx4sSjB8.js";
|
|
4
|
-
import { a as outWarn, i as outError, r as out, t as chalk } from "./source-DB6xJv3p.js";
|
|
5
|
-
import { A as parseBackupDestination, F as resolveConnectionString, M as parseDbNameFromUrl, O as globalsFileForDump, R as withDatabaseName, c as findRestoreConflicts, d as preflight, g as validateDump, h as uploadBackup, i as createDump, m as restoreDump, n as applyGlobals, o as discardPartialDump, p as readDumpObjects, s as ensureDatabaseExists, t as BackupToolError, u as listBackups } from "./backup-service-D-UpT7DH.js";
|
|
6
|
-
import { t as promptConfirm } from "./cli-prompt-egtNKkZl.js";
|
|
7
|
-
import { a as parseCommandFlags, r as closestWord } from "./cli-flags-DUozBFyK.js";
|
|
8
|
-
import path from "path";
|
|
9
|
-
import fs from "fs";
|
|
10
|
-
import os from "os";
|
|
11
|
-
import { Readable } from "stream";
|
|
12
|
-
import { pipeline } from "stream/promises";
|
|
13
|
-
//#region src/backup/backup-cli.ts
|
|
14
|
-
function formatBytes(bytes) {
|
|
15
|
-
if (bytes < 1024) return `${bytes} B`;
|
|
16
|
-
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
17
|
-
if (bytes < 1024 * 1024 * 1024) return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
18
|
-
return `${(bytes / (1024 * 1024 * 1024)).toFixed(2)} GB`;
|
|
19
|
-
}
|
|
20
|
-
/** A web stream's chunks, for piping into a file. */
|
|
21
|
-
async function* webChunks(stream) {
|
|
22
|
-
const reader = stream.getReader();
|
|
23
|
-
try {
|
|
24
|
-
for (;;) {
|
|
25
|
-
const { done, value } = await reader.read();
|
|
26
|
-
if (done) return;
|
|
27
|
-
yield value;
|
|
28
|
-
}
|
|
29
|
-
} finally {
|
|
30
|
-
reader.releaseLock();
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* The controller for an object-storage destination, or `null` for a local one.
|
|
35
|
-
*
|
|
36
|
-
* Built by `backupStorageFromEnv` from `@rebasepro/server` — the function the
|
|
37
|
-
* Backups panel's routes use — so the CLI and the panel read a bucket the same
|
|
38
|
-
* way. This file had its own copy, and the two had already drifted once
|
|
39
|
-
* (`S3_FORCE_PATH_STYLE` read as `=== "true"`, so a MinIO backup addressed the
|
|
40
|
-
* bucket as a host).
|
|
41
|
-
*
|
|
42
|
-
* Exported for its test.
|
|
43
|
-
*/
|
|
44
|
-
async function resolveStorageForDestination(dest, env) {
|
|
45
|
-
if (dest.kind === "local") return null;
|
|
46
|
-
const { backupStorageFromEnv } = await import("@rebasepro/server");
|
|
47
|
-
try {
|
|
48
|
-
return backupStorageFromEnv(dest, env);
|
|
49
|
-
} catch (error) {
|
|
50
|
-
throw new BackupToolError(error instanceof Error ? error.message : String(error), "Set the same S3_* variables your backend uses for storage.");
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* The directory `rebase` was run from, which `rebase` puts here for the driver.
|
|
55
|
-
*
|
|
56
|
-
* The driver runs in the project's `backend/`, so a relative path resolved
|
|
57
|
-
* against its own working directory named a different place from the one the
|
|
58
|
-
* user typed it in: `rebase db backup --out ./backups` wrote to `<root>/backups`
|
|
59
|
-
* (the CLI resolves explicit paths itself) while `rebase db backups list`
|
|
60
|
-
* looked in `<root>/backend/backups`. Spelled the same in
|
|
61
|
-
* `packages/cli/src/commands/db.ts`.
|
|
62
|
-
*/
|
|
63
|
-
var INVOCATION_CWD_ENV = "REBASE_INVOCATION_CWD";
|
|
64
|
-
/** Where a relative path the user typed is relative to: where they ran `rebase`. */
|
|
65
|
-
function invocationDir(env = process.env) {
|
|
66
|
-
const dir = env[INVOCATION_CWD_ENV]?.trim();
|
|
67
|
-
return dir && path.isAbsolute(dir) ? dir : process.cwd();
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Where `db backup` writes and `db backups list` reads, by one rule.
|
|
71
|
-
*
|
|
72
|
-
* - `--out` is relative to where `rebase` was run, like any path typed on a
|
|
73
|
-
* command line.
|
|
74
|
-
* - `BACKUP_DESTINATION` is relative to the backend directory, because the
|
|
75
|
-
* server reads the same variable there: the Backups panel and the scheduled
|
|
76
|
-
* backup have to find what the CLI wrote.
|
|
77
|
-
* - With neither, `./backups` where `rebase` was run, as the help says.
|
|
78
|
-
*
|
|
79
|
-
* An `s3://` or `gs://` destination is returned as given.
|
|
80
|
-
*/
|
|
81
|
-
function resolveBackupLocation(opts) {
|
|
82
|
-
const flag = opts.flag?.trim();
|
|
83
|
-
if (flag) return isRemoteDestination(flag) ? flag : path.resolve(opts.invocationDir, flag);
|
|
84
|
-
const configured = opts.configured?.trim();
|
|
85
|
-
if (configured) return isRemoteDestination(configured) ? configured : path.resolve(opts.backendDir, configured);
|
|
86
|
-
return path.join(opts.invocationDir, "backups");
|
|
87
|
-
}
|
|
88
|
-
function isRemoteDestination(value) {
|
|
89
|
-
return parseBackupDestination(value).kind !== "local";
|
|
90
|
-
}
|
|
91
|
-
/** {@link resolveBackupLocation} for this process. */
|
|
92
|
-
function backupLocation(flag) {
|
|
93
|
-
return resolveBackupLocation({
|
|
94
|
-
flag,
|
|
95
|
-
configured: process.env.BACKUP_DESTINATION,
|
|
96
|
-
invocationDir: invocationDir(),
|
|
97
|
-
backendDir: process.cwd()
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
function requireConnection() {
|
|
101
|
-
const conn = resolveConnectionString(process.env);
|
|
102
|
-
if (!conn) {
|
|
103
|
-
outError(chalk.red("✗ DATABASE_URL is not set. Make sure your .env file is configured."));
|
|
104
|
-
process.exit(1);
|
|
105
|
-
}
|
|
106
|
-
return conn;
|
|
107
|
-
}
|
|
108
|
-
var BACKUP_FLAGS = {
|
|
109
|
-
"--out": String,
|
|
110
|
-
"--output": "--out",
|
|
111
|
-
"--exclude-schema": [String],
|
|
112
|
-
"--no-owner": Boolean,
|
|
113
|
-
"--enable-row-security": Boolean,
|
|
114
|
-
"--row-security-role": String,
|
|
115
|
-
"-o": "--out"
|
|
116
|
-
};
|
|
117
|
-
/**
|
|
118
|
-
* Parse a `rebase db backup …` line. An undeclared flag is refused (see
|
|
119
|
-
* `parseCommandFlags`), and so is a positional: `rebase db backup ./backups`
|
|
120
|
-
* means `--out ./backups`, and taken as nothing it wrote to the default
|
|
121
|
-
* directory.
|
|
122
|
-
*/
|
|
123
|
-
function parseBackupLine(rawArgs) {
|
|
124
|
-
const args = parseCommandFlags(BACKUP_FLAGS, rawArgs.slice(2), "db backup");
|
|
125
|
-
const [stray] = args._;
|
|
126
|
-
if (stray !== void 0) throw new Error(`\`rebase db backup\` takes no argument "${stray}". Nothing was run. To choose where the backup goes, pass --out ${stray}.`);
|
|
127
|
-
return args;
|
|
128
|
-
}
|
|
129
|
-
async function backupCommand(rawArgs) {
|
|
130
|
-
if (rawArgs.includes("--help")) {
|
|
131
|
-
printBackupHelp();
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
const args = parseBackupLine(rawArgs);
|
|
135
|
-
const connectionString = requireConnection();
|
|
136
|
-
const dbName = parseDbNameFromUrl(connectionString) ?? "database";
|
|
137
|
-
const out$1 = backupLocation(args["--out"]);
|
|
138
|
-
const dest = parseBackupDestination(out$1);
|
|
139
|
-
out("");
|
|
140
|
-
out(chalk.bold(" 💾 Rebase DB Backup"));
|
|
141
|
-
out(chalk.gray(` Database: ${dbName}`));
|
|
142
|
-
out(chalk.gray(` Destination: ${out$1}`));
|
|
143
|
-
out("");
|
|
144
|
-
await checkDatabaseConnectivity(connectionString);
|
|
145
|
-
const pf = await preflight("pg_dump", connectionString);
|
|
146
|
-
if (!pf.compatible) {
|
|
147
|
-
outError(chalk.red(` ✗ ${pf.reason}`));
|
|
148
|
-
process.exit(1);
|
|
149
|
-
}
|
|
150
|
-
out(chalk.gray(` Using pg_dump ${pf.toolMajor} against server ${pf.serverMajor}.`));
|
|
151
|
-
const rowSecurity = args["--enable-row-security"] ? {
|
|
152
|
-
uid: "rebase-db-backup",
|
|
153
|
-
roles: [args["--row-security-role"] || "admin"]
|
|
154
|
-
} : void 0;
|
|
155
|
-
if (rowSecurity) {
|
|
156
|
-
outWarn("");
|
|
157
|
-
outWarn(chalk.yellow(" ⚠ Dumping with row-level security ON."));
|
|
158
|
-
outWarn(chalk.gray(` Reading as roles [${rowSecurity.roles.join(", ")}], which satisfies the generated`));
|
|
159
|
-
outWarn(chalk.gray(" `admin_full_access` policy. This backup contains exactly the rows those"));
|
|
160
|
-
outWarn(chalk.gray(" policies admit — a table whose policies have no admin rule comes out short,"));
|
|
161
|
-
outWarn(chalk.gray(" and pg_dump will not say so. Prefer granting the dumping role BYPASSRLS."));
|
|
162
|
-
outWarn("");
|
|
163
|
-
}
|
|
164
|
-
try {
|
|
165
|
-
if (dest.kind === "local") {
|
|
166
|
-
const explicitFile = dest.path.endsWith(".dump");
|
|
167
|
-
const dump = await createDump({
|
|
168
|
-
connectionString,
|
|
169
|
-
dbName,
|
|
170
|
-
outDir: explicitFile ? path.dirname(dest.path) : dest.path,
|
|
171
|
-
fileName: explicitFile ? path.basename(dest.path) : void 0,
|
|
172
|
-
excludeSchemas: args["--exclude-schema"],
|
|
173
|
-
noOwner: args["--no-owner"],
|
|
174
|
-
inheritStdio: true,
|
|
175
|
-
rowSecurity
|
|
176
|
-
});
|
|
177
|
-
await assertDumpValid(dump.localFile);
|
|
178
|
-
out("");
|
|
179
|
-
out(chalk.green(` ✓ Backup written to ${dump.localFile} (${formatBytes(dump.sizeBytes)})`));
|
|
180
|
-
if (dump.globalsFile) out(chalk.gray(` ✓ Roles captured to ${dump.globalsFile} (needed so RLS survives a restore).`));
|
|
181
|
-
} else {
|
|
182
|
-
const storage = await resolveStorageForDestination(dest, process.env);
|
|
183
|
-
const dump = await createDump({
|
|
184
|
-
connectionString,
|
|
185
|
-
dbName,
|
|
186
|
-
excludeSchemas: args["--exclude-schema"],
|
|
187
|
-
noOwner: args["--no-owner"],
|
|
188
|
-
inheritStdio: true,
|
|
189
|
-
rowSecurity
|
|
190
|
-
});
|
|
191
|
-
try {
|
|
192
|
-
await assertDumpValid(dump.localFile);
|
|
193
|
-
const uploaded = await uploadBackup(storage, dump.localFile, dest);
|
|
194
|
-
out("");
|
|
195
|
-
out(chalk.green(` ✓ Backup uploaded to ${uploaded.storageUrl} (${formatBytes(dump.sizeBytes)})`));
|
|
196
|
-
if (dump.globalsFile && fs.existsSync(dump.globalsFile)) {
|
|
197
|
-
const globalsUpload = await uploadBackup(storage, dump.globalsFile, dest);
|
|
198
|
-
out(chalk.gray(` ✓ Roles uploaded to ${globalsUpload.storageUrl} (needed so RLS survives a restore).`));
|
|
199
|
-
}
|
|
200
|
-
out(chalk.gray(" Ensure this bucket is private — backups may contain secrets and PII."));
|
|
201
|
-
} finally {
|
|
202
|
-
if (fs.existsSync(dump.localFile)) fs.unlinkSync(dump.localFile);
|
|
203
|
-
if (dump.globalsFile && fs.existsSync(dump.globalsFile)) fs.unlinkSync(dump.globalsFile);
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
out("");
|
|
207
|
-
} catch (err) {
|
|
208
|
-
reportError(err);
|
|
209
|
-
process.exit(1);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
var RESTORE_FLAGS = {
|
|
213
|
-
"--target-db": String,
|
|
214
|
-
"--create-db": Boolean,
|
|
215
|
-
"--clean": Boolean,
|
|
216
|
-
"--no-owner": Boolean,
|
|
217
|
-
"--continue-on-error": Boolean,
|
|
218
|
-
"--yes": Boolean,
|
|
219
|
-
"-y": "--yes"
|
|
220
|
-
};
|
|
221
|
-
/**
|
|
222
|
-
* Parse a `rebase db restore …` line; the one positional is the backup.
|
|
223
|
-
*
|
|
224
|
-
* Strict, because this is the command where a typo costs most: parsed
|
|
225
|
-
* permissively, `--targt-db x` became a second positional, the target fell
|
|
226
|
-
* back to DATABASE_URL's own database, and the restore ran against the live
|
|
227
|
-
* one.
|
|
228
|
-
*/
|
|
229
|
-
function parseRestoreLine(rawArgs) {
|
|
230
|
-
const args = parseCommandFlags(RESTORE_FLAGS, rawArgs.slice(2), "db restore");
|
|
231
|
-
if (args._.length > 1) throw new Error(`\`rebase db restore\` restores one backup, and was given ${args._.length}: ${args._.map((word) => `"${word}"`).join(", ")}. Nothing was run.`);
|
|
232
|
-
return args;
|
|
233
|
-
}
|
|
234
|
-
/**
|
|
235
|
-
* The restore's one question, asked before anything can change.
|
|
236
|
-
*
|
|
237
|
-
* `--yes` skips it. On a terminal it asks for a typed 'yes'. With no terminal
|
|
238
|
-
* nobody can answer, and the refusal says to pass `--yes`, as `db reset`,
|
|
239
|
-
* `db pull` and `db branch prune` do: "Aborted. No changes were made." alone
|
|
240
|
-
* read as though someone had answered no.
|
|
241
|
-
*
|
|
242
|
-
* @returns whether to go on. When not, it has said why.
|
|
243
|
-
*/
|
|
244
|
-
async function confirmRestore(opts) {
|
|
245
|
-
if (opts.yes) return true;
|
|
246
|
-
outWarn(chalk.yellow(` ⚠️ This will restore into "${opts.target}" and may overwrite existing data.`));
|
|
247
|
-
if (!opts.interactive) {
|
|
248
|
-
outError(chalk.red(" ✗ Nothing was restored: there is no terminal to confirm on."));
|
|
249
|
-
outError(chalk.gray(` Re-run with --yes to restore into "${opts.target}".`));
|
|
250
|
-
return false;
|
|
251
|
-
}
|
|
252
|
-
const confirmed = await opts.ask(chalk.yellow(" Type 'yes' to continue: "));
|
|
253
|
-
if (!confirmed) out(chalk.gray(" Aborted. No changes were made."));
|
|
254
|
-
return confirmed;
|
|
255
|
-
}
|
|
256
|
-
/** How many of the conflicting objects a refusal names before counting the rest. */
|
|
257
|
-
var CONFLICTS_NAMED = 5;
|
|
258
|
-
/**
|
|
259
|
-
* What `db restore` says when the target already holds what the backup
|
|
260
|
-
* creates, and the two ways round it: `--clean` replaces them with the
|
|
261
|
-
* backup's copy, a new database restores beside them.
|
|
262
|
-
*/
|
|
263
|
-
function describeRestoreConflict(target, backupArg, conflicts) {
|
|
264
|
-
return {
|
|
265
|
-
message: `"${target}" already holds ${conflicts.slice(0, CONFLICTS_NAMED).join(", ")}${conflicts.length > CONFLICTS_NAMED ? `, and ${conflicts.length - CONFLICTS_NAMED} more` : ""}, which this backup creates. Without --clean, pg_restore stops at the first of them. Nothing was restored or changed.`,
|
|
266
|
-
hint: [`To replace them with the backup's copy: rebase db restore ${backupArg} --clean`, `To restore beside them, in a new database: rebase db restore ${backupArg} --create-db --target-db <new name>`].join("\n ")
|
|
267
|
-
};
|
|
268
|
-
}
|
|
269
|
-
async function restoreCommand(rawArgs) {
|
|
270
|
-
if (rawArgs.includes("--help")) {
|
|
271
|
-
printRestoreHelp();
|
|
272
|
-
return;
|
|
273
|
-
}
|
|
274
|
-
const args = parseRestoreLine(rawArgs);
|
|
275
|
-
const backupArg = args._[0];
|
|
276
|
-
if (!backupArg) {
|
|
277
|
-
printRestoreHelp();
|
|
278
|
-
process.exit(1);
|
|
279
|
-
}
|
|
280
|
-
const baseConnection = requireConnection();
|
|
281
|
-
const targetDb = args["--target-db"] ?? parseDbNameFromUrl(baseConnection) ?? void 0;
|
|
282
|
-
const targetConnection = args["--target-db"] ? withDatabaseName(baseConnection, args["--target-db"]) : baseConnection;
|
|
283
|
-
out("");
|
|
284
|
-
out(chalk.bold(" ♻️ Rebase DB Restore"));
|
|
285
|
-
out(chalk.gray(` Source: ${backupArg}`));
|
|
286
|
-
out(chalk.gray(` Target: ${targetDb ?? "(from DATABASE_URL)"}`));
|
|
287
|
-
out("");
|
|
288
|
-
await checkDatabaseConnectivity(baseConnection);
|
|
289
|
-
let localFile;
|
|
290
|
-
let globalsSql = null;
|
|
291
|
-
let cleanupTemp = false;
|
|
292
|
-
try {
|
|
293
|
-
if (/^(s3|gs):\/\//.test(backupArg)) {
|
|
294
|
-
const storage = await resolveStorageForDestination(parseBackupDestination(backupArg.replace(/\/[^/]+$/, "")), process.env);
|
|
295
|
-
if (!storage) throw new BackupToolError("Could not resolve storage for the given URL.");
|
|
296
|
-
const key = backupArg.replace(/^(s3|gs):\/\/[^/]+\//, "");
|
|
297
|
-
const bucket = backupArg.replace(/^(s3|gs):\/\/([^/]+)\/.*$/, "$2");
|
|
298
|
-
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "rebase-restore-"));
|
|
299
|
-
localFile = path.join(tmpDir, path.basename(key));
|
|
300
|
-
cleanupTemp = true;
|
|
301
|
-
const object = storage.getObjectStream ? await storage.getObjectStream(key, { bucket }) : await storage.getObject(key, bucket).then((file) => file && { stream: file.stream() });
|
|
302
|
-
if (!object) throw new BackupToolError(`Backup not found in storage: ${backupArg}`);
|
|
303
|
-
await pipeline(Readable.from(webChunks(object.stream)), fs.createWriteStream(localFile));
|
|
304
|
-
const globalsObj = await storage.getObject(globalsFileForDump(key), bucket);
|
|
305
|
-
if (globalsObj) globalsSql = Buffer.from(await globalsObj.arrayBuffer()).toString("utf-8");
|
|
306
|
-
} else {
|
|
307
|
-
localFile = path.resolve(invocationDir(), backupArg);
|
|
308
|
-
if (!fs.existsSync(localFile)) throw new BackupToolError(`Backup file not found: ${localFile}`);
|
|
309
|
-
const globalsPath = globalsFileForDump(localFile);
|
|
310
|
-
if (fs.existsSync(globalsPath)) globalsSql = fs.readFileSync(globalsPath, "utf-8");
|
|
311
|
-
}
|
|
312
|
-
const pf = await preflight("pg_restore", baseConnection);
|
|
313
|
-
if (!pf.compatible) throw new BackupToolError(pf.reason ?? "pg_restore cannot restore into this server.");
|
|
314
|
-
if (args["--create-db"] && !targetDb) throw new BackupToolError("--create-db requires a resolvable target database name (use --target-db).");
|
|
315
|
-
if (!args["--clean"]) {
|
|
316
|
-
const conflicts = await findRestoreConflicts(targetConnection, await readDumpObjects(localFile));
|
|
317
|
-
if (conflicts.length > 0) {
|
|
318
|
-
const { message, hint } = describeRestoreConflict(targetDb ?? "the target database", backupArg, conflicts);
|
|
319
|
-
throw new BackupToolError(message, hint);
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
if (!await confirmRestore({
|
|
323
|
-
target: targetDb ?? "the target database",
|
|
324
|
-
yes: args["--yes"] === true,
|
|
325
|
-
interactive: process.stdin.isTTY === true,
|
|
326
|
-
ask: promptConfirm
|
|
327
|
-
})) {
|
|
328
|
-
process.exitCode = 1;
|
|
329
|
-
return;
|
|
330
|
-
}
|
|
331
|
-
if (args["--create-db"]) {
|
|
332
|
-
const created = await ensureDatabaseExists(baseConnection, targetDb);
|
|
333
|
-
out(chalk.gray(created ? ` ✓ Created database "${targetDb}".` : ` • Database "${targetDb}" already exists.`));
|
|
334
|
-
}
|
|
335
|
-
let rolesApplied = 0;
|
|
336
|
-
if (globalsSql) {
|
|
337
|
-
out(chalk.gray(" Recreating cluster roles from the backup's roles sidecar…"));
|
|
338
|
-
const { applied, skipped } = await applyGlobals(targetConnection, globalsSql, (m) => out(chalk.gray(m)));
|
|
339
|
-
rolesApplied = applied;
|
|
340
|
-
out(chalk.gray(` ✓ Roles: ${applied} applied, ${skipped} skipped (already present or not permitted).`));
|
|
341
|
-
} else {
|
|
342
|
-
outWarn(chalk.yellow(" ⚠️ No roles sidecar (.globals.sql) accompanies this backup."));
|
|
343
|
-
outWarn(chalk.yellow(" If the dump grants to roles that don't exist (e.g. rebase_user), the restore"));
|
|
344
|
-
outWarn(chalk.yellow(" will fail — recreate those roles first, or use a backup that includes its globals."));
|
|
345
|
-
}
|
|
346
|
-
try {
|
|
347
|
-
await restoreDump({
|
|
348
|
-
connectionString: targetConnection,
|
|
349
|
-
inputFile: localFile,
|
|
350
|
-
clean: args["--clean"],
|
|
351
|
-
noOwner: args["--no-owner"],
|
|
352
|
-
exitOnError: !args["--continue-on-error"],
|
|
353
|
-
inheritStdio: true
|
|
354
|
-
});
|
|
355
|
-
} catch (err) {
|
|
356
|
-
if (err instanceof BackupToolError) throw err;
|
|
357
|
-
throw new BackupToolError(`pg_restore stopped on the error above. What it restored before that stays in "${targetDb ?? "the target database"}".`, rolesApplied > 0 ? `The ${rolesApplied} cluster role(s) recreated from the backup's sidecar before it stay too.` : void 0);
|
|
358
|
-
}
|
|
359
|
-
out("");
|
|
360
|
-
out(chalk.green(` ✓ Restore completed into "${targetDb ?? "the target database"}".`));
|
|
361
|
-
out("");
|
|
362
|
-
} catch (err) {
|
|
363
|
-
reportError(err);
|
|
364
|
-
process.exitCode = 1;
|
|
365
|
-
} finally {
|
|
366
|
-
if (cleanupTemp && typeof localFile === "string" && fs.existsSync(localFile)) fs.rmSync(path.dirname(localFile), {
|
|
367
|
-
recursive: true,
|
|
368
|
-
force: true
|
|
369
|
-
});
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
var BACKUPS_ACTIONS = ["list"];
|
|
373
|
-
/** What `db backups <action>` says of an action it does not have: the sentence every `db` command says. */
|
|
374
|
-
function unknownBackupsAction(action) {
|
|
375
|
-
const near = closestWord(action, BACKUPS_ACTIONS);
|
|
376
|
-
return near ? `Unknown db backups command "${action}" — did you mean \`${near}\`? Run \`rebase db backups --help\` for the rest.` : `Unknown db backups command "${action}". Run \`rebase db backups --help\` for the ones there are.`;
|
|
377
|
-
}
|
|
378
|
-
async function backupsCommand(rawArgs) {
|
|
379
|
-
const action = rawArgs[2];
|
|
380
|
-
if (!action || action === "--help") {
|
|
381
|
-
printBackupsHelp();
|
|
382
|
-
return;
|
|
383
|
-
}
|
|
384
|
-
if (action !== "list") {
|
|
385
|
-
outError(chalk.red(`✗ ${unknownBackupsAction(action)}`));
|
|
386
|
-
process.exit(1);
|
|
387
|
-
}
|
|
388
|
-
const args = parseCommandFlags({
|
|
389
|
-
"--out": String,
|
|
390
|
-
"--output": "--out",
|
|
391
|
-
"-o": "--out"
|
|
392
|
-
}, rawArgs.slice(3), "db backups list");
|
|
393
|
-
const out$2 = backupLocation(args["--out"]);
|
|
394
|
-
const dest = parseBackupDestination(out$2);
|
|
395
|
-
try {
|
|
396
|
-
const backups = await listBackups(dest, await resolveStorageForDestination(dest, process.env) ?? void 0);
|
|
397
|
-
out("");
|
|
398
|
-
if (backups.length === 0) {
|
|
399
|
-
out(chalk.gray(` No backups found at ${out$2}.`));
|
|
400
|
-
await mentionBackendBackups(out$2, args["--out"]);
|
|
401
|
-
} else {
|
|
402
|
-
out(chalk.bold(` 💾 ${backups.length} backup(s) at ${out$2}:`));
|
|
403
|
-
out("");
|
|
404
|
-
for (const b of backups) {
|
|
405
|
-
const when = b.createdAt ? b.createdAt.toISOString() : "unknown date";
|
|
406
|
-
const name = dest.kind === "local" ? path.basename(b.key) : b.key;
|
|
407
|
-
const empty = b.sizeBytes === 0;
|
|
408
|
-
const size = b.sizeBytes === void 0 ? "" : ` — ${formatBytes(b.sizeBytes)}`;
|
|
409
|
-
if (empty) out(` ${chalk.red("○")} ${chalk.bold(name)} ${chalk.gray(`— ${when}`)}${chalk.red(" — EMPTY, not restorable")}`);
|
|
410
|
-
else out(` ${chalk.green("●")} ${chalk.bold(name)} ${chalk.gray(`— ${when}${size}`)}`);
|
|
411
|
-
}
|
|
412
|
-
if (backups.some((b) => b.sizeBytes === 0)) {
|
|
413
|
-
out("");
|
|
414
|
-
out(chalk.yellow(" ⚠ Empty files above are leftovers from a failed backup. Delete them:"));
|
|
415
|
-
out(chalk.gray(" they count as recent backups for retention but restore nothing."));
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
out("");
|
|
419
|
-
} catch (err) {
|
|
420
|
-
reportError(err);
|
|
421
|
-
process.exit(1);
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
/**
|
|
425
|
-
* Point at `<backend>/backups` when the default listing is empty and that
|
|
426
|
-
* directory holds dumps.
|
|
427
|
-
*
|
|
428
|
-
* Earlier releases resolved the default there, so after an upgrade the
|
|
429
|
-
* backups a project already has are one directory away from the listing.
|
|
430
|
-
*/
|
|
431
|
-
async function mentionBackendBackups(listed, flag) {
|
|
432
|
-
if (flag || process.env.BACKUP_DESTINATION?.trim()) return;
|
|
433
|
-
const backendBackups = path.join(process.cwd(), "backups");
|
|
434
|
-
if (path.resolve(listed) === backendBackups) return;
|
|
435
|
-
const found = await listBackups({
|
|
436
|
-
kind: "local",
|
|
437
|
-
path: backendBackups
|
|
438
|
-
}).catch(() => []);
|
|
439
|
-
if (found.length === 0) return;
|
|
440
|
-
out(chalk.gray(` ${found.length} backup(s) are in ${backendBackups}, where earlier releases of`));
|
|
441
|
-
out(chalk.gray(` \`rebase db backup\` wrote by default. List them with:`));
|
|
442
|
-
out(chalk.gray(` rebase db backups list --out ${path.relative(invocationDir(), backendBackups) || "."}`));
|
|
443
|
-
}
|
|
444
|
-
/**
|
|
445
|
-
* Verify a freshly written dump; abort the command if it looks corrupt.
|
|
446
|
-
*
|
|
447
|
-
* Discards the artifact on the way out. Refusing to *report* success was never
|
|
448
|
-
* enough on its own: the file stayed on disk, `rebase db backups list` showed
|
|
449
|
-
* it as an ordinary entry, and retention — which ranks by timestamp and never
|
|
450
|
-
* looks at size — would protect it as one of the `keepMinimum` newest while
|
|
451
|
-
* pruning a real backup underneath it. The roles sidecar goes too; the two are
|
|
452
|
-
* uploaded and pruned as a pair, so half a pair is not a backup either.
|
|
453
|
-
*/
|
|
454
|
-
async function assertDumpValid(localFile) {
|
|
455
|
-
const check = await validateDump(localFile);
|
|
456
|
-
if (!check.ok) {
|
|
457
|
-
discardPartialDump(globalsFileForDump(localFile));
|
|
458
|
-
discardPartialDump(localFile);
|
|
459
|
-
throw new BackupToolError(`The backup failed validation and was discarded: ${check.reason}`, "The dump was corrupt or truncated, so nothing was kept. Investigate before relying on this destination.");
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
/**
|
|
463
|
-
* Say why a backup command failed, with no password in it.
|
|
464
|
-
*
|
|
465
|
-
* What reaches here is often a client tool's failure, and execa's message
|
|
466
|
-
* repeats the tool's command line. The tools get the password through
|
|
467
|
-
* `PGPASSWORD` now, so it is not on that line, but a connection string can
|
|
468
|
-
* still arrive inside a message from elsewhere; this is the last place to
|
|
469
|
-
* stop it reaching a terminal or a CI log.
|
|
470
|
-
*/
|
|
471
|
-
function reportError(err) {
|
|
472
|
-
if (err instanceof BackupToolError) {
|
|
473
|
-
outError(chalk.red(` ✗ ${redactConnectionPasswords(err.message)}`));
|
|
474
|
-
if (err.hint) outError(chalk.gray(` ${redactConnectionPasswords(err.hint)}`));
|
|
475
|
-
} else outError(chalk.red(` ✗ ${redactConnectionPasswords(err instanceof Error ? err.message : String(err))}`));
|
|
476
|
-
}
|
|
477
|
-
function printBackupHelp() {
|
|
478
|
-
out(`
|
|
479
|
-
${chalk.bold("rebase db backup")} — Create a database backup (pg_dump, custom format)
|
|
480
|
-
|
|
481
|
-
${chalk.green.bold("Usage")}
|
|
482
|
-
rebase db backup [--out <path|s3://bucket/prefix>] [options]
|
|
483
|
-
|
|
484
|
-
${chalk.green.bold("Options")}
|
|
485
|
-
${chalk.blue("--out, -o")} <dest> Local path or s3://…/gs://… URL (default: ./backups)
|
|
486
|
-
${chalk.blue("--exclude-schema")} <s> Exclude a schema (repeatable)
|
|
487
|
-
${chalk.blue("--no-owner")} Omit ownership commands from the dump
|
|
488
|
-
${chalk.blue("--enable-row-security")} Dump as an admin subject instead of failing on RLS
|
|
489
|
-
${chalk.red("(may produce a partial dump — see below)")}
|
|
490
|
-
${chalk.blue("--row-security-role")} <r> Role to read as with the flag above (default: admin)
|
|
491
|
-
|
|
492
|
-
${chalk.green.bold("Row-level security")}
|
|
493
|
-
On a managed Postgres the dumping role usually owns nothing and has no
|
|
494
|
-
BYPASSRLS, so pg_dump refuses:
|
|
495
|
-
|
|
496
|
-
ERROR: query would be affected by row-level security policy for table "..."
|
|
497
|
-
|
|
498
|
-
That refusal is the safe behaviour. --enable-row-security replaces it by
|
|
499
|
-
reading as an admin subject: Rebase sets app.uid/app.user_roles so the
|
|
500
|
-
generated admin_full_access policy admits the dump. The dump then contains
|
|
501
|
-
exactly what those policies admit ${chalk.red("and no error is raised for what they do not")} —
|
|
502
|
-
a table whose policies lack an admin rule comes out short, silently.
|
|
503
|
-
|
|
504
|
-
Granting the dumping role BYPASSRLS is the option that keeps a backup
|
|
505
|
-
meaning "every row".
|
|
506
|
-
|
|
507
|
-
${chalk.green.bold("Notes")}
|
|
508
|
-
Backups may contain secrets and PII. Use private storage destinations and
|
|
509
|
-
enable encryption-at-rest. See docs/backups.md.
|
|
510
|
-
`);
|
|
511
|
-
}
|
|
512
|
-
function printRestoreHelp() {
|
|
513
|
-
out(`
|
|
514
|
-
${chalk.bold("rebase db restore")} — Restore a database from a backup (pg_restore)
|
|
515
|
-
|
|
516
|
-
${chalk.green.bold("Usage")}
|
|
517
|
-
rebase db restore <backup> [options]
|
|
518
|
-
|
|
519
|
-
${chalk.green.bold("Arguments")}
|
|
520
|
-
<backup> Local .dump file, or s3://…/gs://… object key
|
|
521
|
-
|
|
522
|
-
${chalk.green.bold("Options")}
|
|
523
|
-
${chalk.blue("--target-db")} <name> Restore into this database instead of DATABASE_URL's
|
|
524
|
-
${chalk.blue("--create-db")} Create the target database first if it doesn't exist
|
|
525
|
-
${chalk.blue("--clean")} Drop existing objects before recreating them
|
|
526
|
-
${chalk.blue("--no-owner")} Ignore ownership from the dump
|
|
527
|
-
${chalk.blue("--continue-on-error")} Log and continue past errors ${chalk.red("(may leave RLS un-enforced!)")}
|
|
528
|
-
${chalk.blue("--yes, -y")} Skip the interactive confirmation ${chalk.red("(destructive!)")}
|
|
529
|
-
|
|
530
|
-
${chalk.red.bold("Warning")}
|
|
531
|
-
Restore is destructive and never runs automatically. Without --yes it
|
|
532
|
-
asks for a typed 'yes' on a terminal, and with no terminal to ask on it
|
|
533
|
-
refuses. Prefer --create-db/--target-db to restore into a fresh database
|
|
534
|
-
rather than overwriting a live one. Into a database that already holds
|
|
535
|
-
what the backup creates, it needs --clean, and refuses before changing
|
|
536
|
-
anything without it.
|
|
537
|
-
|
|
538
|
-
By default the restore aborts on the first error (--exit-on-error) so a
|
|
539
|
-
skipped GRANT never silently leaves RLS un-enforced. Roles are recreated
|
|
540
|
-
from the backup's .globals.sql sidecar first; keep that file next to the
|
|
541
|
-
dump. Use --continue-on-error only when you understand the consequences.
|
|
542
|
-
`);
|
|
543
|
-
}
|
|
544
|
-
function printBackupsHelp() {
|
|
545
|
-
out(`
|
|
546
|
-
${chalk.bold("rebase db backups")} — Manage stored backups
|
|
547
|
-
|
|
548
|
-
${chalk.green.bold("Usage")}
|
|
549
|
-
rebase db backups list [--out <path|s3://bucket/prefix>]
|
|
550
|
-
rebase db backup list [--out <path|s3://bucket/prefix>] ${chalk.gray("(the same thing)")}
|
|
551
|
-
`);
|
|
552
|
-
}
|
|
553
|
-
//#endregion
|
|
554
|
-
export { backupCommand, backupsCommand, restoreCommand };
|
|
555
|
-
|
|
556
|
-
//# sourceMappingURL=backup-cli-HCEkPcQj.js.map
|