npgsql: Npgsql.NpgsqlCommand.DeriveParametersForQuery fails on un-mapped Enums
Exception message:
'No mapping found for PostgreSQL type [MyEnum]'
Stack trace:
at Npgsql.TypeMapping.ConnectorTypeMapper.GetNpgsqlTypeByOid(UInt32 oid)
at Npgsql.NpgsqlCommand.DeriveParametersForQuery()
at Npgsql.NpgsqlCommand.DeriveParameters()
at Npgsql.NpgsqlCommandBuilder.DeriveParameters(NpgsqlCommand command)
...
Further technical details
Npgsql version: 3.3.0-command-caching PostgreSQL version: 9.6.5 Operating system: Win10
Other details: I think it fails for mapped enums too with
System.InvalidOperationException: Invalid parameter type: 55253
at Npgsql.TypeMapping.ConnectorTypeMapper.GetNpgsqlTypeByOid(UInt32 oid)
at Npgsql.NpgsqlCommand.DeriveParametersForQuery()
at Npgsql.NpgsqlCommand.DeriveParameters(
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 42 (42 by maintainers)
@Brar Great job ! I suggest create a separate PR for composite types so I won’t be blocked on enums.
Ok, I’ve implemented NpgsqlParameter.PostgresType as discussed here (see #1740 ) except lazily loading of composite types, which will take some more time.
Well, I’m always willing to support the features that are actually requested and I also find Dmitrys work pretty exciting (and also because, despite my general interest, I’ve got no clue about F# and am happy to see and understand its strengths) I 'will not oppose here.
I’ll go ahead and implement it within #1740 and we’ll see if we like the result or not.