Bot releases are hidden (Show)
Published by tanner0101 over 3 years ago
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)
Published by tanner0101 almost 4 years ago
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
Published by tanner0101 over 4 years ago
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
Published by tanner0101 over 4 years ago
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
Published by tanner0101 over 4 years ago
Updates this package for compatibility with latest version of FluentKit.
Published by tanner0101 over 4 years ago
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.
Published by tanner0101 over 4 years ago
Fixes incorrect rename deprecation for ModelTokenAuthenticatable
(#677).
Published by tanner0101 over 4 years ago
Updated for final Vapor 4.0.0 release (#672).
ModelUser
renamed to ModelAuthenticatable
.ModelUserToken
renamed to ModelTokenAuthenticatable
.- app.fluent.sessions.middleware()
+ User.sessionAuthenticator()
ModelSessionAuthenticatable
helper protocol added.Session
renamed to SessionRecord
. Now uses _fluent_sessions
schema.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.
Published by tanner0101 over 4 years ago
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 suffixAs well as operators for Array filtering:
~~
: Value in array!~
: Value not in arrayPublished 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/
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.
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)
}
}
Published by tanner0101 almost 5 years ago
Updated to latest Vapor and FluentKit beta 2 changes.
Published by tanner0101 almost 5 years ago
DatabaseSessions
and Session
models for storing Vapor request sessions in your database. (#645)Request.db
helper for accessing request-specific database context.Published by tanner0101 about 5 years ago
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.
Published by tanner0101 about 5 years ago
Published by tanner0101 over 5 years ago
New:
--auto-migrate
and --auto-revert
flags for automatically managing migrations during boot (#634)