-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Labels
Description
Report hasn't been filed before.
- I have verified that the bug I'm about to report hasn't been filed before.
What version of drizzle-orm
are you using?
0.43.1
What version of drizzle-kit
are you using?
0.31.1
Other packages
[email protected], [email protected]
Describe the Bug
The UUIDs created via drizzle-seed
isn't compatible with what is validated via drizzle-zod
.
Probably due to RFC 4122 spec.
// Drizzle-seed generated
708257e5-e2b4-410c-65ec-c6a81590be17 (Reported as invalid)
Version digit (13th): The character at the 13th position is '4' (708257e5-e2b4-**4**10c-65ec-c6a81590be17). This is correct for a version 4 UUID.
Variant digit (17th): The character at the 17th position is '6' (708257e5-e2b4-410c-**6**5ec-c6a81590be17). This is not one of the allowed characters ('8', '9', 'a', or 'b') for an RFC 4122 compliant UUID. This is the most likely reason for the validation failure.
// crypto.randomUUID()
8fec6e81-233e-4a68-8a4d-3aa19dbb3816 (Accepted as valid)
Version digit (13th): The character at the 13th position is '4' (8fec6e81-233e-**4**a68-8a4d-3aa19dbb3816). This is correct for a version 4 UUID.
Variant digit (17th): The character at the 17th position is '8' (8fec6e81-233e-4a68-**8**a4d-3aa19dbb3816). This is one of the allowed characters ('8', '9', 'a', or 'b') for an RFC 4122 compliant UUID.
Sample schema:
export const page = pgTable('page', {
id: uuid().defaultRandom().primaryKey(),
})
This wasn't an issues in the v3
of drizzle-zod
.
dmythro, angusd3v, mau27galvez, thisisbintang, felix-quotez and 6 moreOleksiiKH0240