Fix handling of array bindings containing optional values#279
Merged
Conversation
…values on an extreme fast-path instead of the slowest path. Support values conforming to Postgres[Throwing]DynamicTypeEncodable but not PostgresEncodable. Correctly handle nil values in arrays with optional element types.
ptoffy
approved these changes
Jul 18, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #279 +/- ##
==========================================
+ Coverage 42.84% 43.37% +0.53%
==========================================
Files 13 13
Lines 852 853 +1
==========================================
+ Hits 365 370 +5
+ Misses 487 483 -4
🚀 New features to boost your workflow:
|
MahdiBM
approved these changes
Jul 18, 2026
0xTim
approved these changes
Jul 18, 2026
| <a href="https://swift.org"><img src="https://design.vapor.codes/images/swift60up.svg" alt="Swift 6.0+"></a> | ||
| </p> | ||
|
|
||
| [](https://docs.vapor.codes/4.0/) |
Member
There was a problem hiding this comment.
We can point to the API docs if that's better
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These changes are now available in 2.16.0
SomeCodingKeyinstead of redefining it.nilbinds toNULLis now on the fastest possible path instead of the slowest.Postgres[Throwing]DynamicTypeEncodablebut notPostgres[NonThrowing]Encodableare now handled on the fast path.nilvalues in bound arrays having optional element types (which they should, as all arrays in Postgres have NULLable values) are now handled correctly instead of causing crashes.