Skip to content

Commit

Permalink
backend: update flake.lock and flake.nix for async pipeline operation…
Browse files Browse the repository at this point in the history
…; add findAllFromKvRedis function (#697)
  • Loading branch information
vijaygupta18 authored Dec 3, 2024
1 parent bc9bcf2 commit 1ad649c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions lib/mobility-core/src/Kernel/Beam/Functions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ module Kernel.Beam.Functions
findAllWithKVAndConditionalDB,
findOneWithKVRedis,
logQueryData,
findAllFromKvRedis,
)
where

Expand Down Expand Up @@ -317,6 +318,26 @@ findAllWithKVAndConditionalDB where' orderBy = do
pure $ catMaybes res'
Left err -> throwError $ InternalError $ show err

findAllFromKvRedis ::
forall table m r a.
( BeamTableFlow table m,
CacheFlow m r,
EsqDBFlow m r,
FromTType' (table Identity) a
) =>
Where Postgres table ->
Maybe (OrderBy table) ->
m [a]
findAllFromKvRedis where' orderBy = do
updatedMeshConfig <- setMeshConfig (modelTableName @table) (modelSchemaName @table) meshConfig
dbConf' <- getReadDBConfigInternal (modelTableName @table)
result <- KV.findAllFromKvRedis dbConf' updatedMeshConfig where' orderBy
case result of
Right res -> do
res' <- mapM fromTType' res
pure $ catMaybes res'
Left err -> throwError $ InternalError $ show err

-- findAllWithOptions --

findAllWithOptionsKV ::
Expand Down

0 comments on commit 1ad649c

Please sign in to comment.