Loopback Connector for MySQL
Go to file
Raymond Feng 56924b9557 Merge tag 'v1.5.1'
1.5.1

 * Fix the loop of models (Raymond Feng)

 * Set ok default to false (Geoffroy Lesage)

 * Fixed missing 'ok' (Geoffroy Lesage)

 * Changed default type mapping (Geoffroy Lesage)

 * Fixed isActual syntax to accept optional model arg (Geoffroy Lesage)

 * Fixed isActual implemenation (Geoffroy Lesage)

 * Inherit Schema From DataSource if not defined (Serkan Serttop)
2015-01-15 14:33:12 -08:00
example Reformat code 2014-02-12 16:57:06 -08:00
lib Fix the loop of models 2015-01-15 14:21:49 -08:00
test Merge pull request #54 from saggiyogesh/master 2015-01-06 10:17:38 -08:00
.gitignore Prevent extra files from going into npm 2013-12-13 10:25:53 -08:00
.travis.yml Upd node version for travis 2013-03-27 20:32:13 +04:00
CHANGES.md v1.5.1 2015-01-15 14:33:09 -08:00
CONTRIBUTING.md Fix bad CLA URL in CONTRIBUTING.md 2014-12-29 08:27:46 -08:00
LICENSE Update to dual MIT/StrongLoop license 2014-02-17 16:35:08 -08: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 link to doc 2014-06-24 16:20:19 -07:00
docs.json Reformat code 2014-02-12 16:57:06 -08:00
index.js Init 2012-12-14 18:01:44 +04:00
package.json v1.5.1 2015-01-15 14:33:09 -08: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.