Skip to content
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

Add resolvers check in GlobalTypeMapper #15

Merged
merged 1 commit into from
Sep 23, 2023

Conversation

roji
Copy link
Collaborator

@roji roji commented Sep 23, 2023

No description provided.

@roji roji merged commit 9a4e731 into NinoFloris:handler-rework Sep 23, 2023
18 checks passed
@roji roji deleted the PluginResolverCheck branch September 23, 2023 13:45
NinoFloris added a commit that referenced this pull request Sep 25, 2023
* Add legacy datetime support

* No unsupported resolver exceptions during introspection

* Fixes and a little lie about array types to appease the tests

* Add money converter

* Add hstore converter

* Improve range converter

* Rework buffer requirements

* Add json and jsonb textual reading/writing

* Naming

* Implement NTS support

Some resolution tweaks still needed

* Fix extension check

* Fix resolution

Arrays are still missing

* Fix datatypename normalization from NpgsqlDbType

* Remove dead code

* Add arrays

* More ns2.0 fixes again

* Check binary size difference

* Move abstract up and impl down

* Small fixes

* Fix datatable crap

* Add more text types

* Multiranges

* Small fixes

* Improve handling of sequential access cursor

* Bounded column reads

* Small fixes and TextReader support

* Final changes on bounded reads

Also some bug fixes due to bounded reads correctly failing due to unhandled data!

* Implement GetChars over TextReader

* Implement GetBytes

* More test fixes

* Handle cancellation retry in Read/ReadAsync buffer stream methods

* Netstandard fixes

* Another iteration of bounded reads, automatically consume data for column reads ending in an exception

Without paying for a try finally or other expensive constructs

* Have nested data reader use nested reads as well

* Improve nested reader invalidation mechanism

* Clarify rereading rules for sequential mode

* Add back byte reading fast path

* Implement ltree

* Change removed property

* Colocate sync/async reading

* Small fixes after doing a review

* Complete some converter resolver todos

* Remove test for a mapping that doesn't exist

* Add timestamp(tz) range mappings

* Add back jagged validation

* Breaking change, remove support for non generic list and derived List<T> types

* Add byte reading/writing of text and json

* Remove roundtripping restrictions on certain bytea mappings

* Add jsonpath support

* Revert an invalid optimization

* Add missed array mappings

* Add stream writing support to bytea

* Cache parameter size

* Add multirange resolver

* Small configurability additions to PgTypeInfo

And loosen boxing info restriction

* Centralize type equality logic

* Stream fix

* Rationalize unboxing behavior, also opens up ability for arrays to be constrained by IList instead of object

* Change array converters to constrain to IList

* Add ts and tstzmultirange

* Allow null return from converter resolver

* Create specialized versions for all the different datetime resolver kinds

* And remove the composing resolvers

* Add accurate type names in datetime resolver exception

* Don't lose stacktrace on break if possible

* Add bitstring string writing

* Resolve aot warning

* Handle a trim warning

* Suppress DbDataReader.GetFieldType dynamically accessed members attribute

Odbc and OleDb do the same

* Remove dead code, add comments and other small iterations

* Bring back default name translator

* Add unmapped enums

* Add valuetuple and tuple records

* Bring truncate behavior back as a compat feature

And cleanup naming, some todos

* Rename method

* Cleanup

* Package version bumps

* Add STJ poco and known types support

pg arrays over them is next

* Revert nonsense

* Fix typo

* Improve introspection mode

* Make nested writes consistent with reads

* Add composite type support

* Netstandard fixes

* Add STJ arrays

* Move field description info cache to reader

Shared prepared statements would otherwise thrash each others caches.

* Fixes

* Add missed configure awaits

WriteBuffer will be in a separate commit with the sync over async writes change

* Make datatypename have an implicit conversion to string

* Fix nullable resolvers

* Improve jsondocument sizing somewhat until unknown sizing support is done

* Add GeoJSON support

* Small improvement

* Add Json.NET support

* Add comment

* Make PgConverterInfo and Bind internal

* Implement boxed converter support in composites

* Clean up PgTypeInfo api surface

* Move delegating GetFieldValue calls to non-GVM GetFieldValueCore

* Fix benchmark project errors

* Properly respect async flag on nested read disposal (and ConfigureAwait the IAsyncDisposable)

* Remove an ensure overload

* Add back some friendly errors on missing pg types

* Fix cache bleed

* Make type info cache code read better

* Make multirange mappings conditional on db support

* Actually revert AttemptPostgresCancellation and friends after dispose to help replication

* Catch race during extension create

* Assert null cache

* Remove dead reference

* Root out more invalid or missing reader state transitions

* Fix writer ifdef issue

* Fix double converter netstandard code

* Fix json type info resolver being null

* Disable noda time tests for now

* Segregate tests simulating errors to prevent unrelated test from failing under multiplexing mode

* Always reset read started

* Readability improvements

* Centralize parameter info resets

* Only reset binding info for size changes

* Improve PgTypeInfo api design

* Try to prevent more multiplexing issues

* Go over some TODOs

* Add windows exemption to flaky test

* Reduce jsonb text converter bloat

* Rename

