-
Notifications
You must be signed in to change notification settings - Fork 1.1k
CFSQL-1406 update wrangler d1 ... --help output from Cloudflare Docs site
#11393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 5ef4694 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
wrangler d1 ... --help output from Cloudflare Docs site
|
Failed to automatically backport this PR's changes to Wrangler v3. Please manually create a PR targeting the Depending on your changes, running Notes:
|
|
Nice, LTGM - thanks @alsuren ! Will tackle docs + iterate the rendering. |
penalosa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that this doesn't need a v3 backport, given 1) the complexity, 2) the fact there's no functional impact, and 3) we'll be stopping backports in a month or so anyway
| COMMANDS | ||
| wrangler d1 list List D1 databases | ||
| wrangler d1 create <name> Creates a new D1 database, and provides the binding and UUID that you will put in your Wrangler file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| wrangler d1 create <name> Creates a new D1 database, and provides the binding and UUID that you will put in your Wrangler file. | |
| wrangler d1 create <name> Creates a new D1 database, and provides the binding and UUID that you will put in your config file |
| wrangler d1 export <name> Export the contents or schema of your database as a .sql file | ||
| wrangler d1 time-travel Use Time Travel to restore, fork or copy a database at a specific point-in-time | ||
| wrangler d1 migrations Interact with D1 migrations | ||
| wrangler d1 insights <name> Get information about the queries run on a D1 database. [experimental] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| wrangler d1 insights <name> Get information about the queries run on a D1 database. [experimental] | |
| wrangler d1 insights <name> Get information about the queries run on a D1 database [experimental] |
| This command will prompt you to confirm the migrations you are about to apply. | ||
| Confirm that you would like to proceed. After applying, a backup will be captured. | ||
| The progress of each migration will be printed in the console. | ||
| When running the apply command in a CI/CD environment or another non-interactive | ||
| command line, the confirmation step will be skipped, but the backup will still be | ||
| captured. | ||
| If applying a migration results in an error, this migration will be rolled back, | ||
| and the previous successful migration will remain applied. | ||
| This command acts on local D1 Databases by default. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, but maybe indent the text by another tab for readability?
| description: "View a list of unapplied migration files", | ||
| status: "stable", | ||
| owner: "Product: D1", | ||
| epilogue: "This command acts on local D1 Databases by default.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want this text? Most resource commands in Wrangler are local by default, and they should all print a banner at the top of the command output saying whether it's executing locally or remotely
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quite a lot of D1 commands act remotely by default, or only remotely, so I initially added this to every command. I have now removed it from everything that says This command acts on local D1 Databases by default.
[aside: It would be nice if we could make the --local and --remote flags document themselves, but there are a bunch of strange interactions between flags where --local is kind-of the default, but then wrangler d1 execute --persist-to bombs out with Error: can't use --persist-to without --local, and I didn't want to wade into that mess right now.]
Fixes CFSQL-1406.
Describe your change...
The intention is to use the output of this in @Oxyjun's cloudflare/cloudflare-docs#26602
There are 3 commits:
wrangler d1 insightsdown to the bottom.wrangler d1 migrations apply --helpepilogue (as an example) is wrapped to 80 chars with paragraphs:screenshots of things that don't look quite right (mostly relevant to @Oxyjun's other PR rather than this one)
Some of these are things that I saw when comparing https://developers.cloudflare.com/d1/wrangler-commands against the preview output of cloudflare/cloudflare-docs#26602 (I didn't manage to
(delete this one?)

For more information about Time Travel, see https://developers.cloudflare.com/d1/reference/time-travel/. I need to check how it will render in the docs.wrangler d1 insightson Jun's PR. Probably an easy fix.wrangler d1 insightson Jun's PR. Probably leftover code that just needs to be deleted.WranglerNamespacecomponent for D1 Wrangler commands cloudflare-docs#26602createCommand()rather than usingyargsdirectly. I have added theskip-v3-prlabel. I can get opencode to backport the changes if you want though.