vapor / fluent

Vapor ORM (queries, models, and relations) for NoSQL and SQL databases
https://docs.vapor.codes/4.0/fluent/overview/
MIT License
1.3k stars 171 forks source link

ID Field (UUID) not automatically generating #737

Closed anonymouz4 closed 2 years ago

anonymouz4 commented 2 years ago

@ID(key: .id) var id: UUID?

When not initializing the ID field in a model, and then calling try account?.requireID(), the following error gets thrown:

{"error":true,"reason":"server: invalid input syntax for type uuid: \"Optional(4C16EB46-5CFD-46B5-88D7-5917970F1E2A)\" (string_to_uuid)"}

Somehow the ID got optional and did not get unwrapped

anonymouz4 commented 2 years ago

Not a bug, happened due to an external library. This can be deleted.