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

feat(psl, query-engine, schema-engine): add cuid(2) support, fix uuid(7) #5047

Merged
merged 35 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
454112f
feat(psl): add cuid(2) support, fix uuid(7) re-introspection
jkomyno Nov 15, 2024
8b6ac6e
chore(psl): fix clippy
jkomyno Nov 15, 2024
195d25d
chore(psl): fix clippy
jkomyno Nov 15, 2024
04af8ad
fix(dmmf): [breaking] serialise uuid and cuid with proper args
jkomyno Nov 15, 2024
e902e3a
test(dmmf): expand functions.json test suite
jkomyno Nov 15, 2024
df254e9
chore(query-structure): interpret "cuid()" as "cuid(1)"
jkomyno Nov 15, 2024
547c979
chore: remove leftover
jkomyno Nov 15, 2024
8e91dfb
Merge branch 'main' into feat/cuid2-support
jkomyno Nov 19, 2024
a154696
fix(query-engine): fix "create_uuid_v7_and_retrieve_it_should_work" s…
jkomyno Nov 19, 2024
56a6ca6
test(query-engine): add create_cuid_v2_and_retrieve_it_should_work test
jkomyno Nov 19, 2024
16e3d1d
feat(query-engine): port cuid to workspace, replace Prisma's wasm32-o…
jkomyno Nov 19, 2024
71c4aeb
feat(query-engine): replace cuid1 with cuid2 for internal transaction…
jkomyno Nov 19, 2024
9d191ed
Merge branch 'feat/cuid2-support' of github.com:prisma/prisma-engines…
jkomyno Nov 19, 2024
148551c
chore: cargo fmt
jkomyno Nov 19, 2024
c1159eb
chore: clippy
jkomyno Nov 19, 2024
9d04afb
fix(psl): keep cuid() default version as 1
jkomyno Nov 20, 2024
da162ec
test(query-engine): add "create_cuid_v1_and_retrieve_it_should_work" …
jkomyno Nov 20, 2024
0af3191
chore: address review comments
jkomyno Nov 21, 2024
7e6a66e
test(psl): add validation tests for cuid and uuid
jkomyno Nov 21, 2024
5102928
fix(dmmf): serialise uuid, cuid like nanoid; parse nanoid like uuid, …
jkomyno Nov 21, 2024
e0e5158
chore(psl): revert bad test update to "server_side_functions"
jkomyno Nov 21, 2024
4410268
chore(dmmf): remove unused tuple, simplify "default_value" for genera…
jkomyno Nov 21, 2024
e232e8a
fix(psl): typo in test
jkomyno Nov 21, 2024
fe03f7e
fix(psl): typo in test
jkomyno Nov 21, 2024
f9f2ef1
chore(psl): use itertools
jkomyno Nov 21, 2024
270e457
fix(qe): fix broken shebang in query-engine-wasm/build.sh
aqrln Nov 21, 2024
9b43712
Merge branch 'main' into feat/cuid2-support
jkomyno Nov 21, 2024
d9386d2
Merge branch 'main' into feat/cuid2-support
jkomyno Nov 21, 2024
1e91366
chore(driver-adapters):: bump wrangler version to 3.88.0
jkomyno Nov 21, 2024
f767af2
chore(driver-adapters): bump wasm32-unknown-unknown rust-toolchain to…
jkomyno Nov 21, 2024
c538098
Merge branch 'feat/cuid2-support' of github.com:prisma/prisma-engines…
jkomyno Nov 21, 2024
520fb09
fix(query-engine-wasm): replace "cuid" with "prisma/cuid-rust?branch=…
jkomyno Nov 21, 2024
5e70c06
Merge branch 'feat/cuid2-support' of github.com:prisma/prisma-engines…
jkomyno Nov 21, 2024
c57a8e2
chore: revert upgrade to wrangler (from 3.50.0 to 3.88.0) for suspect…
jkomyno Nov 22, 2024
bd42901
chore: remove leftover
jkomyno Nov 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 34 additions & 14 deletions Cargo.lock

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

