vapor/fluent: Vapor ORM integration, models, and relations
Vapor ORM (queries, models, and relations) for NoSQL and SQL databases
At a glance
- What is it?
- vapor/fluent connects FluentKit to the Vapor application lifecycle and adds authentication helpers for mapped models. It suits server-side Swift applications that want a shared ORM layer rather than database access embedded in Vapor handlers.
- Who is it for?
- Adopt vapor/fluent when a Vapor service needs its persistence layer connected to the application lifecycle, especially when existing code already uses FluentKit models or Vapor authentication. Do not choose it as a standalone database driver or assume the README documents migrations, rollback, or database configuration.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 59 days ago.
- What is it written in?
- Mainly Swift, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.
Editorial analysis
Why vapor/fluent belongs inside a Vapor service
vapor/fluent is an integration package, rather than a database server, query engine, or complete application framework. The README describes it as the component that makes FluentKit usable in Vapor applications by tying the FluentKit database abstraction layer to Vapor's application lifecycle. That placement makes it relevant to developers building server-side Swift services with Vapor who need database-backed domain objects, queries, relations, and authentication integration.
The package is aimed at engineers who already accept FluentKit as the ORM abstraction and use Vapor as the surrounding service framework. It is less suitable for a Swift command-line tool, a library with no Vapor lifecycle, or a service that intends to use a different persistence abstraction. The README does not list supported databases, driver packages, transaction behavior, migration commands, or deployment topology. Those are concrete adoption constraints, but they remain undocumented in the repository README.
Fluent also provides helpers for mapping FluentKit models to Vapor's authentication APIs. This does not mean that the repository implements a general authentication server. The package supplies an integration layer between mapped models and an authentication mechanism that already belongs to the application. The intended audience is therefore a Vapor developer designing authentication around FluentKit models, not a developer looking for a complete identity platform.
The FluentKit and Vapor lifecycle boundary
The visible architecture has two main boundaries. FluentKit supplies the database abstraction, model mapping, queries, and relations. vapor/fluent sits between that abstraction and Vapor, connecting it to the application's lifecycle. The README states this directly: Fluent makes FluentKit easier to use from Vapor by tying the abstraction layer into the Vapor application lifecycle.
That division matters during application startup, shutdown, request handling, and tests. The repository layout contains `Sources/` and `Tests/`, while the README points to the Fluent documentation for operational details. The README does not expose the exact configuration keys, lifecycle hooks, request object, container registration names, or shutdown procedure. An engineer should therefore not infer an API from the package's role alone.
The model layer remains based on FluentKit. An application would map persistent domain objects as FluentKit models, declare or use their relations, and query them through the ORM. When authentication is required, Fluent's Vapor-facing helpers can connect those models with Vapor's authentication APIs. This is a composition of an ORM layer and a service framework, not a replacement for either one.
The repository description says that Fluent covers NoSQL and SQL databases. It does not identify concrete drivers or claim uniform behavior across them. Relational features such as joins, relational migrations, and SQL transactions should not be assumed to map directly onto every NoSQL backend. Driver-specific documentation is necessary before relying on a particular operation.
Installing vapor/fluent and beginning a model-backed service
The README does not provide installation commands, a dependency snippet, or a first-query tutorial. It directs readers to the Fluent documentation at `https://docs.vapor.codes/4.0/fluent/overview/` and the Vapor 4 documentation at `https://docs.vapor.codes/4.0/`. Because the exact package coordinates and configuration keys are not present in the README, this article does not invent a `Package.swift` block or setup command.
For a first real use, start with the official Fluent overview and follow it only to the point where a Swift model is connected to a selected database driver. Then verify that the application lifecycle owns the FluentKit configuration, define one small persistent model with a clearly understood field type, and exercise a create or query operation in a controlled environment. The README does not specify the model protocol, property wrappers, request entry point, or query methods, so their exact spelling must come from the linked FluentKit and driver documentation.
A useful first check is not merely whether the application starts. Confirm that the configured database can be reached, that the selected driver supports the model's field types, and that the model's identifier matches the backend's identifier expectations. If the application also uses authentication, confirm that the mapped model can satisfy the authentication API's requirements. The README confirms those helper responsibilities, but it does not document the required schema or sign-in flow.
Async changes and Swift version constraints
The repository indicates Swift 6.0 or later, and release 4.13.0 is titled “Update minimum Swift version.” That makes the language requirement an explicit compatibility boundary for an adoption decision. A team on an older Swift toolchain cannot assume that the latest package line can be compiled unchanged.
Release 4.12.0 is titled “Async Lifecycle,” and release 4.11.0 is titled “Concurrency updates and database logging APIs.” These titles indicate that concurrency and database logging changed across recent releases. They do not provide enough detail to reconstruct migration steps, source compatibility, or behavior changes. In particular, the repository README does not state whether application startup hooks were renamed, whether query calls changed from callback to `async` or `await` patterns, or whether logging configuration changed.
For this reason, an upgrade review should begin with the release notes for the exact version selected, rather than with assumptions about API continuity. Check the `Package.swift` constraints, compiler compatibility, lifecycle registration, query call sites, and logging configuration. If those points are not documented for the selected driver or FluentKit version, keep the upgrade out of a time-sensitive production rollout.
The MIT license permits use and modification under its terms, but this article does not interpret those terms or provide legal advice. License compliance also depends on the versions of FluentKit, Vapor, database drivers, and transitive packages used by the application.
Where Fluent's abstraction saves work and where it adds a boundary
Fluent's main value is reuse across a Vapor service boundary. Models and relations are defined through FluentKit, while the Vapor integration handles application lifecycle coupling and authentication mapping. That can keep persistence concerns out of request handlers and make the domain model consistent across different parts of the service.
The trade-off is an additional abstraction. The package does not itself guarantee that every SQL and NoSQL backend behaves identically. Query capabilities, constraints, indexes, cascading behavior, and migration semantics may depend on the driver. The repository description supports the general NoSQL and SQL scope, but it does not document a feature matrix.
A real alternative is to use FluentKit directly without this Vapor adapter when the application does not need Vapor lifecycle integration or authentication helpers. The approach is narrower: FluentKit supplies the database abstraction, while the application owns integration code. Another alternative is to access a chosen database API directly from the service, avoiding an ORM abstraction but also giving up the shared model, query, and relation layer that FluentKit provides. The exact choice depends on whether consistent domain modeling or direct backend control matters more.
Maintenance status and the cost of adopting the ORM layer
The repository is not archived, and its last push was on 2026-08-25. Release 4.13.0 was published on 2025-09-25, while releases 4.12.0 and 4.11.0 were published on 2024-10-06 and 2024-05-30. These facts indicate recent repository activity, but they do not establish support for every database driver or compatibility with every Vapor application.
The main upgrade cost is version coordination. The minimum Swift version changed in 4.13.0, and earlier release titles identify async lifecycle, concurrency, and logging changes. An application may therefore need more than a package-version edit when moving between major compatibility points. The repository does not provide an upgrade guide, migration policy, or support matrix in its README.
For production use, verify the exact FluentKit and database-driver versions, inspect their license files, and confirm that the selected driver has compatible lifecycle and logging behavior. Also review how the ORM's migrations are managed. The README does not document rollback, migration versioning, or backup procedures, so those responsibilities must not be assigned to Fluent based on the package name alone.
Editorial conclusion
Adopt vapor/fluent when a Vapor service needs its persistence layer connected to the application lifecycle, especially when existing code already uses FluentKit models or Vapor authentication. Do not choose it as a standalone database driver or assume the README documents migrations, rollback, or database configuration. Verify first that the required Fluent driver and FluentKit version match your Vapor 4 deployment, then inspect migration and authentication behavior in the project documentation before production adoption.
Frequently asked questions
What is vapor/fluent used for?
It connects FluentKit's database abstraction layer to the Vapor application lifecycle. The repository also says it provides helpers for mapping FluentKit models to Vapor authentication APIs.
What Swift version does vapor/fluent require?
The repository displays a Swift 6.0+ badge, and release 4.13.0 is titled “Update minimum Swift version.” The exact dependency constraints should still be checked in the relevant `Package.swift`.
Does vapor/fluent support SQL and NoSQL databases?
The repository description identifies Fluent as an ORM for NoSQL and SQL databases. The README does not name specific database drivers or document which features each driver supports.
How do I install vapor/fluent?
The README does not include installation commands or a package dependency snippet. It directs readers to the Fluent documentation at `https://docs.vapor.codes/4.0/fluent/overview/`.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/vapor-fluent)Was this useful?