Browse files

Added more examples to db configuration section.

  • Loading branch information...
1 parent 52a2d92 commit bfa804ada45d3bdf28f097b53baf565375ff47d9 Dan Finlay 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 bfa804a

Please sign in to comment.