# SQL Repository Type

Persistent storage of test results.

class `stestr.repository.sql.``Repository`(url)

  subunit2sql based storage of test results.

  This repository stores each stream in a subunit2sql DB. Refer to the subunit2sql documentation for

  `count`()

    Return the number of test runs this repository has stored.

    Return count: | The count of test runs stored in the repository.

  `find_metadata`(metadata)

    Return the list of run_ids for a given metadata string.

    Param: | metadata: the metadata string to search for.
    Returns: | a list of any test_ids that have that metadata value.

  `get_failing`()

    Get a TestRun that contains all of and only current failing tests.

    Returns: | a TestRun.

  `get_test_run`(run_id)

    Retrieve a TestRun object for run_id.

    Parameters: | run_id – The test run id to retrieve.
    Returns: | A TestRun object.

  `latest_id`()

    Return the run id for the most recently inserted test run.

class `stestr.repository.sql.``RepositoryFactory`
  `initialise`(url)

    Create a repository at url/path.

  `open`(url)

    Open the repository at url.

    Raise RepositoryNotFound if there is no repository at the given url.