vapor-community / mysql-provider

MySQL provider for the Vapor web framework.
MIT License
30 stars 12 forks source link

add configurable #26

Closed tanner0101 closed 7 years ago

tanner0101 commented 7 years ago

Relies on https://github.com/vapor/fluent-provider/pull/4

fluent.json

Makes the driver this provider adds configurable. To use the driver, you must have a fluent.json that contains.

{
    "driver": "mysql"
}

maxConnections

Max connections is also configurable now, in the fluent.json as well.

Manual

To avoid configuration files, simply:

let drop = Droplet()

let mysql = MySQLDriver(...)
drop.database = Database(mysql)