| Copyright | (c) 2016-2017 Red Hat Inc. |
|---|---|
| License | LGPL |
| Maintainer | https://github.com/weldr |
| Stability | alpha |
| Portability | portable |
| Safe Haskell | None |
| Language | Haskell2010 |
BDCS.Sources
Description
- findSource :: MonadIO m => Text -> Key Projects -> SqlPersistT m (Maybe (Key Sources))
- getSource :: MonadIO m => Key Sources -> SqlPersistT m (Maybe Sources)
- insertSource :: MonadIO m => Sources -> SqlPersistT m (Key Sources)
- insertSourceKeyValue :: MonadIO m => KeyType -> Text -> Maybe Text -> Key Sources -> SqlPersistT m (Key SourceKeyValues)
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.
Arguments
| :: MonadIO m | |
| => KeyType | Type of the |
| -> Text | Value of the |
| -> Maybe Text | Extended value of the |
| -> Key Sources | Source to be associated with the |
| -> 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.