Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added documentation for postgresql configuration #33

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions src/main/docs/guide/postgresqlAsDatasource.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Edit `build.gradle`

[source,groovy]
.build.gradle
----
dependencies {
//...

runtime 'postgresql:postgresql-jdbc42:9.4.1208-atlassian-hosted' <1>
----
<1> Add the PostreSQL JDBC driver as a dependency

include::{commondir}/common-warningDependencyNotBuildscriptDependency.adoc[]

Edit `application.yml`

[source,yml]
.grails-app/conf/application.yml
----
dataSource:
pooled: true
jmxExport: true
driverClassName: org.postgresql.Driver
dialect: org.hibernate.dialect.PostgreSQL9Dialect
username: testUser
password: testing
environments:
development:
dataSource:
dbCreate: update
url: jdbc:postgresql://localhost:5432/db_name
----
<1> Change the `driverClassName` and `dialect` to PostgreSQL setting
<2> This assumes you have a local PostgreSQL instance with a database named `db_name`