Skip to content

Commit

Permalink
feat(core): add fork of "cuid" with wasm32-unknown-unknown support (#…
Browse files Browse the repository at this point in the history
…4231)

Co-authored-by: Miguel Fernández <[email protected]>
  • Loading branch information
jkomyno and Miguel Fernández authored Oct 30, 2023
1 parent 685d9bc commit 582b416
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 19 deletions.
14 changes: 7 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions query-engine/connectors/mongodb-query-connector/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ tracing-futures = "0.2"
uuid.workspace = true
indexmap = "1.7"
query-engine-metrics = {path = "../../metrics"}
cuid = { git = "https://github.com/prisma/cuid-rust", branch = "wasm32-support" }

[dependencies.prisma-models]
path = "../../prisma-models"
Expand All @@ -46,9 +47,6 @@ workspace = true
[dependencies.serde]
workspace = true

[dependencies.cuid]
version = "1.2"

[dependencies.user-facing-errors]
features = ["sql"]
workspace = true
4 changes: 1 addition & 3 deletions query-engine/connectors/sql-query-connector/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ uuid.workspace = true
opentelemetry = { version = "0.17", features = ["tokio"] }
tracing-opentelemetry = "0.17.3"
quaint.workspace = true
cuid = { git = "https://github.com/prisma/cuid-rust", branch = "wasm32-support" }

[dependencies.connector-interface]
package = "query-connector"
Expand All @@ -44,9 +45,6 @@ version = "0.4"
features = ["derive"]
version = "1.0"

[dependencies.cuid]
version = "1.2"

[dependencies.user-facing-errors]
features = ["sql"]
path = "../../../libs/user-facing-errors"
2 changes: 1 addition & 1 deletion query-engine/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ tracing-subscriber = { version = "0.3", features = ["env-filter"] }
tracing-opentelemetry = "0.17.4"
user-facing-errors = { path = "../../libs/user-facing-errors" }
uuid = "1"
cuid = "1.2"
cuid = { git = "https://github.com/prisma/cuid-rust", branch = "wasm32-support" }
schema = { path = "../schema" }
lru = "0.7.7"
enumflags2 = "0.7"
Expand Down
2 changes: 1 addition & 1 deletion query-engine/dmmf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ serde.workspace = true
serde_json.workspace = true
schema = { path = "../schema" }
indexmap = { version = "1.7", features = ["serde-1"] }
prisma-models = { path = "../prisma-models" }
prisma-models = { path = "../prisma-models", features = ["default_generators"] }

[dev-dependencies]
expect-test = "1.2.2"
Expand Down
11 changes: 7 additions & 4 deletions query-engine/prisma-models/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ prisma-value = { path = "../../libs/prisma-value" }
bigdecimal = "0.3"
thiserror = "1.0"

getrandom = { version = "0.2" }
uuid = { workspace = true, optional = true }
cuid = { version = "1.2", optional = true }
cuid = { git = "https://github.com/prisma/cuid-rust", branch = "wasm32-support", optional = true }
nanoid = { version = "0.4.0", optional = true }
chrono = { version = "0.4.6", features = ["serde"] }

[target.'cfg(target_arch = "wasm32")'.dependencies.getrandom]
version = "0.2"
features = ["js"]

[features]
# Support for generating default UUID, CUID, nanoid and datetime values. This
# implies random number generation works, so it won't compile on targets like
# wasm32.
# Support for generating default UUID, CUID, nanoid and datetime values.
default_generators = ["uuid/v4", "cuid", "nanoid"]

0 comments on commit 582b416

Please sign in to comment.