Skip to content

Commit

Permalink
Guides: DATABASE_URL
Browse files Browse the repository at this point in the history
  • Loading branch information
jodosha committed Jul 20, 2016
1 parent bdbf3f7 commit 3234108
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions source/guides/applications/rake.md
Expand Up @@ -60,9 +60,9 @@ Imagine we want to build a Rake task that prints informations about our project:
# Rakefile # Rakefile


task print_informations: :preload do task print_informations: :preload do
puts ENV['HANAMI_ENV'] # => "development" puts ENV['HANAMI_ENV'] # => "development"
puts ENV['BOOKSHELF_DATABASE_URL'] # => "postgres://localhost/bookshelf_development" puts ENV['DATABASE_URL'] # => "postgres://localhost/bookshelf_development"
puts defined?(User) # => nil puts defined?(User) # => nil
end end
``` ```


Expand Down
6 changes: 3 additions & 3 deletions source/guides/getting-started.md
Expand Up @@ -422,18 +422,18 @@ For example, review `.env.development`:


``` ```
# Define ENV variables for development environment # Define ENV variables for development environment
BOOKSHELF_DATABASE_URL="postgres://localhost/bookshelf_development" DATABASE_URL="postgres://localhost/bookshelf_development"
WEB_SESSIONS_SECRET="21aec7f7371228dd0d4da6a620a1a6b22889edcf0d4fb1c11b8080cd87146eda" WEB_SESSIONS_SECRET="21aec7f7371228dd0d4da6a620a1a6b22889edcf0d4fb1c11b8080cd87146eda"
``` ```


We can edit the database URL and add the database user and password if needed: We can edit the database URL and add the database user and password if needed:


``` ```
# It follows the format below: # It follows the format below:
BOOKSHELF_DATABASE_URL="[ADAPTER]://[DATABASE_USER]:[DATABASE_USER_PASSWORD]@[HOST]:[PORT]/[DATABASE_NAME]" DATABASE_URL="[ADAPTER]://[DATABASE_USER]:[DATABASE_USER_PASSWORD]@[HOST]:[PORT]/[DATABASE_NAME]"
# Example: # Example:
BOOKSHELF_DATABASE_URL="postgres://user:password@localhost:5432/bookshelf_development" DATABASE_URL="postgres://user:password@localhost:5432/bookshelf_development"
``` ```
The placeholders **_user_** and **_password_** should be replaced with the correct credentials. The placeholders **_user_** and **_password_** should be replaced with the correct credentials.


Expand Down
2 changes: 1 addition & 1 deletion source/guides/models/overview.md
Expand Up @@ -55,7 +55,7 @@ Hanami::Model.configure do
# adapter type: :sql, uri: 'postgres://localhost/bookshelf_development' # adapter type: :sql, uri: 'postgres://localhost/bookshelf_development'
# adapter type: :sql, uri: 'mysql://localhost/bookshelf_development' # adapter type: :sql, uri: 'mysql://localhost/bookshelf_development'
# #
adapter type: :sql, uri: ENV['BOOKSHELF_DATABASE_URL'] adapter type: :sql, uri: ENV['DATABASE_URL']


# ... # ...
end.load! end.load!
Expand Down

0 comments on commit 3234108

Please sign in to comment.