@PLUGIN@ Database


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

@PLUGIN@ schema initialization

Schema initialization

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

*** SQL Database for @PLUGIN@

Database server type           [h2]: ?
       Supported options are:
Database server type           [h2]: h2

Initialized <gerrit-site>

@PLUGIN@ schema upgrade

Schema upgrade

Schema upgrade takes place in the init plugin step:

*** SQL Database for @PLUGIN@

Database server type           [h2]:

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

@PLUGIN@ configure-db


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@ plugin stores per patchset test results.

[plugin "@PLUGIN@"]
    dbType = mysql
    hostname = localhost
    database = cidata
    username = gerrit2
    password = secret

@PLUGIN@ supported databases

  • H2
  • Apache Derby
  • MySQL
  • Oracle
  • PostgreSQL

Database Parameters

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.

@PLUGIN@ access-database

Acccesing Database

@PLUGIN@ plugin provides an administrative interface to the database.

‘ssh’ -p ‘@PLUGIN@ gsql’ [--format {PRETTY | JSON | JSON_SINGLE}] [-c QUERY]

ssh -p 29418 localhost verify-status gsql -c “‘show tables;’”


Caller must be a member of a group that is granted the ‘Access Ci Database’ capability (provided by this plugin).



Part of Gerrit Code Review