Skip to content

Allow BCL date/time types to be used when the NodaTime plugin is in use #2439

@roji

Description

@roji

Since we've released the NodaTime plugin in 4.0, we occasionally receive complaints about not being able to use both the BCL types and the NodaTime plugin in the same application. Marten specifically seems to be severely impacted by this (JasperFx/marten#1242), but there have been other requests (e.g. #2295, npgsql/efcore.pg#747).

One the write side things seem easy, but on the read side, there's one handler mapped to a given PostgreSQL type. We could have more than one handler mapped there (possibly by having NpgsqlTypeHandler reference the "next" handler as a linked list), but right now the handler API throws when it fails, so we'd have to catch that exception and move on to the next handler (which isn't really acceptable). We could modify the handler API to try writing (i.e. return a bool), but that's a non-trivial API change.

Interestingly we just ran into a very similar issue in #2435 (which we ended up not needing).

/cc @jeremydmiller @tetious @lngr

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions