-
Notifications
You must be signed in to change notification settings - Fork 223
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
Issue with jsonb, enum mapping and querying #1208
Comments
How would you expect it to be mapped, as an integer, as text? Why one and not the other? |
There are user provided options where a converter is stored. What you need is to invoke |
I would actually like to store it as a text when writing jsonb to the database, but I found no way to override the default behavior of converting it to an integer in the serialization step. Is this possible?
I'm not sure what you mean. Which options do I get the converter from? And how would I use that to solve this? Sorry. I'm not overly familiar with Npgsql or Postgres, so if there is a way to configure it in such a way that this does not become an issue I would be happy to do so. |
@YohDeadfall what's the status here? Is this simply a dup of #1107, since we don't currently expose access to JSON serialization options? |
Yes, that's the problem. |
Duplicate of #1107 |
I'm getting the following: Npgsql.PostgresException : 22P02: invalid input value for enum "CountryISO3": "166" when doing LINQ-queries with JSONB columns.
The reproduction steps are in this project. Just run the CreateSchema.sql and fix the connection string:
Npgsql.EnumBugger.zip
What I would expect is to be able to do queries with the CountryISO3 enum in a JSONB column even though it is also in the mapped as a type in the database.
Schema:
The program.cs in the zip to reproduce:
The text was updated successfully, but these errors were encountered: