Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/add-d1-print-resource-location.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"wrangler": patch
---

fix: show local/remote status before D1 command confirmations

D1 commands (`execute`, `export`, `migrations apply`, `migrations list`) now display whether they're running against local or remote databases before showing confirmation prompts. This prevents confusion about which database will be affected by the operation.
1 change: 1 addition & 0 deletions packages/wrangler/src/d1/execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export const d1ExecuteCommand = createCommand({
},
behaviour: {
printBanner: (args) => !args.json,
printResourceLocation: true,
},
args: {
database: {
Expand Down
3 changes: 3 additions & 0 deletions packages/wrangler/src/d1/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ export const d1ExportCommand = createCommand({
status: "stable",
owner: "Product: D1",
},
behaviour: {
printResourceLocation: true,
},
args: {
name: {
type: "string",
Expand Down
3 changes: 3 additions & 0 deletions packages/wrangler/src/d1/migrations/apply.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ export const d1MigrationsApplyCommand = createCommand({
status: "stable",
owner: "Product: D1",
},
behaviour: {
printResourceLocation: true,
},
args: {
database: {
type: "string",
Expand Down
3 changes: 3 additions & 0 deletions packages/wrangler/src/d1/migrations/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ export const d1MigrationsListCommand = createCommand({
status: "stable",
owner: "Product: D1",
},
behaviour: {
printResourceLocation: true,
},
args: {
database: {
type: "string",
Expand Down
Loading