fluent

Vapor ORM (queries, models, and relations) for NoSQL and SQL databases

MIT License

Stars
1.3K
Committers
70

Bot releases are hidden (Show)

fluent - Add cache protocol

Published by tanner0101 over 3 years ago

This patch was authored and released by @tanner0101.

Add Fluent implementation for Vapor's new cache protocol: https://github.com/vapor/vapor/pull/2558

app.caches.use(.fluent)
// Or with specific database id
app.caches.use(.fluent(.foo))

Make sure to add the CacheEntry migration (similar to SessionRecord).

app.migrations.add(CacheEntry.migration)
fluent - Add default implementation for CredentialsAuthenticatable

Published by tanner0101 almost 4 years ago

This patch was authored and released by @0xTim.

Improves the experience for users writing web applications. Adds a ModelCredentialsAuthenticator to automatically conform Model types to CredentialsAuthenticatable and provide a middleware to use.

This can be used when logging in users via a web form, as shown in the tests. This also backfills some tests for ModelSessionAuthenticatable.

Also fixes a bug where the SessionAuthenticator was not using the provided DatabaseID

Resolves #710
Resolves #701

Docs here vapor/docs#576

fluent - Adds the ability to retrieve query history

Published by tanner0101 over 4 years ago

This patch was authored and released by @mcdappdev.

Tracks database query history for a Request or Application (#689).

To use on the Application:

app.fluent.history.start()
app.fluent.history.stop()
app.fluent.history.clear()

Access the history by calling:

app.fluent.history.queries

The same methods/properties exist on Request:

req.fluent.history.start()
req.fluent.history.stop()
req.fluent.history.clear()
req.fluent.history
fluent - FluentKit 1.0.0 GM

Published by tanner0101 over 4 years ago

This patch was authored and released by @tanner0101.

Updates this package for compatibility with latest version of FluentKit.

fluent - Add unique index to SessionRecord key

Published by tanner0101 over 4 years ago

This patch was authored by @SusanDoggie and released by @tanner0101.

Adds a unique index to SessionRecord.key to improve data integrity and key lookup performance (#680).

⚠️ If you have already added the SessionRecord migration in production, you will need to add this unique index manually.

fluent - Fix deprecated renamed fix for ModelTokenAuthenticatable

Published by tanner0101 over 4 years ago

This patch was authored by @0xTim and released by @tanner0101.

Fixes incorrect rename deprecation for ModelTokenAuthenticatable (#677).

fluent - Update to Vapor 4 GM

Published by tanner0101 over 4 years ago

This patch was authored and released by @tanner0101.

Updated for final Vapor 4.0.0 release (#672).

  • ModelUser renamed to ModelAuthenticatable.
  • ModelUserToken renamed to ModelTokenAuthenticatable.
  • Sessions authenticator now creatable via static method.
- app.fluent.sessions.middleware()
+ User.sessionAuthenticator()
  • New ModelSessionAuthenticatable helper protocol added.
  • Session renamed to SessionRecord. Now uses _fluent_sessions schema.
fluent - Release Candidate 1

Published by tanner0101 over 4 years ago

Updates to Swift 5.2.

Release candidates represent the final shift toward focusing on bug fixes and documentation. Breaking changes will only be accepted for critical issues. We expect a final release of this package shortly after Swift 5.2's release date.

fluent - Fluent Beta 3

Published by tanner0101 over 4 years ago

  • Now compatible with latest Vapor beta 4 and FluentKit beta 5
fluent - Export Custom Operators

Published by tanner0101 over 4 years ago

Provides a workaround for SR-12132 which causes custom operators defined in FluentKit to not be exported correctly (fixes vapor/fluent-kit#144, #656)

Custom operators for String filtering will now be available by importing just Fluent:

  • ~~: Value contains string
  • =~: Value has string prefix
  • ~=: Value has string suffix
  • !~: Value doesn't contain string
  • !=~: Value doesn't have string prefix
  • !~=: Value doesn't have string suffix

As well as operators for Array filtering:

  • ~~: Value in array
  • !~: Value not in array
fluent - Add ModelUser and ModelUserToken

Published by tanner0101 over 4 years ago

Adds two new protocols ModelUser and ModelUserToken for easily implementing basic and bearer authentication using Fluent models. Docs will be available at https://docs.vapor.codes/4.0/fluent/authentication/

fluent - Add autoMigrate and autoRevert methods

Published by tanner0101 over 4 years ago

Adds autoMigrate and autoRevert methods to Application. These methods allow for programmatically running the equivalent of --auto-migrate and --auto-revert.

try app.autoMigrate().wait()

These methods are useful when working with ephemeral databases like in-memory SQLite and for testing.

fluent - Pagination

Published by tanner0101 almost 5 years ago

Implements pagination helpers using new APIs from https://github.com/vapor/fluent-kit/pull/130.

struct TodoController {
    func index(req: Request) throws -> EventLoopFuture<Page<Todo>> {
        Todo.query(on: req.db).paginate(for: req)
    }
}
fluent - Fluent 4.0.0 Beta 2

Published by tanner0101 almost 5 years ago

Updated to latest Vapor and FluentKit beta 2 changes.

fluent - Fluent 4.0.0 Beta 1

Published by tanner0101 almost 5 years ago

  • Added DatabaseSessions and Session models for storing Vapor request sessions in your database. (#645)
  • Added Request.db helper for accessing request-specific database context.
fluent - Fluent 3.2.1

Published by tanner0101 about 5 years ago

  • Fixed an issue preventing soft-deleted rows from being force deleted. (#627, #628)
fluent - Fluent 4.0.0 Alpha 2.1

Published by tanner0101 about 5 years ago

Notes: This updated ConsoleKit release includes property wrapper support and internal cleanup. Fluent's MigrateCommand, and --auto-migrate and --auto-revert flags have been updated to use the new syntax.

fluent - Fluent 4.0.0 Alpha 2

Published by tanner0101 about 5 years ago

  • Updates to FluentKit 1 Alpha 2
  • Updates to Vapor 4 Alpha 2
fluent - Fluent 4.0.0 Alpha 1.1

Published by tanner0101 over 5 years ago

New:

  • Added --auto-migrate and --auto-revert flags for automatically managing migrations during boot (#634)