Skip to content

Commit 8ded3cd

Browse files
committed
Moved sections in readme, cleaned code example.
1 parent 937d379 commit 8ded3cd

File tree

1 file changed

+10
-21
lines changed

1 file changed

+10
-21
lines changed

README.md

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,6 @@ Adds MySQL support for Sails.
77
# Sails.js Repo
88
http://SailsJs.org
99

10-
11-
## About Waterline
12-
Waterline is a new kind of storage and retrieval engine. It provides a uniform API for accessing stuff from different kinds of databases, protocols, and 3rd party APIs. That means you write the same code to get users, whether they live in mySQL, LDAP, MongoDB, or Facebook.
13-
Waterline also comes with built-in transaction support, as well as a configurable environment setting.
14-
15-
16-
## Writing your own adapters
17-
It's easy to add your own adapters for integrating with proprietary systems or existing open APIs. For most things, it's as easy as `require('some-module')` and mapping the appropriate methods to match waterline semantics.
18-
1910
## Installation
2011

2112
Install from NPM.
@@ -31,29 +22,27 @@ Add the mysql config to the config/adapters.js file. Basic options:
3122
```javascript
3223
module.exports.adapters = {
3324
'default': 'mysql',
34-
host: config.host,
35-
port: config.port || 3306,
36-
socketPath: config.socketPath || null,
37-
user: config.user,
38-
password: config.password,
39-
database: config.database,
40-
timezone: config.timezone || 'Z'
4125

4226
mysql: {
4327
module : 'sails-mysql',
4428
host : 'localhost',
4529
port : 3306,
4630
user : 'username',
4731
password : 'password',
48-
database : 'MySQL Database Name',
32+
database : 'MySQL Database Name'
4933

5034
// OR (exlicit sets take precedence)
51-
module : 'sails-mongo',
52-
url : 'mysql2://USER:PASSWORD@HOST:PORT/DATABASENAME',
35+
module : 'sails-mysql',
36+
url : 'mysql2://USER:PASSWORD@HOST:PORT/DATABASENAME'
5337
}
5438
}
55-
56-
5739
};
5840
```
41+
42+
## About Waterline
43+
Waterline is a new kind of storage and retrieval engine. It provides a uniform API for accessing stuff from different kinds of databases, protocols, and 3rd party APIs. That means you write the same code to get users, whether they live in mySQL, LDAP, MongoDB, or Facebook.
44+
Waterline also comes with built-in transaction support, as well as a configurable environment setting.
45+
46+
47+
5948
[![githalytics.com alpha](https://cruel-carlota.pagodabox.com/a22d3919de208c90c898986619efaa85 "githalytics.com")](http://githalytics.com/mikermcneil/sails-mysql)

0 commit comments

Comments
 (0)