What previously worked for DocumentStore.For(_ => ... and Npsql v3.x now breaks with Npgsql v4
ex
[NullReferenceException: Object reference not set to an instance of an object.]
Marten.Util.TypeMappings.ToDbType(Type type) +93
Marten.Schema.DuplicatedField..ctor(EnumStorage enumStorage, MemberInfo[] memberPath) +141
Marten.Schema.DocumentMapping.DuplicateField(MemberInfo[] members, String pgType, String columnName) +195
Marten.Events.EventQueryMapping.duplicateField(Expression1 property, String columnName) +94
Marten.Events.EventQueryMapping..ctor(StoreOptions storeOptions) +485
Marten.Storage.StorageFeatures.PostProcessConfiguration() +364
Marten.DocumentStore..ctor(StoreOptions options) +259
Marten.DocumentStore.For(Action1 configure) +60
I see deep down in the weeds Marten uses reflection to get to access a sealed Npgsql.TypeHandlerRegistry. I'm sure this is a known issue, I just couldn't find a way to track the progress, so making an issue.
@mhov If you'll do a quick search through the GitHub repo you'll see other issues and preliminary PR's on this very thing.
@jeremydmiller I did search through the issues and only saw #1027, to which the v4 incompatibility is kind of tangent to the ticket. I forget to look through PRs though. Anyways, I thought this ticket would make it easier to find for others in the same boat. If you think its redundant though, feel free to close it.
I've been reading ShadeTreeDeveloper since the fubumvc days, thanks for all your contributions.
Just in case it's not obvious to future readers, this was resolved in the 3.0 Alpha 1 release (line right before this comment that's easy to gloss over when reading GitHub threads), so just update to the latest and it should work.
This should be way more prevalent a warning on the README until the fix lands in stable. You have to jump through quite some hoops to find this issue here.
This is fixed in the 3.0 branch and alpha. I'm closing this for now.
Most helpful comment
@jeremydmiller I did search through the issues and only saw #1027, to which the v4 incompatibility is kind of tangent to the ticket. I forget to look through PRs though. Anyways, I thought this ticket would make it easier to find for others in the same boat. If you think its redundant though, feel free to close it.
I've been reading ShadeTreeDeveloper since the fubumvc days, thanks for all your contributions.