bdcs-0.2.0: Tools for managing a content store of software packages

Copyright(c) 2016-2017 Red Hat Inc.
Safe HaskellNone



Manage Builds records in the database. This record keeps track of a single build of a single software source (tarball, etc.). A single source can be built multiple times, each of which will require a separate Builds record.



associateBuildWithPackage :: MonadIO m => Key Builds -> Key KeyVal -> SqlPersistT m (Key BuildKeyValues) Source #

Create a link in the database between an existing Builds record and an existing KeyVal record. This is different from insertBuildKeyValue, which also creates the KeyVal record. A single build can potentially have zero or many KeyVal pairs associated with it. On the other hand, a single KeyVal pair can apply to many builds.

The database key of the new link is returned.

findBuild Source #


:: MonadIO m 
=> Int

Epoch (usually, 0)

-> Text


-> Text

Hardware architecture

-> Key Sources

Reference to a Sources record

-> SqlPersistT m (Maybe (Key Builds)) 

Find a single build of a software package in the database, returning the database key for that build if it exists. All arguments are required and must be matched for this function to return anything. Note that conceptually, a build is of some software source which is why a key to a Sources record is required.

getBuild :: MonadIO m => Key Builds -> SqlPersistT m (Maybe Builds) Source #

Given a key to a Builds record in the database, return that record. This function is suitable for using on the result of findBuild.

insertBuild :: MonadIO m => Builds -> SqlPersistT m (Key Builds) Source #

Conditionally add a new Builds record to the database. If the record already exists, return its key. Otherwise, insert the record and return the new key.

insertBuildKeyValue Source #


:: MonadIO m 
=> KeyType

Type of the KeyVal

-> Text

Value of the KeyVal

-> Maybe Text

Extended value of the KeyVal

-> Key Builds

Build to be associated with the KeyVal

-> SqlPersistT m (Key BuildKeyValues) 

Conditionally add a new KeyVal record to the database and associate a Builds record with it. If the KeyVal record already exists, it is reused in creating the association. The database key of the association is returned.