Swiftpack.co - Package - vapor/fluent-mysql-driver

Github

link
Stars: 57

Used By

Total: 0

Releases

FluentMySQLDriver 4.0.0 - 2020-07-29 14:55:08

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 - 2020-07-29 01:44:36

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 - 2020-07-28 15:11:33

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 - 2020-07-23 19:35:47

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 - 2020-05-29 22:23:21

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. - 2020-05-06 09:51:34

This patch was authored by @JetForMe and released by @gwynne.

Makes isConstraintFailure return true on duplicate constraint failure. Depends on this PR: https://github.com/vapor/mysql-nio/pull/27

Date and Bool fixes - 2020-04-22 22:56:19

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 and Swift.Bool now use MySQL's BOOL (TINYINT) column type instead of BIT.

Add mysql(unixSocketDomainPath:) config option - 2020-03-04 21:07:14

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 - 2020-02-28 22:53:22

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.

FluentKit Beta 5 - 2020-02-25 21:29:37

Updates for https://github.com/vapor/fluent-kit/releases/tag/1.0.0-beta.5.

FluentKit Beta 4 - 2020-02-15 22:26:13

Updates to https://github.com/vapor/fluent-kit/releases/tag/1.0.0-beta.4.

Support dynamic ID keys - 2020-02-12 19:58:48

Adds support for dynamic ID keys introduced in https://github.com/vapor/fluent-kit/pull/153 (#158).

FluentMySQLDriver Beta 2.2 - 2019-12-11 04:53:09

  • .mysql driver factory now defaults to non-nil TLSConfiguration

FluentMySQLDriver 4.0.0 Beta 2.1 - 2019-12-11 01:44:58

  • Adds support for storing DatabaseSchema.DataType.array(of:) as JSON (#156)

FluentMySQLDriver 4.0.0 Beta 2 - 2019-12-09 20:26:29

Update to latest FluentKit and MySQLKit beta 2 releases

FluentMySQLDriver 4.0.0 Beta 1 - 2019-10-25 02:48:51

Updated to FluentKit beta 1.

FluentMySQL 3.1.0 - 2019-10-14 23:31:32

  • Add support for deleting constraints. (#149)

Fluent MySQL 3.0.2 - 2019-10-02 16:31:37

  • Fixed an issue causing deleted columns to be ignored during schema changes. (#147)

FluentMySQLDriver 4.0.0 Alpha 3 - 2019-08-14 18:51:42

FluentMySQLDriver 4.0.0 Alpha 1.1 - 2019-08-08 19:59:38

Fixed:

  • .bool schema type now yields BIT type in MySQL
  • Removed force try from onRow closures
  • Added a large model test

FluentMySQLDriver 4.0.0 Alpha 1 - 2019-08-02 18:52:26

Now built on FluentKit, MySQLNIO, and SwiftNIO 2.

Fluent MySQL 3.0.1 - 2018-07-24 23:11:24

Fixed:

  • Removed leftover MySQLConfig struct. Use MySQLDatabaseConfig.

Fluent MySQL 3.0.0 - 2018-07-19 22:47:14

Fluent MySQL 3.0 is here 🎉 🖋🐬 Swift ORM (queries, models, relations, etc) built on MySQL.

See the updated documentation for more information: docs.vapor.codes/3.0/fluent/getting-started/ docs.vapor.codes/3.0/mysql/getting-started/

And of course, check out the API docs for detailed information about the public API: api.vapor.codes/fluent/latest/Fluent api.vapor.codes/mysql/latest/MySQL

Fluent MySQL 3.0.0 RC 4.0.1 - 2018-06-19 23:58:25

Fixed:

  • Loosened protocol requirements for create(orUpdate:) and create(orIgnore:)
  • Fixed issue with MySQLEnumType data type conformance.

Fluent MySQL 3.0.0 RC 4 - 2018-06-19 23:20:53

New:

  • Update to vapor/sql 2.0 protocols.

Fluent MySQL 3.0.0 RC 3.0.1 - 2018-06-18 04:03:34

Fixed:

  • Removing unnecessary throw declaration from atomic create methods.

Fluent MySQL 3.0.2 - 2018-06-18 04:02:57

Fixed:

  • Add support for Int AUTO_INCREMENT parsing.

Fluent MySQL 3.0.0 RC 3.0.3 - 2018-06-18 04:02:13

Fixed:

  • Fixed an issue where CONSTRAINT names could be too long.

Fluent MySQL 3.0.0 RC 3 - 2018-06-15 03:49:26

New:

  • New atomic create methods: Model.create(ifNotExists:) and Model.create(orIgnore:).
  • Big improvements to Fluent and MySQL:
    • https://github.com/vapor/fluent/releases/tag/3.0.0-rc.3.
    • https://github.com/vapor/mysql/releases/tag/3.0.0-rc.3.

Fixed:

  • Lots of bug fixes.

Fluent MySQL 3.0.0 RC 2.5 - 2018-05-16 18:42:55

New:

  • Added a MySQLEnum helper type for using nested enums on models. (#99, #103, #112)
// `FixedWidthInteger` backed enums are easiest to conform
enum PetType: Int, MySQLEnumType {
    case cat, dog
}

// Other enums require `reflectDecoded`
enum FavoriteTreat: String, MySQLEnumType {
    case bone = "b"
    case tuna = "t"
    static func reflectDecoded() -> (FavoriteTreat, FavoriteTreat) {
        return (.bone, .tuna)
    }
}