Skip to content

Releases: vapor/fluent

Fluent 2.0 Alpha 3.1

17 Feb 16:24
Compare
Choose a tag to compare
Fluent 2.0 Alpha 3.1 Pre-release
Pre-release

New:

  • Ability to specify primary key fields.

Fluent 2.0 Alpha 3

15 Feb 16:37
Compare
Choose a tag to compare
Fluent 2.0 Alpha 3 Pre-release
Pre-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)

Fluent 2.0 Alpha 2

13 Feb 13:11
Compare
Choose a tag to compare
Fluent 2.0 Alpha 2 Pre-release
Pre-release

New:

  • Entities can apply custom ID Keys.

Custom ID Key

You can override the idKey for an individual entity by implement static var idKey: String on your model. Fluent will now use this id key for fetching your model, saving, etc (instead of the driver's id key).

final class MyUser: Entity {
    ...
    static var idKey = "fooid"
}

Note: Preparations still require a custom idKey to be passed.

extension MyUser {
    static func prepare(_ database: Database) throws {
        try database.create(entity) { myUsers in
            myUsers.id(idKey)
            ...
        }
    }
}

Fluent 1.4.0

13 Feb 14:44
Compare
Choose a tag to compare

New:

  • Entities can apply custom ID Keys.
  • in memory db issue

Custom ID Key

You can override the idKey for an individual entity by implement static var idKey: String on your model. Fluent will now use this id key for fetching your model, saving, etc (instead of the driver's id key).

final class MyUser: Entity {
    ...
    static var idKey = "fooid"
}

Note: Preparations still require a custom idKey to be passed.

extension MyUser {
    static func prepare(_ database: Database) throws {
        try database.create(entity) { myUsers in
            myUsers.id(idKey)
            ...
        }
    }
}

Fluent 1.3.8

15 Feb 16:35
71a83c9
Compare
Choose a tag to compare

Fixed:

  • Fix bug where In-Memory DB limit was causing Array out-of-bounds crash

Fluent 2.0 Alpha 1

10 Feb 14:51
Compare
Choose a tag to compare
Fluent 2.0 Alpha 1 Pre-release
Pre-release

New:

  • Updated to include raw commands
  • Updated underlying dependencies to latest versions
  • Date Support

Fluent 1.3.7

09 Feb 08:54
Compare
Choose a tag to compare

New:

  • Allow custom id keys for parent

Fluent 1.3.6

07 Feb 12:51
Compare
Choose a tag to compare

Fixed:

  • Ignore nil, Node.null, and 0 values for newly created model identifiers.

Fluent 1.3.5

06 Feb 13:31
Compare
Choose a tag to compare

New:

  • DatabaseContext now passed to init(node: ...) and makeNode(...)

Fluent 1.3.4

02 Feb 09:12
Compare
Choose a tag to compare

Fixed:

  • Support for limits in the in-memory database.