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
  • Loading branch information
vijaygupta18 committed Dec 2, 2024
1 parent 9cc2912 commit 366dd31
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
7 changes: 4 additions & 3 deletions flake.lock

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

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
prometheus-haskell.inputs.haskell-flake.follows = "common/haskell-flake";

euler-hs = {
url = "github:nammayatri/euler-hs";
url = "github:nammayatri/euler-hs/backend/async-pipeline-operation";
inputs.nixpkgs.follows = "nixpkgs";
inputs.haskell-flake.follows = "haskell-flake";
};
Expand Down
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 366dd31

Please sign in to comment.