change to more efficient IKey
This commit is contained in:
parent
0db393d82f
commit
f85f06aae3
1 changed files with 4 additions and 4 deletions
|
@ -41,7 +41,7 @@ share [mkPersist sqlSettings, mkMigrate "migrateContentIdentifier"] [persistLowe
|
||||||
ContentIdentifiers
|
ContentIdentifiers
|
||||||
remote UUID
|
remote UUID
|
||||||
cid ContentIdentifier
|
cid ContentIdentifier
|
||||||
key SKey
|
key IKey
|
||||||
ContentIdentifiersIndexRemoteKey remote key
|
ContentIdentifiersIndexRemoteKey remote key
|
||||||
ContentIdentifiersIndexRemoteCID remote cid
|
ContentIdentifiersIndexRemoteCID remote cid
|
||||||
UniqueRemoteCidKey remote cid key
|
UniqueRemoteCidKey remote cid key
|
||||||
|
@ -79,12 +79,12 @@ flushDbQueue (ContentIdentifierHandle h) = H.flushDbQueue h
|
||||||
-- Be sure to also update the git-annex branch when using this.
|
-- Be sure to also update the git-annex branch when using this.
|
||||||
recordContentIdentifier :: ContentIdentifierHandle -> UUID -> ContentIdentifier -> Key -> IO ()
|
recordContentIdentifier :: ContentIdentifierHandle -> UUID -> ContentIdentifier -> Key -> IO ()
|
||||||
recordContentIdentifier h u cid k = queueDb h $ do
|
recordContentIdentifier h u cid k = queueDb h $ do
|
||||||
void $ insertUnique $ ContentIdentifiers u cid (toSKey k)
|
void $ insertUnique $ ContentIdentifiers u cid (toIKey k)
|
||||||
|
|
||||||
getContentIdentifiers :: ContentIdentifierHandle -> UUID -> Key -> IO [ContentIdentifier]
|
getContentIdentifiers :: ContentIdentifierHandle -> UUID -> Key -> IO [ContentIdentifier]
|
||||||
getContentIdentifiers (ContentIdentifierHandle h) u k = H.queryDbQueue h $ do
|
getContentIdentifiers (ContentIdentifierHandle h) u k = H.queryDbQueue h $ do
|
||||||
l <- selectList
|
l <- selectList
|
||||||
[ ContentIdentifiersKey ==. toSKey k
|
[ ContentIdentifiersKey ==. toIKey k
|
||||||
, ContentIdentifiersRemote ==. u
|
, ContentIdentifiersRemote ==. u
|
||||||
] []
|
] []
|
||||||
return $ map (contentIdentifiersCid . entityVal) l
|
return $ map (contentIdentifiersCid . entityVal) l
|
||||||
|
@ -96,4 +96,4 @@ getContentIdentifierKeys (ContentIdentifierHandle h) u cid =
|
||||||
[ ContentIdentifiersCid ==. cid
|
[ ContentIdentifiersCid ==. cid
|
||||||
, ContentIdentifiersRemote ==. u
|
, ContentIdentifiersRemote ==. u
|
||||||
] []
|
] []
|
||||||
return $ map (fromSKey . contentIdentifiersKey . entityVal) l
|
return $ map (fromIKey . contentIdentifiersKey . entityVal) l
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue