Releases: vapor/fluent
Fix conditional Codable conformance
This patch was authored and released by @siemensikkema.
This fixes an issue introduced in vapor/fluent-kit#435 where Page
does not automatically conform to Codable
anymore (#730)
Add page size limit
This patch was authored by @pulpn0ir and released by @siemensikkema.
Adds a means to prevent server overloads by limiting the maximum amount of elements returned in a single page.
Application
and Request
have been extended with setters for page size limits. Set limits using the newly introduced PageLimit
type.
// Set page size limit for the current request. Default is `nil`, which means no limit.
request.fluent.pagination.pageSizeLimit = 3
// Setting the request-level limit to `nil` will cause the application-level limit to be used instead.
request.fluent.pagination.pageSizeLimit = nil
// Use `.noLimit` if you intend to override a limit set on application level.
request.fluent.pagination.pageSizeLimit = .noLimit
// Set application-wide page size limit. Default is `nil`, which means no limit.
application.fluent.pagination.pageSizeLimit = 3
This PR depends on: vapor/fluent-kit#412
Add cache protocol
This patch was authored and released by @tanner0101.
Add Fluent implementation for Vapor's new cache protocol: vapor/vapor#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)
Add default implementation for CredentialsAuthenticatable
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
Docs here vapor/docs#576
Fluent 4.0.0
Docs:
https://docs.vapor.codes/4.0/fluent/overview/
https://docs.vapor.codes/4.0/fluent/model/
https://docs.vapor.codes/4.0/fluent/relations/
https://docs.vapor.codes/4.0/fluent/migration/
https://docs.vapor.codes/4.0/fluent/query/
https://docs.vapor.codes/4.0/fluent/schema/
https://docs.vapor.codes/4.0/fluent/advanced/
More information on Vapor 4 official release:
https://forums.swift.org/t/vapor-4-official-release-begins/34802
Adds the ability to retrieve query history
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
FluentKit 1.0.0 GM
This patch was authored and released by @tanner0101.
Updates this package for compatibility with latest version of FluentKit.
Add unique index to SessionRecord key
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).
SessionRecord
migration in production, you will need to add this unique index manually.
Fix deprecated renamed fix for ModelTokenAuthenticatable
This patch was authored by @0xTim and released by @tanner0101.
Fixes incorrect rename deprecation for ModelTokenAuthenticatable
(#677).
Update to Vapor 4 GM
This patch was authored and released by @tanner0101.
Updated for final Vapor 4.0.0 release (#672).
ModelUser
renamed toModelAuthenticatable
.ModelUserToken
renamed toModelTokenAuthenticatable
.- Sessions authenticator now creatable via static method.
- app.fluent.sessions.middleware()
+ User.sessionAuthenticator()
- New
ModelSessionAuthenticatable
helper protocol added. Session
renamed toSessionRecord
. Now uses_fluent_sessions
schema.