Loopback Connector for MySQL
Go to file
Ryan Graham ebb6e68f0e
test: fix undefined password
If no password is given, '+ password' stringifies to 'undefined', which
generates a URL that has 'undefined' as the password instead of leaving
out the password.
2016-08-05 10:54:21 -07:00
example insert/update copyright notices 2016-05-03 16:52:03 -07:00
intl/en Add globalization 2016-07-28 17:20:03 -04:00
lib Add globalization 2016-07-28 17:20:03 -04:00
test test: fix undefined password 2016-08-05 10:54:21 -07:00
.gitignore Add globalization 2016-07-28 17:20:03 -04:00
.travis.yml Upd node version for travis 2013-03-27 20:32:13 +04:00
CHANGES.md 2.3.0 2016-06-21 13:58:45 -07:00
CONTRIBUTING.md Update URLs in CONTRIBUTING.md (#176) 2016-07-13 17:33:00 -07:00
LICENSE relicense as MIT only 2016-05-03 16:49:23 -07:00
Makefile Remove blanket 2013-11-20 09:23:53 -08:00
NOTICE.md Add NOTICE and update READE 2013-10-30 23:02:12 -07:00
README.md Update README.md 2015-03-17 22:27:30 -07:00
index.js Add globalization 2016-07-28 17:20:03 -04:00
package.json Add globalization 2016-07-28 17:20:03 -04:00

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.

  1. Setup dependencies in package.json:

    {
      ...
      "dependencies": {
        "loopback-datasource-juggler": "latest",
        "loopback-connector-mysql": "latest"
      },
      ...
    }
    
  2. 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 particularly password and collation. Collation currently defaults to utf8_general_ci. The collation 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.

  1. Ask a core developer for instructions on how to set up test server credentials on your machine
  2. npm test