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

Copyright(c) 2016-2017 Red Hat Inc.
LicenseLGPL
Maintainerhttps://github.com/weldr
Stabilityalpha
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

BDCS.Sources

Description

Manage Sources records in the database. This record keeps track of a single software release of a single project. A single project can make many releases, each of which will require a separate Sources record.

Synopsis

Documentation

findSource :: MonadIO m => Text -> Key Projects -> SqlPersistT m (Maybe (Key Sources)) Source #

Given a version number and a key to a Projects record, find a matching software source in the database. If it exists, the database key is returned.

getSource :: MonadIO m => Key Sources -> SqlPersistT m (Maybe Sources) Source #

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

insertSource :: MonadIO m => Sources -> SqlPersistT m (Key Sources) Source #

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

insertSourceKeyValue Source #

Arguments

:: MonadIO m 
=> KeyType

Type of the KeyVal

-> Text

Value of the KeyVal

-> Maybe Text

Extended value of the KeyVal

-> Key Sources

Source to be associated with the KeyVal

-> SqlPersistT m (Key SourceKeyValues) 

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

A single source can potentially have zero or more KeyVal paris associated with it. On the other hand, a single KeyVal pair can apply to many sources.