wip, debug

This commit is contained in:
Dmitry Zuikov 2024-03-28 17:50:22 +03:00
parent 3092140085
commit ddd6dc7d7f
2 changed files with 15 additions and 11 deletions

View File

@ -1,7 +1,7 @@
name: "hbs2"
author: "Dmitry Zuikov"
public: yes
brief: "HBS2: P2P CAS and protocol framework #haskell #p2p #distributed 111"
brief: "HBS2: P2P CAS and protocol framework #haskell #p2p #distributed"
# Project description

View File

@ -215,17 +215,21 @@ instance (MonadUnliftIO m, HasOracleEnv m) => HandleMethod m RpcChannelQuery whe
withOracleEnv env do
items <- withState $ select_ @_ @(HashVal, Text, Text) [qc|
select lwwref, name, brief
from (
select
lwwref
, name
, brief
, max(lwwseq)
, max(repoheadseq)
from gitrepofact
group by lwwref,name,brief) as s0;
SELECT
lwwref,
name,
brief
FROM (
SELECT
lwwref,
name,
brief,
ROW_NUMBER() OVER (PARTITION BY lwwref ORDER BY lwwseq DESC) as rn
FROM gitrepofact
) as s0
WHERE rn = 1;
|]
let root = object [ "rows" .= items