Skip to content
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

Clarify that wrangler d1 execute defaults to remote DB #4202

Merged

Conversation

joshthoward
Copy link
Contributor

What this PR solves / how to test:

Changes log messages to clarify that wrangler d1 execute defaults to a remote DB rather than to local like wrangler dev. The plan is to change this behavior to be consistent at GA, but not sooner because it is a breaking change.

Reviewer is to perform the following, as applicable:

  • Checked for inclusion of relevant tests
  • Checked for inclusion of a relevant changeset
  • Checked for creation of associated docs updates
  • Manually pulled down the changes and spot-tested

Note for PR author:

We want to celebrate and highlight awesome PR review! If you think this PR received a particularly high-caliber review, please assign it the label highlight pr review so future reviewers can take inspiration and learn from it.

@joshthoward joshthoward requested review from a team as code owners October 17, 2023 14:28
@changeset-bot
Copy link

changeset-bot bot commented Oct 17, 2023

⚠️ No Changeset found

Latest commit: a258057

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Oct 17, 2023

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6563306152/npm-package-wrangler-4202

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/6563306152/npm-package-wrangler-4202

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6563306152/npm-package-wrangler-4202 dev path/to/script.js
Additional artifacts:
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6563306152/npm-package-cloudflare-pages-shared-4202

Note that these links will no longer work once the GitHub Actions artifact expires.


[email protected] includes the following runtime dependencies:

Package Constraint Resolved
miniflare 3.20231016.0 3.20231016.0
workerd 1.20231016.0 1.20231016.0
workerd --version 1.20231016.0 2023-10-16

|

Please ensure constraints are pinned, and miniflare/workerd minor versions match.

@@ -313,7 +313,7 @@ async function executeRemotely({
);
}
const dbUuid = preview ? db.previewDatabaseUuid : db.uuid;
logger.log(`🌀 Executing on ${name} (${dbUuid}):`);
logger.log(`🌀 Executing on remote database ${name} (${dbUuid}):`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe (for both):

To execute on your local development database, pass the --local flag to 'wrangler d1 execute'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elithrar I added this extra line to the remote call. I thought it was a little verbose, but it should be useful for the option which is the default.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me!

@codecov
Copy link

codecov bot commented Oct 17, 2023

Codecov Report

Merging #4202 (a258057) into main (36d4978) will increase coverage by 0.03%.
Report is 9 commits behind head on main.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4202      +/-   ##
==========================================
+ Coverage   75.37%   75.41%   +0.03%     
==========================================
  Files         223      223              
  Lines       12217    12218       +1     
  Branches     3159     3159              
==========================================
+ Hits         9209     9214       +5     
+ Misses       3008     3004       -4     
Files Coverage Δ
packages/wrangler/src/d1/execute.tsx 57.55% <66.66%> (+0.30%) ⬆️

... and 3 files with indirect coverage changes

@joshthoward joshthoward force-pushed the jhoward/d1-clarify-default-remote branch from 3672308 to 8cd2465 Compare October 17, 2023 20:10
@joshthoward joshthoward force-pushed the jhoward/d1-clarify-default-remote branch from 8cd2465 to 0a9ceb0 Compare October 18, 2023 15:38
@joshthoward joshthoward force-pushed the jhoward/d1-clarify-default-remote branch from 0a9ceb0 to a258057 Compare October 18, 2023 15:43
@RamIdeas RamIdeas merged commit e81b161 into cloudflare:main Oct 18, 2023
17 of 20 checks passed
@joshthoward joshthoward deleted the jhoward/d1-clarify-default-remote branch October 19, 2023 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants