mirror of https://github.com/voidlizard/hbs2
wip, debug
This commit is contained in:
parent
3092140085
commit
ddd6dc7d7f
|
|
@ -1,7 +1,7 @@
|
||||||
name: "hbs2"
|
name: "hbs2"
|
||||||
author: "Dmitry Zuikov"
|
author: "Dmitry Zuikov"
|
||||||
public: yes
|
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
|
# Project description
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -215,17 +215,21 @@ instance (MonadUnliftIO m, HasOracleEnv m) => HandleMethod m RpcChannelQuery whe
|
||||||
|
|
||||||
withOracleEnv env do
|
withOracleEnv env do
|
||||||
items <- withState $ select_ @_ @(HashVal, Text, Text) [qc|
|
items <- withState $ select_ @_ @(HashVal, Text, Text) [qc|
|
||||||
select lwwref, name, brief
|
|
||||||
from (
|
|
||||||
select
|
|
||||||
lwwref
|
|
||||||
, name
|
|
||||||
, brief
|
|
||||||
, max(lwwseq)
|
|
||||||
, max(repoheadseq)
|
|
||||||
|
|
||||||
from gitrepofact
|
SELECT
|
||||||
group by lwwref,name,brief) as s0;
|
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
|
let root = object [ "rows" .= items
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue