github vapor/fluent 3.0.0-beta.3
Fluent 3.0.0 Beta 3

latest releases: 4.13.0, 4.12.0, 4.11.0...
pre-release8 years ago

New:

  • IndexSupporting protocol which adds index support.
final class Foo: Model, Migration {
    ...

    static func prepare(on connection: Database.Connection) -> Future<Void> {
        return Database.create(self, on: connection) { builder in
            try addProperties(to: builder)
            builder.addIndex(to: \.email, isUnique: true)
        }
    }
}
  • SQLiteModel now enforces id: Int?, meaning less boilerplate for most models.
struct Foo: SQLiteModel {
    var id: Int?
    var name: String
}

final class Bar: SQLiteModel {
    var id: Int?
    var name: String
}
  • New SQLiteUUIDModel which enforces id: UUID?, similar to SQLiteModel

Fixed:

  • Removed Connection Config in favor of Database-based config.

Milestone

Don't miss a new fluent release

NewReleases is sending notifications on new releases.