Adds MySQL support for Sails.
Install from NPM.
$ npm install sails-mysql
Add the mysql config to the config/adapters.js file. Basic options:
module.exports.adapters = {
'default': 'mysql',
mysql: {
module : 'sails-mysql',
host : 'localhost',
port : 3306,
user : 'username',
password : 'password',
database : 'MySQL Database Name'
// OR (exlicit sets take precedence)
module : 'sails-mysql',
url : 'mysql2://USER:PASSWORD@HOST:PORT/DATABASENAME'
}
}
};
Waterline is a new kind of storage and retrieval engine. It provides a uniform API for accessing stuff from different kinds of databases, protocols, and 3rd party APIs. That means you write the same code to get users, whether they live in mySQL, LDAP, MongoDB, or Facebook. Waterline also comes with built-in transaction support, as well as a configurable environment setting.