Releases: vapor/fluent-mysql-driver
Fix deprecation warnings for TLSConfiguration
This patch was authored and released by @gwynne.
A bit of simple cleanup for the deprecations in NIOSSL.
FluentMySQLDriver 4.0.0
This patch was authored and released by @tanner0101.
Docs:
https://docs.vapor.codes/4.0/fluent/overview/
https://docs.vapor.codes/4.0/fluent/model/
https://docs.vapor.codes/4.0/fluent/relations/
https://docs.vapor.codes/4.0/fluent/migration/
https://docs.vapor.codes/4.0/fluent/query/
https://docs.vapor.codes/4.0/fluent/schema/
https://docs.vapor.codes/4.0/fluent/advanced/
More information on Vapor 4 official release:
https://forums.swift.org/t/vapor-4-official-release-begins/34802
Fix .references field constraint
This patch was authored and released by @tanner0101.
Adds a fix for a MySQL syntax quirk that caused .references
constraints to be ignored (#191, fixes #170).
MySQL does not allow the REFERENCES foreign_table (column_name)
syntax like Fluent's other drivers do. When it sees this syntax, it simply ignores it with no warning. The only supported method for declaring for keys is to declare them as "table level" constraints. In other words, as a separate item in the create list.
This change causes MySQL's SQLSchemaConverter
to automatically translate field-level foreign key constraints (.references
) to their table-level counterparts.
Add custom JSON encoder / decoder support
This patch was authored and released by @tanner0101.
Adds support for configuring which JSON coders MySQL uses when serializing nested data to the database (#189).
// Setup custom JSON coders that use unix timestamps
let encoder = JSONEncoder()
encoder.dateEncodingStrategy = .secondsSince1970
let decoder = JSONDecoder()
decoder.dateDecodingStrategy = .secondsSince1970
// Configure MySQL database.
app.databaes.use(.mysql(
configuration: ...,
encoder: MySQLDataEncoder(json: encoder),
decoder: MySQLDataDecoder(json: decoder)
))
Note that for dates specifically, you can use @Timestamp
formats to configure formatting per field.
Support connection pool timeout configuration
This patch was authored and released by @tanner0101.
Adds connectionPoolTimeout
(TimeAmount
) parameter to MySQL configuration methods (#187).
app.databases.use(.mysql(..., connectionPoolTimeout: .seconds(10))
FluentKit 1.0.0 GM
This patch was authored and released by @tanner0101.
Updates this package for compatibility with latest version of FluentKit.
Makes `isConstraintFailure` return true on duplicate constraint failure.
This patch was authored by @JetForMe and released by @gwynne.
Makes isConstraintFailure
return true on duplicate constraint failure. Depends on this PR: vapor/mysql-nio#27
Date and Bool fixes
This patch was authored by @mcdappdev and released by @tanner0101.
Fixes some regressions around Date
and Bool
handling (#168).
Foundation.Date
can now be decoded from.date
(DATE
) columns.
Note: Time information will be silently discarded when
Foundation.Date
is stored in.date
column. Use.datetime
(DATETIME(6)
) to store date + time.
- Fluent's
.bool
data type andSwift.Bool
now use MySQL'sBOOL
(TINYINT
) column type instead ofBIT
.
Add mysql(unixSocketDomainPath:) config option
This patch was authored and released by @tanner0101.
Adds a configuration option for connecting to unix sockets (#164, fixes #161).
app.databases.use(.mysql(unixSocketDomainPath: ...), ...)
Release Candidate 1
Updates to FluentKit Release Candidate 1.
Release candidates represent the final shift toward focusing on bug fixes and documentation. Breaking changes will only be accepted for critical issues. We expect a final release of this package shortly after Swift 5.2's release date.