* Shorten BufferData{Async} to Buffer{Async}

* Improve nullable handling of sizes

* Reduce the amount of types we reference

* Create a dgml file to accompany the mstat

* Reduce bloat

* Small clarifications in abstractions

* Move ImmutableDictionary mapping for hstore to extra conversions

* And move BigInteger too

* Properly remove all traces of ImmutableDictionary from hstore

* Only reference if not trimmed

* Fix typo

* Move out of array and match name instead

* Typo

* Bump sdk version to preview 7

* Break away the last bits of PGUtil

* Remove unused namespaces

* Drop extension method

* Make ValueMetadata readonly

* Fix todo

* Current fix

* Move unconsumed read error to endread

* Sync binary exporter to patterns used in db data reader

* Enable all plugin tests and fix GeoJson errors

* Fix infinite range bug

* Fix some exporter and replication value bugs

Also make Skip take an int as it's a saner size bound

* Fix remaining nodatime plugin issues

* Restructure range resolver to be more priority based

* Add transaction for multiplexing to another test

* Don't make json types default for reading

* Add net6.0 tfm to json.net to work around init prop issues

* Allow type predicates to deny default matches

Only if the requirement would allow these to match otherwise, 'true' results are ignored for MatchRequirement.All

* Fix remaining issues with Json.Net

What a kludge...

* Fix legacy infinite errors on NodaTime

* Fix some incorrect null type predicate results

* Reflect removal of silly read default from STJ poco resolver

* Simplify infinity conversions again

* Check pg dimension bound during array write

* Make range and multirange internal and add static factory instead

* Actually check length in all cases

* Fix returned multirange type

* Normalize [] to _ in the constructor

* Fix compilation issue

* Remove incorrect xmldoc

* Improve composite type info error message

* Move out some classes

* Rename

* Speed up representational type resolution

* Add missed representational type resolutions

* Bring back dev build tfm for Json.Net

* Small naming and error message improvements

* Make ColumnStream rely on cumulative position for consume during dispose

* Improve PgReader Init/Commit StartRead/EndRead code

* Remove _readStarted entirely now we have EndRead doing the consumed checks

* More readability improvements

* Merge version byte prefixed text converter

Thanks @roji for the idea

* Merge Hstore Read and ReadInto

* Move some exceptions to resources

* Fast path other read bytes methods

* Monomorphize byte array converter

* Streamline field read infra

* Simplify cleanup

* Fix boxing for default converters

* Speed up GetInfo and GetFieldValueCore

* Add info cache set and load for prepared statements

* Speed up reader start/stop init/commit

* Speed up primitive reads

* Improve message

* Remove unused fields

* Small speedup

* Improve encapsulation of NpgsqlParameter

* More parameter streamlining

* Small readability improvements

* Improve MultiWriteState state clearing behavior

* Centralize async helper read logic

* Add some missed buffer checks

* Remove redundant code

* Map streaming onto SizeKind.Unknown instead of Size.Zero to make BufferRequirements properly monoidal

* Clarify bufferRequirements' applicability and fix nullable to adhere to it

* Reader naming and structure improvements

* Fix seek to column in GetFieldValueAsync

* Address nits

* Make sure boxing infos use GetResolutionAsObject

* Rework parameter ValueType code

* Reset type info on Value changes for typeof(object) generic parameters

* Address more nits

* Upgrade to RC1

* Fix a default type fallback issue in the cache lookup

* Add array type checks

With various fixes

Closes npgsql#5137

* Fix some more mappings and tests

* Fix the remaining array mapping issues

* Fix ensure issue and move PgWriter property to a method

* Use full version

* Remove nightly feed

* Add pragma for new ref readonly warnings

Which we can ignore due to consuming it directly in Unsafe.As, which does not write to its ref
However overloads cannot be made based on refness so we're stuck with Unsafe.As being ref...

* Fix nodatime array/multirange mapping tests

* Fix small bug in Json.NET synthetic mappings

* Make multirange asserts conditional

* Fix debug build issues

* Change PgReader 'not exactly consumed' exception and behavior

* Replace debug only exception

* Tidy up all dynamic mapping code

* Implement unmapped ranges

* Small tweaks

* Don't rely on 'current' data inside GetBytes/GetData

* Fix SequentialAccess IsDbNull (resumable) + Get... (some non-resumable op)

* Use DateTimeKind.Unspecified and assert on it in tests

* Address nits

* Use new big endian support in Guid

* Add constants for states in BinaryExporter

* Add support for unmapped multiranges

* Don't try to get an object converter for type = null

* Rename TypeCatalog to DatabaseInfo

* Use IsAtStart in PgBufferedConverter

* Add missed constant uses

* Actually implement IDisposable...

* Address feedback

* Add resolvers check in GlobalTypeMapper (#15)

* Address feedback

* Breaking change, move refcursor and jsonpath to DbType.Object

* Rework NotSupportedException back to InvalidCastException to align to ADO.NET convention

* Make GetPostgresTypeXYZ/GetPgType overloads of GetPostgresType

* Message tweak

* Improve GetConcreteResolution

* Make jsonpath test conditional

---------

Co-authored-by: Shay Rojansky <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants