blob: 4c4a72959093dabcc458db72bed4ba085c982b4f [file] [log] [blame]
James E. Blaireff5a9d2017-06-20 00:00:37 -07001:title: SQL Driver
2
3SQL
4===
5
6The SQL driver supports reporters only. Only one connection per
James E. Blair83786d42017-08-04 08:43:59 -07007database is permitted.
James E. Blaireff5a9d2017-06-20 00:00:37 -07008
James E. Blair83786d42017-08-04 08:43:59 -07009Connection Configuration
10------------------------
James E. Blaireff5a9d2017-06-20 00:00:37 -070011
James E. Blair83786d42017-08-04 08:43:59 -070012The connection options for the SQL driver are:
13
14.. attr:: <sql connection>
15
16 .. attr:: driver
17 :required:
18
19 .. value:: sql
20
21 The connection must set ``driver=sql`` for SQL connections.
22
23 .. attr:: dburi
24 :required:
25
26 Database connection information in the form of a URI understood
27 by SQLAlchemy. See `The SQLAlchemy manual
28 <http://docs.sqlalchemy.org/en/rel_1_0/core/engines.html#database-urls>`_
29 for more information.
James E. Blaireff5a9d2017-06-20 00:00:37 -070030
31Reporter Configuration
32----------------------
33
34This reporter is used to store results in a database.
35
36A :ref:`connection<connections>` that uses the sql driver must be
37supplied to the reporter.
38
James E. Blair83786d42017-08-04 08:43:59 -070039``zuul.conf`` contains the database connection and credentials. To
40store different reports in different databases you'll need to create a
41new connection per database.
James E. Blaireff5a9d2017-06-20 00:00:37 -070042
James E. Blair83786d42017-08-04 08:43:59 -070043The SQL reporter does nothing on :attr:`pipeline.start` or
44:attr:`pipeline.merge-failure`; it only acts on
45:attr:`pipeline.success` or :attr:`pipeline.failure` reporting stages.
46
47For example:
48
49.. code-block:: yaml
50
51 - pipeline:
52 name: post-merge
53 success:
54 mydb_conn: {}
55 failure:
56 mydb_conn: {}
57
58.. attr:: pipeline.<reporter>.<sql source>
59
60 To report to a database, add an empty dictionary to the desired
61 pipeline :ref:`reporter<reporters>` attributes.