Skip to content

Releases: vapor/mysql-kit

Allow `MySQLConfiguration` to be updated

22 Jul 09:50
f8bd73b
Compare
Choose a tag to compare
This patch was authored by @lodenrogue and released by @0xTim.

Addresses issue: vapor/fluent-mysql-driver#211

This allows the MySQLConfiguration to be edited after it has been instantiated, for example setting a TLSConfiguration

Fix SwiftCrypto version pin

23 Dec 02:03
f54e087
Compare
Choose a tag to compare
This patch was authored and released by @gwynne.

This solves users of Fluent's MySQL driver getting silently stuck on version 1.1.6 of swift-crypto (the current, source-compatible version is 2.0.3).

It would be far preferable to replace the usage of Insecure.SHA1 in MySQLDialect with something better suited to the purpose and thus drop the Crypto dependency in MySQLKit altogether, but we can't do that without breaking migrations in existing databases.

Due to the change in dependency version requirement, this is semver-minor.

Declare supported UNION features

14 Dec 14:48
66ecfa0
Compare
Choose a tag to compare
This patch was authored and released by @gwynne.

Leverages the new dialect flags from vapor/sql-kit#144 to enable full UNION queries according to MySQL's support.

The increased SQLKit version requirement makes this a semver-minor change.

Enable UPSERT support for MySQL

04 Nov 23:48
d9b68c3
Compare
Choose a tag to compare
This patch was authored and released by @gwynne.

Also enables correctly running the expanded SQLKit benchmark suite.

semver-minor because the new SQLKit version requirement is a semver-minor bump.

Address issues in decoding data from the database

01 Sep 18:08
529bde8
Compare
Choose a tag to compare
This patch was authored and released by @gwynne.

See commit log for details; in short, the MySQLDataDecoder logic has been retooled to fix some usage errors, address a couple of very minor bugs, and slightly improve performance. Additional changes:

  • Fixes TLSConfiguration.forClient() deprecation warnings by using .makeClientConfiguration() instead as recommended.
  • Some well-overdue updates to CI for this package.

Note: While these changes do not add any new public API, they are nonetheless marked as semver-minor to reflect the addition of a new explicit dependency on a recent version of NIOSSL.

Set default mysql port to 3306

25 Sep 04:51
fe836ec
Compare
Choose a tag to compare
This patch was authored by @zengxs and released by @gwynne.

MySQLKit 4.0.0

28 Jul 19:48
822108a
Compare
Choose a tag to compare
This patch was authored and released by @tanner0101.

More information on Vapor 4 official release:
https://forums.swift.org/t/vapor-4-official-release-begins/34802

Improve encode/decode error messages

28 Jul 19:07
7d2f821
Compare
Choose a tag to compare
Pre-release
This patch was authored and released by @tanner0101.

Improves encode / decode error messages by including the actual value (#287, fixes #283).

Add custom JSON encoder / decoder support

27 Jul 21:40
a154cf3
Compare
Choose a tag to compare
This patch was authored and released by @tanner0101.

Adds support for configuring which JSON coders MySQL uses when conforming to SQLKit's APIs (#285, fixes #252).

// Some existing conformer to `MySQLDatabase`
let mysql: MySQLDatabase = ...

// Setup custom JSON coders that use unix timestamps
let encoder = JSONEncoder()
encoder.dateEncodingStrategy = .secondsSince1970
let decoder = JSONDecoder()
decoder.dateDecodingStrategy = .secondsSince1970

// Use `sql()` method to create a `SQLDatabase` passing in
// MySQL coders that use the custom JSON coders.
let sql = mysql.sql(
    encoder: MySQLDataEncoder(json: encoder), 
    decoder: MySQLDataDecoder(json: decoder)
)

// Sample model with nested JSON field.
struct Foo: Codable, Equatable {
    struct Bar: Codable, Equatable {
        var baz: Date
    }
    var bar: Bar
}

// New instance to create.
let foo = Foo(
    bar: Bar(
        baz: Date(timeIntervalSince1970: 1337)
    )
)
// INSERT INTO `foo` (`bar`) VALUES (?) ["{\"baz\":1337}"]
try db.insert(into: "foo").model(foo).run().wait()

Add dialect trigger options

23 Jul 17:32
c4d32e3
Compare
Choose a tag to compare
Pre-release
This patch was authored and released by @tanner0101.

Adds supported SQL trigger options to MySQLDialect (#284).

Also improves CI.