Browse files

Merge pull request #537 from flyswatter/master

Added more examples to db configuration section.
  • Loading branch information...
2 parents d1d2dbe + bfa804a commit 6c4a8b7aff92edfd3a2fec3bf4f4a27651edd679 @mde mde committed Feb 5, 2014
Showing with 39 additions and 1 deletion.
  1. +39 −1 docs/guide/models.md
View
40 docs/guide/models.md
@@ -769,7 +769,9 @@ var config = {
};
module.exports = config;
```
-On the other hand, if you wanted to use postgres in production, you might edit `config/production.js` to say:
+#### Configurations for other supported database types
+
+Postgresql
```
var config = {
appName: 'Geddy App (development)'
@@ -789,6 +791,42 @@ var config = {
module.exports = config;
```
+MySQL
+```javascript
+ // Using MySQL as the default, with only a MySQL DB
+, model: {
+ defaultAdapter: 'mysql'
+ }
+, db: {
+ mysql: {
+ host: 'localhost'
+ , user: process.env.USER
+ , database: process.env.USER
+ , password: null
+ }
+ }
+```
+Postgres as default, with both a Postgres and Riak model
+```javascript
+ // Using Postgres as the default, with both Postgres and Riak
+, model: {
+ defaultAdapter: 'postgres'
+ }
+, db: {
+ postgres: {
+ user: process.env.USER
+ , database: process.env.USER
+ , password: null
+ , host: null
+ , port: 5432
+ }
+ , riak: {
+ protocol: 'http'
+ , host: 'localhost'
+ , port: 8098
+ }
+}
+```
(I've left out non-related configuration fields).
#### Migrations (SQL adapters only)

0 comments on commit 6c4a8b7

Please sign in to comment.