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

[Feature] D1 Support #221

Open
1 task done
vidiabtc opened this issue Sep 5, 2022 · 9 comments
Open
1 task done

[Feature] D1 Support #221

vidiabtc opened this issue Sep 5, 2022 · 9 comments

Comments

@vidiabtc
Copy link

vidiabtc commented Sep 5, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Description

It would be great if workers-rs had the functionality of wrangler@d1. Although I understand that it may not be the best time to do this as D1 is still in private beta, but it would be cool if the D1 integration was ready to go by the time D1 is public!

@Yrlish
Copy link

Yrlish commented Sep 19, 2022

I would also be interested in this. I'm also aware that the current state of D1 is in private beta so it may not be doable at the moment.

So I am curious if it is possible to have a worker using both Rust and Typescript in the meanwhile? Where the D1 code is located in Typescript and the main worker code in Rust.

@zebp
Copy link
Collaborator

zebp commented Sep 19, 2022

So I am curious if it is possible to have a worker using both Rust and Typescript in the meanwhile? Where the D1 code is located in Typescript and the main worker code in Rust.

It is possible, but it's a bit messy. You can use wasm-bindgen snippets generated from TypeScript and then call it from your Rust or you avoid using worker-build and use esbuild yourself to bundle in some JavaScript that you do your D1 calls in. In the future I think we'll have to figure out how we're going to go about private-beta bindings, possible through an unstable feature flag?

Until then, D1 support is probably off the table for now.

@Yrlish
Copy link

Yrlish commented Sep 19, 2022

In the future I think we'll have to figure out how we're going to go about private-beta bindings, possible through an unstable feature flag?

Yeah this sounds like a good idea, some sort of unstable branch for non-GA features.

I was also thinking of an alternative solution. Having two separate workers, one in Rust and one "normal" in Typescript and connecting them via a service binding. This would mean having to transfer stuff between them though.

@yzn-h
Copy link

yzn-h commented Dec 2, 2022

it is now open alpha ╰(°▽°)╯

@Yrlish
Copy link

Yrlish commented Jan 5, 2023

So do we have an status update on this?

@KianNH
Copy link
Contributor

KianNH commented Jan 5, 2023

#246

@Keavon
Copy link

Keavon commented May 10, 2023

#270

@spicyzboss
Copy link
Contributor

I can't enable d1 feature but I have seen this commit that not released in 0.0.17. Any updates?

@dev-ardi
Copy link
Contributor

dev-ardi commented Sep 26, 2023

I can't enable d1 feature but I have seen this commit that not released in 0.0.17. Any updates?

It's been released as of 0.0.18:

worker = {version = "0.0.18", features = ["d1"] }

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

No branches or pull requests

8 participants