add getContentIdentifiers
Changed the database schema for this, with a new index.
This commit is contained in:
parent
00722ba1f8
commit
138d07eb97
1 changed files with 10 additions and 1 deletions
|
@ -41,7 +41,8 @@ ContentIdentifiers
|
|||
remote UUID
|
||||
cid ContentIdentifier
|
||||
key SKey
|
||||
ContentIdentifiersIndex remote cid
|
||||
ContentIdentifiersIndexRemoteKey remote key
|
||||
ContentIdentifiersIndexRemoteCID remote cid
|
||||
UniqueRemoteCidKey remote cid key
|
||||
|]
|
||||
|
||||
|
@ -79,6 +80,14 @@ recordContentIdentifier :: ContentIdentifierHandle -> UUID -> ContentIdentifier
|
|||
recordContentIdentifier h u cid k = queueDb h $ do
|
||||
void $ insertUnique $ ContentIdentifiers u cid (toSKey k)
|
||||
|
||||
getContentIdentifiers :: ContentIdentifierHandle -> UUID -> Key -> IO [ContentIdentifier]
|
||||
getContentIdentifiers (ContentIdentifierHandle h) u k = H.queryDbQueue h $ do
|
||||
l <- selectList
|
||||
[ ContentIdentifiersCid ==. cid
|
||||
, ContentIdentifiersKey ==. toSKey k
|
||||
] []
|
||||
return $ map (ContentIdentifiersCid . entityVal) l
|
||||
|
||||
getContentIdentifierKeys :: ContentIdentifierHandle -> UUID -> ContentIdentifier -> IO [Key]
|
||||
getContentIdentifierKeys (ContentIdentifierHandle h) u cid =
|
||||
H.queryDbQueue h $ do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue