vapor / postgres-nio

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

Fix prepared statements #455

Closed fabianfett closed 4 months ago

fabianfett commented 4 months ago

Motivation

Currently Prepared Statements only work if they only use bindings that have the PostgresDataType text. The reason for this is that text has the same representation in text and binary form. For this reason Postgres does not need to know the datatype upfront.

Changes

codecov-commenter commented 4 months ago

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (69ccfdf) 62.28% compared to head (ba9349d) 62.29%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #455 +/- ## ========================================== + Coverage 62.28% 62.29% +0.01% ========================================== Files 124 125 +1 Lines 9937 9946 +9 ========================================== + Hits 6189 6196 +7 - Misses 3748 3750 +2 ``` | [Files](https://app.codecov.io/gh/vapor/postgres-nio/pull/455?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vapor) | Coverage Δ | | |---|---|---| | [...nection State Machine/ConnectionStateMachine.swift](https://app.codecov.io/gh/vapor/postgres-nio/pull/455?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vapor#diff-U291cmNlcy9Qb3N0Z3Jlc05JTy9OZXcvQ29ubmVjdGlvbiBTdGF0ZSBNYWNoaW5lL0Nvbm5lY3Rpb25TdGF0ZU1hY2hpbmUuc3dpZnQ=) | `63.48% <100.00%> (ø)` | | | [...tion State Machine/ExtendedQueryStateMachine.swift](https://app.codecov.io/gh/vapor/postgres-nio/pull/455?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vapor#diff-U291cmNlcy9Qb3N0Z3Jlc05JTy9OZXcvQ29ubmVjdGlvbiBTdGF0ZSBNYWNoaW5lL0V4dGVuZGVkUXVlcnlTdGF0ZU1hY2hpbmUuc3dpZnQ=) | `79.59% <100.00%> (ø)` | | | [...urces/PostgresNIO/New/PostgresChannelHandler.swift](https://app.codecov.io/gh/vapor/postgres-nio/pull/455?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vapor#diff-U291cmNlcy9Qb3N0Z3Jlc05JTy9OZXcvUG9zdGdyZXNDaGFubmVsSGFuZGxlci5zd2lmdA==) | `84.80% <100.00%> (+0.02%)` | :arrow_up: | | [Sources/PostgresNIO/New/PreparedStatement.swift](https://app.codecov.io/gh/vapor/postgres-nio/pull/455?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vapor#diff-U291cmNlcy9Qb3N0Z3Jlc05JTy9OZXcvUHJlcGFyZWRTdGF0ZW1lbnQuc3dpZnQ=) | `100.00% <100.00%> (ø)` | | | [Sources/PostgresNIO/New/PSQLTask.swift](https://app.codecov.io/gh/vapor/postgres-nio/pull/455?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vapor#diff-U291cmNlcy9Qb3N0Z3Jlc05JTy9OZXcvUFNRTFRhc2suc3dpZnQ=) | `77.77% <83.33%> (-0.35%)` | :arrow_down: | | [...es/PostgresNIO/Connection/PostgresConnection.swift](https://app.codecov.io/gh/vapor/postgres-nio/pull/455?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vapor#diff-U291cmNlcy9Qb3N0Z3Jlc05JTy9Db25uZWN0aW9uL1Bvc3RncmVzQ29ubmVjdGlvbi5zd2lmdA==) | `42.28% <40.00%> (-0.20%)` | :arrow_down: | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/vapor/postgres-nio/pull/455/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vapor)