coravel icon indicating copy to clipboard operation
coravel copied to clipboard

Support for Noda Time

Open k3davis opened this issue 3 years ago • 1 comments

Describe the solution you'd like

This library is very promising (thanks for all your work!). Unfortunately I wasn't able to use it in my project because my DbContext uses PostgreSQL with an option that the library doesn't seem to support, "UseNodaTime()", which replaces DateTime properties with Instant (from the library Npgsql.EntityFramework.PostgreSQL.NodaTime).

When I try to run the project in this way I get this exception, which lead me to believe lack of Noda Time support was the cause of the failure:

Can't write CLR type System.DateTime with handler type TimestampHandler

Specifically I received this when trying to open the "Jobs" tab of the Coravel Pro dashboard. I made a judgement call that this is a feature request rather than a "bug" because my configuration is probably not like your typical use case.

Perhaps there is way to implement an abstraction or option to overcome this error. I'm making an assumption that the "crud operations" probably wouldn't work with this type either, though I didn't get that far.

Describe alternatives you've considered

I tried, though not exhaustively, to create a second DbContext that didn't use the same options, but having more than one DbContext makes migrations much more cumbersome.

I may try again by taking the route of using Coravel in a completely separate project that runs in its own database and uses HttpClientFactory to interact with data in the main application, but that's a bit cumbersome. Open to other suggestions.

k3davis avatar Sep 17 '20 18:09 k3davis

Thanks for the kind words about the project!

I'm not familiar with the specific library for POstgreSQL.NodaTime here. I'll have to look into that and see what the options are.... But yes, I would expect most features wouldn't work since the tables are using DateTimes.

jamesmh avatar Sep 21 '20 02:09 jamesmh