Guest User

Untitled

a guest
Jan 26th, 2019
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. 'use strict'
  2.  
  3. /** @type {import('@adonisjs/framework/src/Env')} */
  4. const Env = use('Env')
  5.  
  6. /** @type {import('@adonisjs/ignitor/src/Helpers')} */
  7. const Helpers = use('Helpers')
  8.  
  9. module.exports = {
  10. /*
  11. |--------------------------------------------------------------------------
  12. | Default Connection
  13. |--------------------------------------------------------------------------
  14. |
  15. | Connection defines the default connection settings to be used while
  16. | interacting with SQL databases.
  17. |
  18. */
  19. connection: Env.get('DB_CONNECTION', 'sqlite'),
  20.  
  21. /*
  22. |--------------------------------------------------------------------------
  23. | Sqlite
  24. |--------------------------------------------------------------------------
  25. |
  26. | Sqlite is a flat file database and can be good choice under development
  27. | environment.
  28. |
  29. | npm i --save sqlite3
  30. |
  31. */
  32. sqlite: {
  33. client: 'sqlite3',
  34. connection: {
  35. filename: Helpers.databasePath(`${Env.get('DB_DATABASE', 'development')}.sqlite`)
  36. },
  37. useNullAsDefault: true,
  38. debug: Env.get('DB_DEBUG', false)
  39. },
  40.  
  41. /*
  42. |--------------------------------------------------------------------------
  43. | MySQL
  44. |--------------------------------------------------------------------------
  45. |
  46. | Here we define connection settings for MySQL database.
  47. |
  48. | npm i --save mysql
  49. |
  50. */
  51. mysql: {
  52. client: 'mysql',
  53. connection: {
  54. host: Env.get('DB_HOST', 'localhost'),
  55. port: Env.get('DB_PORT', ''),
  56. user: Env.get('DB_USER', 'root'),
  57. password: Env.get('DB_PASSWORD', ''),
  58. database: Env.get('DB_DATABASE', 'adonis')
  59. },
  60. debug: Env.get('DB_DEBUG', false)
  61. },
  62.  
  63. /*
  64. |--------------------------------------------------------------------------
  65. | PostgreSQL
  66. |--------------------------------------------------------------------------
  67. |
  68. | Here we define connection settings for PostgreSQL database.
  69. |
  70. | npm i --save pg
  71. |
  72. */
  73. pg: {
  74. client: 'pg',
  75. connection: {
  76. host: Env.get('DB_HOST', 'localhost'),
  77. port: Env.get('DB_PORT', ''),
  78. user: Env.get('DB_USER', 'root'),
  79. password: Env.get('DB_PASSWORD', ''),
  80. database: Env.get('DB_DATABASE', 'adonis')
  81. },
  82. debug: Env.get('DB_DEBUG', false)
  83. }
  84. }
Add Comment
Please, Sign In to add comment