{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","params":[],"results":{"codes":[]},"settings":""},"next":{"description":"","pages":[]},"title":"Driver","type":"basic","slug":"driver","excerpt":"","body":"By default, Fluent does not have a database driver. This prevents all Vapor projects from requiring the libraries used to interact with various databases.\n\nThe currently supported drivers are:\n- [MongoDB](https://github.com/qutheory/vapor-mongo)\n- [MySQL](https://github.com/qutheory/vapor-mysql)\n- [SQLite](https://github.com/qutheory/vapor-sqlite)\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Adding a Driver\"\n}\n[/block]\nTo add a provider, add it to your package, import it, then follow the instructions to initialize an instance of the `Provider`.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"import Vapor\\nimport VaporMySQL\\n\\nlet mysqlProvider = try VaporMySQL.Provider(\\n    host: \\\"localhost\\\", \\n    user: \\\"travis\\\", \\n    password: \\\"\\\", \\n    database: \\\"test\\\"\\n)\\n\\nlet app = Application(providers: [mysqlProvider])\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\nAdd the provider to your application, and Vapor will take care of setting it as your database and running any preparations.","updates":[],"order":999,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"57687731d98cfd0e006761c7","version":{"version":"0.12","version_clean":"0.12.0","codename":"Client Clyde","is_stable":false,"is_beta":true,"is_hidden":false,"is_deprecated":true,"categories":["5768701b72cd4c0e000fad19","5768701b72cd4c0e000fad1a","5768701b72cd4c0e000fad1b","5768701b72cd4c0e000fad1c"],"_id":"5768701b72cd4c0e000fad18","releaseDate":"2016-06-20T22:37:15.641Z","__v":1,"createdAt":"2016-06-20T22:37:15.641Z","project":"57086fe855a4690e005de407"},"__v":3,"createdAt":"2016-06-20T23:07:29.142Z","project":"57086fe855a4690e005de407","category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Fluent","slug":"fluent","order":2,"from_sync":false,"reference":false,"_id":"5768701b72cd4c0e000fad1b","project":"57086fe855a4690e005de407","__v":0,"version":"5768701b72cd4c0e000fad18","createdAt":"2016-06-20T22:35:07.648Z"},"githubsync":"","user":"57086f3d447c410e00221bd1"}
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: - [MongoDB](https://github.com/qutheory/vapor-mongo) - [MySQL](https://github.com/qutheory/vapor-mysql) - [SQLite](https://github.com/qutheory/vapor-sqlite) [block:api-header] { "type": "basic", "title": "Adding a Driver" } [/block] To add a provider, add it to your package, import it, then follow the instructions to initialize an instance of the `Provider`. [block:code] { "codes": [ { "code": "import Vapor\nimport VaporMySQL\n\nlet mysqlProvider = try VaporMySQL.Provider(\n host: \"localhost\", \n user: \"travis\", \n password: \"\", \n database: \"test\"\n)\n\nlet app = Application(providers: [mysqlProvider])", "language": "swift" } ] } [/block] Add the provider to your application, and Vapor will take care of setting it as your database and running any preparations.