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

make libsql client a valid target for cloudflare workers #504

Closed

Conversation

Horusiath
Copy link
Contributor

@Horusiath Horusiath commented Oct 24, 2023

This PR introduces new feature: cloudflare-worker, which enables Hrana protocol to be served over Cloudflare workers.

libsql/src/connection.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@LucioFranco LucioFranco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No real request changes yet because I don't know exactly what path we should take.

@@ -1,3 +1,4 @@
/target
.vscode/
.idea/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add this to your global gitignore https://gist.github.com/subfuzion/db7f57fff2fb6998a16c so you don't need to add it to every project.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same could be said about .vscode/ path ;)

@@ -163,15 +164,27 @@ cfg_replication! {

cfg_hrana! {
impl Database {
#[cfg(not(feature = "hrana-cf"))]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this breaks how features should work in rust. They must be additive aka enabling A and B shouldn't disable features from B, since another crate in the workspace can enable the feature B and break code that depended on A.

Comment on lines 18 to 19
#[cfg_attr(feature = "hrana-cf", async_trait::async_trait(?Send))]
#[cfg_attr(not(feature = "hrana-cf"), async_trait::async_trait)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is the right approach we should take since we need these features to be additive.

@Horusiath
Copy link
Contributor Author

@Horusiath Horusiath closed this Nov 30, 2023
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

Successfully merging this pull request may close these issues.

2 participants