Skip to content

Fluent 3.0.0 Beta 3

Pre-release
Pre-release

Choose a tag to compare

@tanner0101 tanner0101 released this 19 Feb 19:31
· 471 commits to main since this release
085acf0

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