Created
September 6, 2012 13:33
-
-
Save winkler1/3656296 to your computer and use it in GitHub Desktop.
Selectively using H2 database for Grails in Datasource.groovy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dataSource_DSName { | |
dbCreate = "update" | |
pooled = true | |
boolean useFastLocalH2DB = true | |
if ( useFastLocalH2DB ) { | |
assert grails.util.Environment == grails.util.Environment.DEVELOPMENT.current, 'Only use H2 DB in Development mode!' | |
driverClassName = "org.h2.Driver" | |
username = "sa" | |
password = "" | |
url = "jdbc:h2:file:DSName;LOCK_TIMEOUT=10000" | |
} | |
else { | |
url = 'jdbc:postgresql://192.168.1.1/DB' | |
username = 'user' | |
password = 'pass' | |
driverClassName = 'org.postgresql.Driver' | |
dialect = 'org.hibernate.dialect.PostgreSQLDialect' | |
properties { | |
maxActive = 10 | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment