Skip to content
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`