Skip to content
a-ono edited this page May 3, 2012 · 23 revisions

Database Settings

Running modes

A running mode is defined by setting system property run.mode, and you can separate database configuration.

Note : default value is dev.

Configuration file

Configuration file named application.conf, located on classpath (e.g. src/main/resources/application.conf), and written in HOCON format.

application.conf example

The format is [running mode].[setting key] = [setting value].

dev {
  schema = "models.Tables"
  driver = "org.postgresql.Driver"
  jdbcurl = "jdbc:postgresql://hostname:5432/dbname"
  username = "user"
  password = "xxxxxxxx"
  partitionCount = 5
  maxConnectionsPerPartition = 1
  minConnectionsPerPartition = 5
}

test {
  schema = "models.Tables"
  driver = "org.h2.Driver"
  jdbcurl = "jdbc:h2:mem:test"
}

If you set system property "run.mode" test, H2 JDBC driver is used.

Configuration items

This is a list of available configuration items.

Key name Type Description Default value
schema String Schema definition class "models.Tables"
driver String JDBC driver "org.h2.Driver"
jdbcurl String JDBC URL "jdbc:h2:mem:activerecord"
username String Username for connection (none)
password String Password for connection (none)
partitionCount Integer BoneCP partitionCount (none)
maxConnectionsPerPartition Integer BoneCP maxConnectionsPerPartition (none)
minConnectionsPerPartition Integer BoneCP minConnectionsPerPartition (none)

Note : JDBC datasource is managed by BoneCP.

Clone this wiki locally