mirror of https://github.com/voidlizard/hbs2
wip16
This commit is contained in:
parent
93d8848a72
commit
857b93a810
|
@ -736,8 +736,6 @@ export mref' r = connectedDo $ flip runContT pure do
|
||||||
void $ putBlock sto s
|
void $ putBlock sto s
|
||||||
|
|
||||||
withState $ transactional do
|
withState $ transactional do
|
||||||
for_ packs $ \href -> do
|
|
||||||
insertGitPack co href
|
|
||||||
insertCBlock co (HashRef root)
|
insertCBlock co (HashRef root)
|
||||||
|
|
||||||
notice $ "cblock" <+> pretty root
|
notice $ "cblock" <+> pretty root
|
||||||
|
|
|
@ -43,15 +43,6 @@ evolveState = do
|
||||||
|
|
||||||
ddl [qc|
|
ddl [qc|
|
||||||
create table if not exists
|
create table if not exists
|
||||||
gitpack
|
|
||||||
( kommit text not null
|
|
||||||
, pack text not null
|
|
||||||
, primary key (kommit,pack)
|
|
||||||
)
|
|
||||||
|]
|
|
||||||
|
|
||||||
ddl [qc|
|
|
||||||
create table if not exists
|
|
||||||
cblock
|
cblock
|
||||||
( kommit text not null primary key
|
( kommit text not null primary key
|
||||||
, cblock text not null
|
, cblock text not null
|
||||||
|
@ -59,7 +50,6 @@ cblock
|
||||||
|]
|
|]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
instance ToField GitHash where
|
instance ToField GitHash where
|
||||||
toField h = toField (show $ pretty h)
|
toField h = toField (show $ pretty h)
|
||||||
|
|
||||||
|
@ -78,18 +68,6 @@ instance ToField HashRef where
|
||||||
instance FromField HashRef where
|
instance FromField HashRef where
|
||||||
fromField = fmap (fromString @HashRef) . fromField @String
|
fromField = fmap (fromString @HashRef) . fromField @String
|
||||||
|
|
||||||
insertGitPack :: MonadIO m => GitHash -> HashRef -> DBPipeM m ()
|
|
||||||
insertGitPack co pack = do
|
|
||||||
insert [qc|
|
|
||||||
insert into gitpack (kommit,pack) values(?,?)
|
|
||||||
on conflict (kommit,pack) do nothing
|
|
||||||
|] (co, pack)
|
|
||||||
|
|
||||||
selectGitPacks :: MonadIO m => GitHash -> DBPipeM m [HashRef]
|
|
||||||
selectGitPacks gh = do
|
|
||||||
select [qc|select pack from gitpack where kommit = ? |] (Only gh)
|
|
||||||
<&> fmap fromOnly
|
|
||||||
|
|
||||||
insertCBlock :: MonadIO m => GitHash -> HashRef -> DBPipeM m ()
|
insertCBlock :: MonadIO m => GitHash -> HashRef -> DBPipeM m ()
|
||||||
insertCBlock co cblk = do
|
insertCBlock co cblk = do
|
||||||
insert [qc|
|
insert [qc|
|
||||||
|
|
Loading…
Reference in New Issue