Databases and Search¶
Solano CI supports most popular database services. For a complete list, see our Compatibility page.
Each service is started automatically based on dependency analysis of your application. For instance, in a Ruby application, Solano CI will start a PostgreSQL server if either:
- Your Gemfile includes the
- Your solano.yml has postgres enabled
You may also need to define a setup hook to configure your database. You can read more about setup hooks here.
Solano CI will automatically create databases named u_0 through u_N where N is the number of workers for your session and u is a unique prefix for your account. The current database, database user, and database password are made available to your tests via environment variables.
You can specify a supported version of a database in your config/solano.yml. For instance, to specify version 2.0.x of MongoDB, you would add the following:
--- mongodb: version: 2.0
The minor version number is generally ignored (i.e. the x in 2.0.x). For an up-to-date list of supported versions, see this list.
It is also possible to inject configuration snippets into config files for those keys not explicitly set by Solano CI. We recommend avoiding injecting configuration settings unless absolutely necessary. In some cases, however, you may need to set a configuration key that Solano CI cannot safely set automatically. For instance, you could set the reconnect key for MySQL as follows:
--- mysql: config: reconnect: true