These docs are for v0.12. Click to read the latest docs for v0.16.

By default, Fluent does not have a database driver. This prevents all Vapor projects from requiring the libraries used to interact with various databases.

The currently supported drivers are:

Adding a Driver

To add a provider, add it to your package, import it, then follow the instructions to initialize an instance of the Provider.

import Vapor
import VaporMySQL

let mysqlProvider = try VaporMySQL.Provider(
    host: "localhost", 
    user: "travis", 
    password: "", 
    database: "test"
)

let app = Application(providers: [mysqlProvider])

Add the provider to your application, and Vapor will take care of setting it as your database and running any preparations.