You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But sometimes this bug is unavoidable: the more compact filter invocation is prevalent inside FluentKit. For example, model.update performs the following filter:
.filter(\._$id == self.id!)
Is there some workaround that I can use to update my models? I'd prefer to keep the column type text in the database if at all possible.
Thanks for the help! This project is fantastic and I'm really appreciative of all the amazing work on it.
To Reproduce
Steps to reproduce the behavior:
Add package with configuration '...'
Send request with options '...'
See error
Expected behavior
A clear and concise description of what you expected to happen.
Environment
Vapor Framework version:
Vapor Toolbox version:
OS version:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
No there is no way around this. Why do you want to keep them as text? Postgres has a native UUID type so that's what Fluent uses. Unfortunately trying to convert that to a string inside Fluent would break too many things.
You might be able to work around this by setting the ID types to Strings instead of UUIDs and converting from UUID to String before you set it in the model
Describe the bug
I'm using UUIDs for primary keys in my Fluent model representation, like this:
Backed by string columns in Postgres, like this:
When I attempt to perform a
filter
operation withQueryBuilder
like this:I get the following error:
Optional(server: operator does not exist: text = uuid (op_error))
If filtering records in a SELECT query, this alternative method of invoking
filter
will avoid the error:But sometimes this bug is unavoidable: the more compact
filter
invocation is prevalent inside FluentKit. For example,model.update
performs the following filter:Is there some workaround that I can use to update my models? I'd prefer to keep the column type
text
in the database if at all possible.Thanks for the help! This project is fantastic and I'm really appreciative of all the amazing work on it.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Environment
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: