746ee48601
* Add connectorCapabilities global object (#201) (Nicholas Duffy) * Remove unused prefix for test env vars (#203) (Simon Ho) * Update translation files - round#2 (#199) (Candy) * Add CI fixes (#197) (Loay) * Add translated files (gunjpan) * Update deps to loopback 3.0.0 RC (Miroslav Bajtoš) * Remove Makefile in favour of NPM test scripts (Simon Ho) * Fixing lint errors (Ron Lloyd) * Autoupdate mysql.columnName bug fix (Ron Lloyd) * Tests for autoupdate mysql.columnName bug fix (Ron Lloyd) * Use juggler@3 for running the tests (Miroslav Bajtoš) * Explictly set forceId:false in test model (Miroslav Bajtoš) * Fix pretest and init test configs (Simon Ho) * Fix to configure model index in keys field (deepakrkris) * Update eslint infrastructure (Loay) * test: use dump of original test DB as seed (Ryan Graham) * test: skip cardinality, update sub_part (Ryan Graham) * test: accept alternate test db credentials (Ryan Graham) * test: use should for easier debugging (Ryan Graham) * test: account for mysql version differences (Ryan Graham) * test: match case with example/table.sql (Ryan Graham) * test: separate assertions from test flow control (Ryan Graham) * test: update tests to use example DB (Ryan Graham) * test: seed test DB with example (Ryan Graham) * test: fix undefined password (Ryan Graham) * Add special handling of zero date/time entries (Carl Fürstenberg) * Add globalization (Candy) * Update URLs in CONTRIBUTING.md (#176) (Ryan Graham) |
||
---|---|---|
example | ||
intl | ||
lib | ||
test | ||
.eslintrc | ||
.gitignore | ||
.travis.yml | ||
CHANGES.md | ||
CONTRIBUTING.md | ||
LICENSE | ||
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