Right now the MySQL provider will set the database property on the Droplet when it is added. This makes it difficult to use different database's in different environments. Currently you'd have to do something like
if environment != .testing {
try addProvider(VaporMySQL.Provider.self)
}
The database instead could be set using a Vapor addConfigurable method.
Right now the MySQL provider will set the database property on the Droplet when it is added. This makes it difficult to use different database's in different environments. Currently you'd have to do something like
The database instead could be set using a Vapor
addConfigurable
method.The code in https://github.com/vapor/mysql-provider/blob/master/Sources/VaporMySQL/Provider.swift#L156 would instead be:
With this change, the mysql database would be used when the
database
property offluent.json
was equal to"mysql"
.Config/production/fluent.json
Then the testing environment could have something like:
Config/test/fluent.json