Skip to content
Commit a869c532 authored by Ryan Roberts's avatar Ryan Roberts
Browse files

cli: Implement resultstore abstraction around database



In preparation for adding support for storing result sets in a database,
let's add a new abstraction called "resultstore". A store can contain
arbitrary result sets, and can be backed by csv files (as is already
supported), sqlite as a file on disk, or mysql database.

At it's core, operations are always performed on a database that
conforms to the table schema. A resultstore can be opened, created and
destroyed. We can also create a resultstore from either a set of csv
files or pandas dataframes; in these cases, the resultstore database is
a temporary in-memory sqlite database. We can then export a resultstore
to csv files or pandas dataframes. Finally, we can query to get objects
from the resultstore, and merge those returned objects into another
resultstore in a manner that ensures proper deduplication.

The schema is defined with SQLAlchemy to make things portable between
database types (tested with sqlite and mysql. postgresql could be added
in future). It's object-relational-mapper (ORM) is used so we can
interact with the DB in a mostly pythonic and object oriented manner.

There are no users yet, but we will add some in follow up commits.

Signed-off-by: Ryan Roberts's avatarRyan Roberts <ryan.roberts@arm.com>
parent bae02f17
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment