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

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

New:

  • #376 Referential actions are now supported for ReferenceSupporting databases.
try builder.addReference(from: \.ownerID, to: \User.id, actions: ReferentialActions(update: .update, delete: .prevent))
  • #376 Auto migration is now available via a static method on Model where Database: SchemaSupporting. This will allow for easier customization of migrations.
extension Pet: Migration {
    /// See `Migration.prepare(on:)`
    public static func prepare(on connection: Database.Connection) -> Future<Void> {
        return Database.create(self, on: connection) { builder in
            try addProperties(to: builder)
            try builder.addReference(from: \.ownerID, to: \User.id)
        }
    }
}
  • #371 Added CRUD operations for Future where T: Model
let user: Future<User> = ...
user.save(on: ...)
  • #372 structs can now be conformed to Model

Fixes

  • SoftDeletable models can now be saved
  • Several missing overloads added to QueryBuilder operators and methods
  • Several fixes to relations and joins

Milestone

Don't miss a new fluent release

NewReleases is sending notifications on new releases.