zuul/doc/source/admin/drivers/sql.rst

1.5 KiB

title

SQL Driver

SQL

The SQL driver supports reporters only. Only one connection per database is permitted.

Connection Configuration

The connection options for the SQL driver are:

<sql connection>

driver

sql

The connection must set driver=sql for SQL connections.

dburi

Database connection information in the form of a URI understood by SQLAlchemy. See The SQLAlchemy manual for more information.

Reporter Configuration

This reporter is used to store results in a database.

A connection<connections> that uses the sql driver must be supplied to the reporter.

zuul.conf contains the database connection and credentials. To store different reports in different databases you'll need to create a new connection per database.

The SQL reporter does nothing on pipeline.start or pipeline.merge-failure; it only acts on pipeline.success or pipeline.failure reporting stages.

For example:

- pipeline:
    name: post-merge
    success:
      mydb_conn:
    failure:
      mydb_conn:

pipeline.<reporter>.<sql source>

To report to a database, add a key with the connection name and an empty value to the desired pipeline reporter<reporters> attributes.