Skip to content

Commit

Permalink
feat(client_async): allow compiling for wasm
Browse files Browse the repository at this point in the history
Sets up some feature flags to allow compiling for wasm.

Due to limitation in rust-postgres, this only covers the async client.

Requires sfackler/rust-postgres#1116.
  • Loading branch information
duarten committed Mar 11, 2024
1 parent d1229ae commit c45b8bc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/client_async/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ categories = ["database"]
keywords = ["postgresql", "query", "generator", "sql", "tokio-postgres"]

[features]
default = ["deadpool"]
default = ["deadpool", "tokio-postgres/default"]
js = ["cornucopia_client_core/js", "tokio-postgres/js"]
deadpool = ["dep:deadpool-postgres"]
with-serde_json-1 = ["cornucopia_client_core/with-serde_json-1"]

Expand All @@ -25,7 +26,7 @@ cornucopia_client_core = { path = "../client_core", version = "0.4.0" }
async-trait = "0.1.63"

# rust-postgres interaction
tokio-postgres = "0.7.7"
tokio-postgres = { version = "0.7.7", default-features = false }

# connection pooling
deadpool-postgres = { version = "0.12.1", optional = true }
1 change: 1 addition & 0 deletions crates/client_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ keywords = ["postgresql", "query", "generator", "sql", "tokio-postgres"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]
js = ["postgres-protocol/js", "postgres-types/js"]
with-serde_json-1 = ["postgres-types/with-serde_json-1", "serde", "serde_json"]

[dependencies]
Expand Down
1 change: 1 addition & 0 deletions crates/client_sync/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ keywords = ["postgresql", "query", "generator", "sql", "tokio-postgres"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]
js = ["cornucopia_client_core/js"]
with-serde_json-1 = ["cornucopia_client_core/with-serde_json-1"]

[dependencies]
Expand Down

0 comments on commit c45b8bc

Please sign in to comment.