Database

DESCRIPTION

CI data is stored in a CI database which can be in the Gerrit review database or a completely separate database.

Schema initialization

The database is initialized and the schema is created with during an initial site creation.

*** SQL Database for @PLUGIN@
*** 

Database server type           [h2]: ?
       Supported options are:
         derby
         h2
         mysql
         oracle
         postgresql
Database server type           [h2]: h2

Initialized <gerrit-site>

Schema upgrade

Schema upgrade takes place in init plugin step:

*** SQL Database for @PLUGIN@
*** 

Database server type           [h2]: 

Upgrading schema to 2 ...
Migrating data to schema 2 ...

The @PLUGIN@ database can be configured in the [gerrit.config] (../../../Documentation/config-gerrit.html#_file_code_etc_gerrit_config_code) file

The database section configures where the @PLUGIN@ stores per patchset CI results.

[plugin "@PLUGIN@"]
  dbType = MYSQL
  dbUrl = jdbc:mysql://localhost:3306/cidata
  username = gerrit2
  password = s3kr3t

@PLUGIN@ supported databases

  • H2
  • Apache Derby
  • MySQL
  • Oracle
  • PostgreSQL

Database Parameters

ParamterDescription
database.dbTyperequiredType of database server to connect to (default: H2)
database.usernamerequiredUsername to connect to the database server as
database.passwordrequiredPassword to authenticate to the database server with
database.urlrequired‘jdbc:’ URL for the database
database.driveroptionalName of the JDBC driver class to connect to the database with
database.connectionPooloptionalIf true, use connection pooling for database connections
database.poolLimitoptionalMaximum number of open database connections
database.poolMinIdleoptionalMinimum number of connections to keep idle in the pool
database.poolMaxIdleoptionalMaximum number of connections to keep idle in the pool
database.poolMaxWaitoptionalMaximum amount of time a request processing thread will wait to acquire a database connection from the pool
database.dataSourceInterceptorClassoptionalClass that implements DataSourceInterceptor interface to monitor SQL activity
  • ms, milliseconds
  • s, sec, second, seconds
  • m, min, minute, minutes
  • h, hr, hour, hours

If a unit suffix is not specified, milliseconds is assumed.

Default is 30 seconds.

SEE ALSO

GERRIT

Part of Gerrit Code Review