Skip to content

Fluent 2.0 Alpha 3

Pre-release
Pre-release
Compare
Choose a tag to compare
@tanner0101 tanner0101 released this 15 Feb 16:37
· 872 commits to main since this release

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)