-
Notifications
You must be signed in to change notification settings - Fork 747
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
🐛 BUG: D1 Result inconsistency with docs, live, and wrangler dev #2504
Comments
For now I made this filler inline if statement. But I assume the docs' way is the way it should be? const internalTiming = 'meta' in batchList[0] ? batchList[0].meta.duration : batchList[0].duration |
Besides this In D1 "live" after a successful insert not getting back "changes" flag or "last_row_id" value.
|
There's some inconsistency between miniflare's local emulation of D1 and live D1 @demosjarco - you can assume the D1 docs are the expected way it should work. |
Previously, Miniflare had its own implementations of `BetaDatabase` and `Statement`. These were subtly different to the implementations in the D1 Wrangler shim D1JS, causing behaviour mismatches. This change switches the implementation to use the shim, with Miniflare implementing the underlying D1 HTTP API instead. We'll need to do this anyway when adding D1 support to Miniflare 3 using `workerd`. Specific changes: - Throw when calling `D1PreparedStatement#run()` with statements that return data, closes #441 - Fix response envelope format, closes #442 and cloudflare/workers-sdk#2504 - Fix binding/return of `BLOB`-typed values, closes wrangler2#2527 - Fix `D1Database#raw()` return, closes cloudflare/workers-sdk#2238 (already fixed in #474) - Add support for `D1Database#dump()` - Run `D1Database#{batch,exec}()` statements in implicit transaction - Only run first statement when calling `D1PreparedStatement#{first,run,all,raw}()`
Previously, Miniflare had its own implementations of `BetaDatabase` and `Statement`. These were subtly different to the implementations in the D1 Wrangler shim D1JS, causing behaviour mismatches. This change switches the implementation to use the shim, with Miniflare implementing the underlying D1 HTTP API instead. We'll need to do this anyway when adding D1 support to Miniflare 3 using `workerd`. Specific changes: - Throw when calling `D1PreparedStatement#run()` with statements that return data, closes #441 - Fix response envelope format, closes #442 and cloudflare/workers-sdk#2504 - Fix binding/return of `BLOB`-typed values, closes wrangler2#2527 - Fix `D1Database#raw()` return, closes cloudflare/workers-sdk#2238 (already fixed in #474) - Add support for `D1Database#dump()` - Run `D1Database#{batch,exec}()` statements in implicit transaction - Only run first statement when calling `D1PreparedStatement#{first,run,all,raw}()`
Previously, Miniflare had its own implementations of `BetaDatabase` and `Statement`. These were subtly different to the implementations in the D1 Wrangler shim D1JS, causing behaviour mismatches. This change switches the implementation to use the shim, with Miniflare implementing the underlying D1 HTTP API instead. We'll need to do this anyway when adding D1 support to Miniflare 3 using `workerd`. Specific changes: - Throw when calling `D1PreparedStatement#run()` with statements that return data, closes #441 - Fix response envelope format, closes #442 and cloudflare/workers-sdk#2504 - Fix binding/return of `BLOB`-typed values, closes cloudflare/workers-sdk#2527 - Fix `D1Database#raw()` return, closes cloudflare/workers-sdk#2238 (already fixed in #474) - Add support for `D1Database#dump()` - Run `D1Database#{batch,exec}()` statements in implicit transaction - Only run first statement when calling `D1PreparedStatement#{first,run,all,raw}()`
Hey! 👋 This should be resolved by #2717, which will be released shortly! 🙂 |
Which Cloudflare product(s) does this pertain to?
D1, Wrangler
What version of
Wrangler
are you using?2.6.2
What operating system are you using?
Windows 11 21H1
Describe the Bug
The return object (https://developers.cloudflare.com/d1/platform/client-api/#return-object) docs say there is supposed to be a
meta
object with the stats in it.Running locally (
wrangler dev --local --persist
with v2.6.2):Running live (pushed to cf):
The text was updated successfully, but these errors were encountered: