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 <ryan.roberts@arm.com>
Loading
-
mentioned in commit 2abc59c0
-
mentioned in merge request !6 (merged)
Please register or sign in to comment