0.9.32 • Published 7 years ago
sails-mysql2 v0.9.32
Installation
Install from NPM.
# In your app:
$ npm install sails-mysql2
Sails Configuration
Add the mysql config to the config/connections.js file. Basic options:
module.exports.connections = {
mysql: {
adapter : 'sails-mysql2',
host : 'localhost',
port : 3306,
user : 'username',
password : 'password',
database : 'MySQL Database Name'
// OR (explicit sets take precedence)
adapter : 'sails-mysql',
url : 'mysql2://USER:PASSWORD@HOST:PORT/DATABASENAME'
// Optional
charset : 'utf8',
collation : 'utf8_swedish_ci'
}
};
And then change default model configuration to the config/models.js:
module.exports.models = {
connection: 'mysql'
};
Run tests
You can set environment variables to override the default database config for the tests, e.g.:
$ WATERLINE_ADAPTER_TESTS_PASSWORD=yourpass npm test
Default settings are:
{
host: process.env.WATERLINE_ADAPTER_TESTS_HOST || 'localhost',
port: process.env.WATERLINE_ADAPTER_TESTS_PORT || 3306,
user: process.env.WATERLINE_ADAPTER_TESTS_USER || 'root',
password: process.env.WATERLINE_ADAPTER_TESTS_PASSWORD || '',
database: process.env.WATERLINE_ADAPTER_TESTS_DATABASE || 'sails_mysql',
pool: true,
connectionLimit: 10,
waitForConnections: true
}
``
0.9.32
7 years ago
0.9.31
7 years ago
0.9.30
7 years ago
0.9.29
7 years ago
0.9.2-9.0.5
7 years ago
0.9.2-9.0.4
7 years ago
0.9.2-9.0.3
7 years ago
0.9.2-9.0.2
7 years ago
0.9.2-9.0.1
7 years ago
0.9.28
7 years ago
0.9.27
7 years ago
0.9.26
7 years ago
0.9.25
7 years ago
0.9.24
7 years ago
0.9.23
7 years ago
0.9.22
7 years ago
0.9.21
7 years ago
0.9.20
7 years ago
0.9.19
7 years ago
0.9.18
7 years ago
0.9.17
7 years ago
0.9.16
7 years ago
0.9.15
7 years ago
0.9.14
7 years ago
0.9.13
7 years ago
0.9.12
7 years ago
0.9.11
7 years ago
0.9.10
7 years ago
0.12.4
7 years ago
0.12.3
7 years ago