vapor / postgres-nio

🐘 Non-blocking, event-driven Swift client for PostgreSQL.
https://api.vapor.codes/postgresnio/documentation/postgresnio/
MIT License
317 stars 72 forks source link

Add many, many missing types to PostgresDataType #371

Closed gwynne closed 1 year ago

gwynne commented 1 year ago

IMPORTANT: This PR only deals with defining the well-known OIDs for Postgres built-in types. Except for adding more array/element type mappings, it does NOT add any additional support for any of these types, not even basic encoding and decoding! That support will be a separate PR.

Including but not limited to:

Also adds full two-way mappings for every known array type (including existing ones that were missing the mapping, like money).

Requires minor version bump (adds new public API and deprecates PostgresDataType.pgNodeTree)

gwynne commented 1 year ago

Can we add a comment where the source of truth is?

The source of truth I used is the actual pg_type table in a fresh database as it appears in my installation of Postgres 15, with a bunch of "really internal" types removed by eye; there's not really any one place to point for truth other than the Postgres docs.

codecov-commenter commented 1 year ago

Codecov Report

Merging #371 (fe83e88) into main (fcb2e66) will increase coverage by 0.32%. The diff coverage is 54.91%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #371 +/- ## ========================================== + Coverage 42.98% 43.30% +0.32% ========================================== Files 118 118 Lines 8243 8484 +241 ========================================== + Hits 3543 3674 +131 - Misses 4700 4810 +110 ``` | [Impacted Files](https://app.codecov.io/gh/vapor/postgres-nio/pull/371?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vapor) | Coverage Δ | | |---|---|---| | [Sources/PostgresNIO/Data/PostgresDataType.swift](https://app.codecov.io/gh/vapor/postgres-nio/pull/371?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vapor#diff-U291cmNlcy9Qb3N0Z3Jlc05JTy9EYXRhL1Bvc3RncmVzRGF0YVR5cGUuc3dpZnQ=) | `56.19% <54.91%> (-4.19%)` | :arrow_down: |