@prisma/cli 3.0.0-beta.7 → 3.0.0-beta.9
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/adapters/mock-api.js +75 -0
- package/dist/cli2.js +2 -0
- package/dist/commands/app/index.js +2 -2
- package/dist/commands/database/index.js +159 -0
- package/dist/controllers/app-env.js +2 -2
- package/dist/controllers/app.js +55 -8
- package/dist/controllers/database.js +316 -0
- package/dist/controllers/project.js +17 -3
- package/dist/lib/app/branch-database-deploy.js +116 -66
- package/dist/lib/app/env-file.js +2 -2
- package/dist/lib/app/env-vars.js +28 -2
- package/dist/lib/app/preview-build-settings.js +385 -0
- package/dist/lib/app/preview-build.js +196 -33
- package/dist/lib/app/preview-provider.js +2 -1
- package/dist/lib/app/production-deploy-gate.js +5 -4
- package/dist/lib/database/provider.js +167 -0
- package/dist/lib/project/local-pin.js +64 -14
- package/dist/lib/project/resolution.js +16 -2
- package/dist/presenters/app.js +7 -2
- package/dist/presenters/database.js +274 -0
- package/dist/shell/command-meta.js +102 -0
- package/dist/shell/command-runner.js +9 -2
- package/package.json +2 -1
|
@@ -72,6 +72,16 @@ const DESCRIPTORS = [
|
|
|
72
72
|
description: "View your Platform branches",
|
|
73
73
|
examples: ["prisma-cli branch list"]
|
|
74
74
|
},
|
|
75
|
+
{
|
|
76
|
+
id: "database",
|
|
77
|
+
path: ["prisma", "database"],
|
|
78
|
+
description: "Manage Prisma Postgres databases for a project",
|
|
79
|
+
examples: [
|
|
80
|
+
"prisma-cli database list",
|
|
81
|
+
"prisma-cli database create my-db",
|
|
82
|
+
"prisma-cli database connection create db_123"
|
|
83
|
+
]
|
|
84
|
+
},
|
|
75
85
|
{
|
|
76
86
|
id: "git",
|
|
77
87
|
path: ["prisma", "git"],
|
|
@@ -156,6 +166,97 @@ const DESCRIPTORS = [
|
|
|
156
166
|
description: "List Platform branches for the resolved project",
|
|
157
167
|
examples: ["prisma-cli branch list", "prisma-cli branch list --json"]
|
|
158
168
|
},
|
|
169
|
+
{
|
|
170
|
+
id: "database.list",
|
|
171
|
+
path: [
|
|
172
|
+
"prisma",
|
|
173
|
+
"database",
|
|
174
|
+
"list"
|
|
175
|
+
],
|
|
176
|
+
description: "List Prisma Postgres databases for the resolved project",
|
|
177
|
+
examples: [
|
|
178
|
+
"prisma-cli database list",
|
|
179
|
+
"prisma-cli database list --branch feature/foo",
|
|
180
|
+
"prisma-cli database list --json"
|
|
181
|
+
]
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
id: "database.show",
|
|
185
|
+
path: [
|
|
186
|
+
"prisma",
|
|
187
|
+
"database",
|
|
188
|
+
"show"
|
|
189
|
+
],
|
|
190
|
+
description: "Show database metadata without secret values",
|
|
191
|
+
examples: ["prisma-cli database show db_123", "prisma-cli database show acme-preview --branch preview --json"]
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
id: "database.create",
|
|
195
|
+
path: [
|
|
196
|
+
"prisma",
|
|
197
|
+
"database",
|
|
198
|
+
"create"
|
|
199
|
+
],
|
|
200
|
+
description: "Create a Prisma Postgres database and print its one-time connection URL",
|
|
201
|
+
examples: ["prisma-cli database create my-db", "prisma-cli database create my-db --branch feature/foo --region eu-central-1"]
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
id: "database.remove",
|
|
205
|
+
path: [
|
|
206
|
+
"prisma",
|
|
207
|
+
"database",
|
|
208
|
+
"remove"
|
|
209
|
+
],
|
|
210
|
+
description: "Remove a database after exact id confirmation",
|
|
211
|
+
examples: ["prisma-cli database remove db_123 --confirm db_123"]
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
id: "database.connection",
|
|
215
|
+
path: [
|
|
216
|
+
"prisma",
|
|
217
|
+
"database",
|
|
218
|
+
"connection"
|
|
219
|
+
],
|
|
220
|
+
description: "Manage one-time-view database connection strings",
|
|
221
|
+
examples: [
|
|
222
|
+
"prisma-cli database connection list db_123",
|
|
223
|
+
"prisma-cli database connection create db_123",
|
|
224
|
+
"prisma-cli database connection remove conn_123 --confirm conn_123"
|
|
225
|
+
]
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
id: "database.connection.list",
|
|
229
|
+
path: [
|
|
230
|
+
"prisma",
|
|
231
|
+
"database",
|
|
232
|
+
"connection",
|
|
233
|
+
"list"
|
|
234
|
+
],
|
|
235
|
+
description: "List database connection metadata without secret values",
|
|
236
|
+
examples: ["prisma-cli database connection list db_123", "prisma-cli database connection list acme-preview --branch preview --json"]
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
id: "database.connection.create",
|
|
240
|
+
path: [
|
|
241
|
+
"prisma",
|
|
242
|
+
"database",
|
|
243
|
+
"connection",
|
|
244
|
+
"create"
|
|
245
|
+
],
|
|
246
|
+
description: "Create a database connection and print its one-time connection URL",
|
|
247
|
+
examples: ["prisma-cli database connection create db_123", "prisma-cli database connection create db_123 --name readonly"]
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
id: "database.connection.remove",
|
|
251
|
+
path: [
|
|
252
|
+
"prisma",
|
|
253
|
+
"database",
|
|
254
|
+
"connection",
|
|
255
|
+
"remove"
|
|
256
|
+
],
|
|
257
|
+
description: "Remove a database connection after exact id confirmation",
|
|
258
|
+
examples: ["prisma-cli database connection remove conn_123 --confirm conn_123"]
|
|
259
|
+
},
|
|
159
260
|
{
|
|
160
261
|
id: "app.build",
|
|
161
262
|
path: [
|
|
@@ -194,6 +295,7 @@ const DESCRIPTORS = [
|
|
|
194
295
|
"prisma-cli app deploy --project proj_123",
|
|
195
296
|
"prisma-cli app deploy --create-project my-app --yes",
|
|
196
297
|
"prisma-cli app deploy --app my-app --env DATABASE_URL=postgresql://example",
|
|
298
|
+
"prisma-cli app deploy --env .env",
|
|
197
299
|
"prisma-cli app deploy --db",
|
|
198
300
|
"prisma-cli app deploy --db --yes",
|
|
199
301
|
"prisma-cli app deploy --app my-app --framework nextjs --http-port 3000",
|
|
@@ -31,13 +31,20 @@ async function runCommand(runtime, commandName, options, handler, presenter) {
|
|
|
31
31
|
});
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
const stdout = presenter.renderStdout?.(context, descriptor, success.result) ?? [];
|
|
35
|
+
if (flags.quiet) {
|
|
36
|
+
if (stdout.length > 0) context.output.stdout.write(`${stdout.join("\n")}\n`);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
35
39
|
const rendered = presenter.renderHuman(context, descriptor, success.result);
|
|
36
40
|
const diagnostics = await renderBestEffortCommandDiagnostics(context, {
|
|
37
41
|
enabled: flags.verbose && rendered.length > 0,
|
|
38
42
|
durationMs: Date.now() - startedAt
|
|
39
43
|
});
|
|
40
|
-
|
|
44
|
+
const humanLines = [...rendered, ...diagnostics];
|
|
45
|
+
if (stdout.length > 0 && humanLines.length > 0) humanLines.push("");
|
|
46
|
+
writeHumanLines(context.output, humanLines);
|
|
47
|
+
if (stdout.length > 0) context.output.stdout.write(`${stdout.join("\n")}\n`);
|
|
41
48
|
} catch (error) {
|
|
42
49
|
const cliError = toCliError(error, runtime);
|
|
43
50
|
if (cliError) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/cli",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.9",
|
|
4
4
|
"description": "Command-line interface for the Prisma Developer Platform.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"@prisma/compute-sdk": "^0.22.0",
|
|
40
40
|
"@prisma/credentials-store": "^7.8.0",
|
|
41
41
|
"@prisma/management-api-sdk": "^1.37.0",
|
|
42
|
+
"better-result": "^2.9.2",
|
|
42
43
|
"c12": "4.0.0-beta.5",
|
|
43
44
|
"colorette": "^2.0.20",
|
|
44
45
|
"commander": "^14.0.3",
|