-
Notifications
You must be signed in to change notification settings - Fork 744
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: .raw() does not work locally #2238
🐛 BUG: .raw() does not work locally #2238
Comments
Plus 1 on this if possible |
FYI @mrbbot, looks like miniflare's behaviour doesn't match the d1 facade:
vs https://github.com/cloudflare/miniflare/blob/master/packages/d1/src/statement.ts#L127-L130 I'll make a PR updating miniflare to make its behaviour match the shim |
thanks @rozenmd |
any ETA on this? |
@maurerbot we don't give ETAs, but PRs are also welcome if you'd like the fix ASAP. |
I might do it. But only for the cred! 😄 |
@rozenmd @mrbbot not sure if this is right? cloudflare/miniflare#471 Tests pass but could use guidance on how the abstraction works? |
Hi, please forgive me if I am missing something obvious, but I think we are overcomplicating this. I looked at the docs for I simply called This PR implements that change and hopefully resolves this issue. |
@repository hey |
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}()`
What version of
Wrangler
are you using?2.4.2
What operating system are you using?
Mac
Describe the Bug
const rows = await env.DB.prepare('select id, email from users').raw();
console.log(rows);
prints locally:
prints in cloud:
The text was updated successfully, but these errors were encountered: