connections.js 4.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /**
  2. * Connections
  3. * (sails.config.connections)
  4. *
  5. * `Connections` are like "saved settings" for your adapters. What's the difference between
  6. * a connection and an adapter, you might ask? An adapter (e.g. `sails-mysql`) is generic--
  7. * it needs some additional information to work (e.g. your database host, password, user, etc.)
  8. * A `connection` is that additional information.
  9. *
  10. * Each model must have a `connection` property (a string) which is references the name of one
  11. * of these connections. If it doesn't, the default `connection` configured in `config/models.js`
  12. * will be applied. Of course, a connection can (and usually is) shared by multiple models.
  13. * .
  14. * Note: If you're using version control, you should put your passwords/api keys
  15. * in `config/local.js`, environment variables, or use another strategy.
  16. * (this is to prevent you inadvertently sensitive credentials up to your repository.)
  17. *
  18. * For more information on configuration, check out:
  19. * http://sailsjs.org/#/documentation/reference/sails.config/sails.config.connections.html
  20. */
  21. module.exports.connections = {
  22. /***************************************************************************
  23. * *
  24. * Local disk storage for DEVELOPMENT ONLY *
  25. * *
  26. * Installed by default. *
  27. * *
  28. ***************************************************************************/
  29. localDiskDb: {
  30. adapter: 'sails-disk'
  31. },
  32. /***************************************************************************
  33. * *
  34. * MySQL is the world's most popular relational database. *
  35. * http://en.wikipedia.org/wiki/MySQL *
  36. * *
  37. * Run: npm install sails-mysql *
  38. * *
  39. ***************************************************************************/
  40. someMysqlServer: {
  41. adapter: 'sails-mysql',
  42. host: 'YOUR_MYSQL_SERVER_HOSTNAME_OR_IP_ADDRESS',
  43. user: 'YOUR_MYSQL_USER',
  44. password: 'YOUR_MYSQL_PASSWORD',
  45. database: 'YOUR_MYSQL_DB'
  46. },
  47. /***************************************************************************
  48. * *
  49. * MongoDB is the leading NoSQL database. *
  50. * http://en.wikipedia.org/wiki/MongoDB *
  51. * *
  52. * Run: npm install sails-mongo *
  53. * *
  54. ***************************************************************************/
  55. someMongodbServer: {
  56. adapter: 'sails-mongo',
  57. host: 'localhost',
  58. port: 27017,
  59. // user: 'username',
  60. // password: 'password',
  61. // database: 'your_mongo_db_name_here'
  62. },
  63. /***************************************************************************
  64. * *
  65. * PostgreSQL is another officially supported relational database. *
  66. * http://en.wikipedia.org/wiki/PostgreSQL *
  67. * *
  68. * Run: npm install sails-postgresql *
  69. * *
  70. * *
  71. ***************************************************************************/
  72. somePostgresqlServer: {
  73. adapter: 'sails-postgresql',
  74. host: 'YOUR_POSTGRES_SERVER_HOSTNAME_OR_IP_ADDRESS',
  75. user: 'YOUR_POSTGRES_USER',
  76. password: 'YOUR_POSTGRES_PASSWORD',
  77. database: 'YOUR_POSTGRES_DB'
  78. }
  79. /***************************************************************************
  80. * *
  81. * More adapters: https://github.com/balderdashy/sails *
  82. * *
  83. ***************************************************************************/
  84. };