11 changes: 9 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ chrono = { version = "0.4.38", features = ["serde"] }
derive_more = "0.99.17"
user-facing-errors = { path = "./libs/user-facing-errors" }
uuid = { version = "1", features = ["serde", "v4", "v7", "js"] }
cuid = { version = "1.3.3" }
cuid = { git = "https://github.com/prisma/cuid-rust", branch = "v1.3.3-wasm32-unknown-unknown" }
getrandom = { version = "0.2" }
# cuid = { path = "../cuid-rust/crates/cuid" }
jkomyno marked this conversation as resolved.
Show resolved Hide resolved

indoc = "2.0.1"
indexmap = { version = "2.2.2", features = ["serde"] }
itertools = "0.12"
Expand All @@ -65,7 +68,6 @@ napi = { version = "2.16.13", default-features = false, features = [
"serde-json",
] }
napi-derive = "2.16.12"
js-sys = { version = "0.3" }
pin-project = "1"
rand = { version = "0.8" }
regex = { version = "1", features = ["std"] }
Expand All @@ -74,6 +76,11 @@ serde-wasm-bindgen = { version = "0.5" }
tracing = { version = "0.1" }
tracing-futures = "0.2"
tsify = { version = "0.4.5" }

# version for `[email protected]`, see:
# https://github.com/rustwasm/wasm-bindgen/pull/4072/
js-sys = { version = "0.3.70" }

wasm-bindgen = { version = "0.2.93" }
wasm-bindgen-futures = { version = "0.4" }
wasm-rs-dbg = { version = "0.1.2", default-features = false, features = ["console-error"] }
Expand Down
6 changes: 3 additions & 3 deletions quaint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ sqlformat = { version = "0.2.3", optional = true }
uuid.workspace = true
crosstarget-utils = { path = "../libs/crosstarget-utils" }
concat-idents = "1.1.5"
getrandom = { workspace = true, optional = true }

[dev-dependencies]
once_cell = "1.3"
Expand All @@ -110,9 +111,8 @@ quaint-test-setup = { path = "quaint-test-setup" }
tokio = { version = "1", features = ["macros", "time"] }
expect-test = "1"

[target.'cfg(target_arch = "wasm32")'.dependencies.getrandom]
version = "0.2"
features = ["js"]
[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom = { workspace = true, features = ["js"] }

[dependencies.ws_stream_tungstenite]
version = "0.14.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ tracing-futures.workspace = true
uuid.workspace = true
indexmap.workspace = true
prisma-metrics.path = "../../../libs/metrics"
cuid.workspace = true
derive_more.workspace = true

[dependencies.query-structure]
Expand Down
7 changes: 3 additions & 4 deletions query-engine/query-structure/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@ prisma-value = { path = "../../libs/prisma-value" }
bigdecimal = "0.3"
thiserror = "1.0"

getrandom = { version = "0.2" }
getrandom = { workspace = true, optional = true }
uuid = { workspace = true, optional = true }
cuid = { workspace = true, optional = true }
nanoid = { version = "0.4.0", optional = true }
chrono.workspace = true

[target.'cfg(target_arch = "wasm32")'.dependencies.getrandom]
version = "0.2"
features = ["js"]
[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom = { workspace = true, features = ["js"] }

[features]
# Support for generating default UUID, CUID, nanoid and datetime values.
Expand Down
2 changes: 1 addition & 1 deletion query-engine/query-structure/src/default_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ impl ValueGeneratorFn {
#[cfg(feature = "default_generators")]
fn generate_cuid(version: u8) -> PrismaValue {
PrismaValue::String(match version {
1 => cuid::cuid1().unwrap(),
1 => cuid::cuid1(),
2 => cuid::cuid2(),
_ => panic!("Unknown `cuid` version: {}", version),
})
Expand Down
Loading