-
-
Notifications
You must be signed in to change notification settings - Fork 82
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
opt out of Send
for wasm32
#174
Conversation
@@ -293,6 +293,7 @@ where | |||
} | |||
} | |||
|
|||
#[allow(dead_code)] |
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.
Haven't touched this part of the code but CI for rust beta doesn't pass w/o this. LMK if you want me to revert
Thanks for opening this PR. Can you explain why you need to relax this bound on a technical level. So what exactly does not work if that bound is there? I can understand that it might be feel duplicated on a plain
|
@weiznich I understand the hesitation of having different behavior on different platforms, and I'd be OK leaving this as a duplicated/temp workaround until the Maybe it would be worth putting a warning in the readme that the wasm target is experimental? |
Thanks for providing that context. That's at least helpful to understand why you made this change. For me that raises a more fundamental question: Why do you believe that the
Platform support for diesel essentially boils down to: Officially supported is what we test in CI (in terms of target, platform, database system). Anything else is not supported. It might work, but we don't give any guarantee about it. I think that is quite similar to what most other projects do. |
Yeah this is actually a very interesting problem. Sqlite does have only blocking calls, but the As for why that is, i'm not entirely sure. There's probably an answer somewhere in wa-sqlite discussions According to this discussion, it may be something to do with browser APIS like OPFS which are strictly async |
So just to summarize everything: It's basically required as |
Yes, pretty much :) Although I would generalize this -- it's not that There is a recent discussion that popped up on the topic of a sync wa-sqlite here. It looks out of scope for the current |
I had some time thinking about this again. As previously mentioned I do not like the idea to couple this on the target. In the end it's something that depends on the underlying connection implementation, not on the target. Given that I would like to propose a different solution: We move away from using |
That makes sense, and overall a more robust solution. Even with this PR, I had to end up replicating a bunch of the trait definitions to fit them into WASM. Since I don't have the bandwidth to work on this myself right now, can close this and I opened #185 instead |
I'm working on adding a Wasm SQLite Backend to Diesel with the newly released
wa-sqlite
.Lots of functions for wa-sqlite are async and cannot be made sync in a wasm environment through blocking (b/c web). This means i've turned to this crate to try and continue to get it working, but this crate requires
Send
for it's Connection/diesel traits. This PR relaxes that condition for wasm32 environment.