From febd2d7a243d540fa083be78783059762fcb42c7 Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Thu, 6 Jun 2024 15:20:33 +0200 Subject: add `$fileName` to values --- backend/app/Main.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'backend/app') diff --git a/backend/app/Main.hs b/backend/app/Main.hs index 8bd02b2..df5dee8 100644 --- a/backend/app/Main.hs +++ b/backend/app/Main.hs @@ -127,10 +127,10 @@ initRepo root ref = do let cls = M.toList . M.unionsWith (++) $ map (\f -> M.singleton (takeDirectory f) [f]) fs - colls <- forM cls $ \(path, (file : files)) -> do + colls <- forM cls $ \(path, files) -> do (value : values) <- do - liftIO $ Q.withStore root ref do - mapM (Q.withCommit cid . Q.readFile) (file : files) + liftIO . Q.withStore root ref . Q.withCommit cid $ do + Q.query (fromString ("SELECT " <> path <> " FROM " <> path)) let schema = U.autoTypes' value values pure $ Collection path files schema let schemaVersion = -- cgit v1.2.3