[miniflare] feat: expose rows_read/rows_written in D1 meta#4686
Conversation
🦋 Changeset detectedLatest commit: 09984af The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
|
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/7389057797/npm-package-wrangler-4686You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/7389057797/npm-package-wrangler-4686Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7389057797/npm-package-wrangler-4686 dev path/to/script.jsAdditional artifacts:npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7389057797/npm-package-miniflare-4686npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7389057797/npm-package-cloudflare-pages-shared-4686npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7389057797/npm-package-create-cloudflare-4686 --no-auto-updateNote that these links will no longer work once the GitHub Actions artifact expires.
| Please ensure constraints are pinned, and |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4686 +/- ##
==========================================
+ Coverage 75.58% 75.66% +0.07%
==========================================
Files 243 243
Lines 13084 13084
Branches 3368 3368
==========================================
+ Hits 9890 9900 +10
+ Misses 3194 3184 -10 |
Fixes #4671.
What this PR solves / how to test:
This PR exposes
rows_read/rows_writtenin themetaobject of D1 responses. This matches production behaviour.rows_read/rows_writtencontain the number of rows read from/written to the database engine when executing a query respectively. These numbers may be greater than the number of rows returned from/inserted by a query. These numbers form billing metrics when your Worker is deployed. See https://developers.cloudflare.com/d1/platform/pricing/#billing-metrics and cloudflare/workerd#979 for more details. To test this, runwrangler devon a Worker using D1 databases. Observerows_readandrows_writtenare now included inmeta.Author has addressed the following:
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 reviewso future reviewers can take inspiration and learn from it.