Index cardinality is actually a metric that is based on MySQL analyzing the table contents, so its value here has more to do with whether the tests are running against a new table, an old table, or whether it has any data in it. The Sub_part field is similarly unimportant for the purposes of these tests since it refers to indexing internals based on data type and partial indexing. See: https://dev.mysql.com/doc/refman/5.5/en/show-index.html |
||
---|---|---|
example | ||
intl/en | ||
lib | ||
test | ||
.gitignore | ||
.travis.yml | ||
CHANGES.md | ||
CONTRIBUTING.md | ||
LICENSE | ||
Makefile | ||
NOTICE.md | ||
README.md | ||
index.js | ||
package.json | ||
pretest.js |
README.md
loopback-connector-mysql
loopback-connector-mysql
is the MySQL connector module for loopback-datasource-juggler.
For complete documentation, see StrongLoop Documentation | MySQL Connector.
Installation
npm install loopback-connector-mysql --save
Basic use
To use it you need loopback-datasource-juggler
.
-
Setup dependencies in
package.json
:{ ... "dependencies": { "loopback-datasource-juggler": "latest", "loopback-connector-mysql": "latest" }, ... }
-
Use:
var DataSource = require('loopback-datasource-juggler').DataSource; var dataSource = new DataSource('mysql', { host: 'localhost', port: 3306, database: 'mydb', username: 'myuser', password: 'mypass' });
You can optionally pass a few additional parameters supported by
node-mysql
, most particularlypassword
andcollation
.Collation
currently defaults toutf8_general_ci
. Thecollation
value will also be used to derive the connection charset.
Running Tests
The tests in this repository are mainly integration tests, meaning you will need to run them using our preconfigured test server.
- Ask a core developer for instructions on how to set up test server credentials on your machine
npm test