Releases: vapor/mysql-kit
Allow `MySQLConfiguration` to be updated
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
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
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
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
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
MySQLKit 4.0.0
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
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
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
This patch was authored and released by @tanner0101.
Adds supported SQL trigger options to MySQLDialect
(#284).
Also improves CI.