Skip to content

Releases: vapor/postgres-nio

Make PostgresNIO tests non throwing

19 Feb 15:14
5876fdf
Compare
Choose a tag to compare
This patch was authored by @fabianfett and released by @0xTim.

Refactor all remaining PostgresNIO tests to get better error diagnostics in case of unexpected errors. (#141)

Follow up to #140.

Remove unintended SASL print statement

12 Feb 10:34
7c52814
Compare
Choose a tag to compare
This patch was authored by @fabianfett and released by @gwynne.

We currently print the internal SASL state when authenticating via SCRAM-SHA256. This messes up logs and is a potential security issue.

Modifications

  • Remove a print statement

Support for SCRAM-SHA-256 SASL authentication

11 Jan 01:41
072b685
Compare
Choose a tag to compare
This patch was authored and released by @gwynne.
  • PostgreSQL supports SCRAM-SHA-256 authentication since version 11. This is preliminary support for that authentication type.

Close connection if requestTLS fails

10 Dec 01:36
2808c4f
Compare
Choose a tag to compare
This patch was authored and released by @0xTim.

Correctly close the PostgreSQL connection if requestTLS fails.

Resolves #133

Support custom JSON coders

09 Sep 16:54
3cf2496
Compare
Choose a tag to compare
This patch was authored by @jordanebelanger and released by @tanner0101.

Add support for custom, non-Foundation, JSON encoder & decoder through global variables PostgresNIO._defaultJSONEncoder and PostgresNIO._defaultJSONDecoder (#125, fixes #126).

Fix prepare(query:) when no data returned

20 Aug 19:16
dddb196
Compare
Choose a tag to compare
This patch was authored by @Jerry-Carter and released by @tanner0101.

Fixes prepare(query:) when used with queries that return no results (like DELETE ...) (#123, fixes #122).

Integer overflow fixes

30 Jul 15:36
70d63c5
Compare
Choose a tag to compare
This patch was authored and released by @tanner0101.

Deprecates PostgresData integer conversion methods that could lead to overflow errors (#120, fixes #119).

Using the following types in release-mode should no longer be susceptible to overflow (or underflow) crashes:

  • UInt
  • Int8
  • UInt16
  • UInt32
  • UInt64

⚠️ However, these types will still be interpreted incorrectly by Postgres since it doesn't have native support for them. This could create problems with other clients connecting to the database. To prevent such issues, using these types will now result in a debug-mode only assertion.

To migrate away from these types, there are two options:

1: Use a wider integer (or type) that does not overflow or underflow.

For example:

  • Int8 -> Int16
  • UInt16 -> Int32
  • UInt32 -> Int (Int64)
  • UInt / UInt64 -> String

The caveats with this method are increased storage size and a database migration is required.

2: Do an explicit bitPattern conversion to the inversely signed type with same bit width.

For example, using Fluent:

// Store the value as `Int32` in Postgres
@Field(key: "foo")
var _foo: Int32

// Access the value as if it were a `UInt32`. 
var foo: UInt32 {
    get {
        .init(bitPattern: self._foo)
    }
    set {
        self._foo = .init(bitPattern: newValue)
    }
}

The caveat with this method is that other clients may misinterpret the stored value.

Fix warnings + update CI

29 Jul 00:54
aa5c2df
Compare
Choose a tag to compare
This patch was authored and released by @tanner0101.

Fix Xcode 12 beta 3 warnings and add additional test cases to CI (#117).

Support parameter status messages in query / simpleQuery

16 Jul 17:01
ffa8b35
Compare
Choose a tag to compare
This patch was authored and released by @tanner0101.

Adds support for parameter status (S) messages in query and simpleQuery calls (#116, fixes #115).

Add support for VARCHAR[]

14 Jul 18:11
711b726
Compare
Choose a tag to compare
This patch was authored and released by @tanner0101.

Adds support for CHARACTER VARYING[] a.k.a VARCHAR[] (#114, fixes #113).