github vapor/fluent 2.0.0-alpha.3
Fluent 2.0 Alpha 3

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

Relations

Relations have been updated to include both entities in the generic signature. This will allow Fluent to access more type information on the related entities to perform more functions in the future.

PivotProtocol

Introduces a new pivot protocol that will allow making custom pivot tables easier. For example, storing the amount of upvotes on a Pivot<User, Comments>.

Union -> Join

The misleadingly named Union is renamed to Join

Foreign / Local clarification

The terms foreign and local have been used somewhat haphazardly in Fluent. The formal definition states:

In the context of relational databases, a foreign key is a field (or collection of fields) in one table that uniquely identifies a row of another table or the same table. In simpler words, the foreign key is defined in a second table, but it refers to the primary key in the first table.

Usage in Fluent has been updated to reflect this.

Double Pivot

Some code has been added to allow 3 way pivot relation checking for pivots that have another pivot stored in either side. For example:

let doublePivot = Pivot<
    Pivot<Users, Teams>,
    Roles
>
let user = Users.random()
let team = Teams.random()
let role = Roles.random()

let related = try doublePivot.related(left: user, middle: team, right: role)

Don't miss a new fluent release

NewReleases is sending notifications on new releases.