]> Git — Sourcephile - gargantext.git/blob - src/Gargantext/Database/Query/Table/NodesNgramsRepo.hs
[ngrams] REFRESH MATERIALIZED VIEW CONCURRENTLY
[gargantext.git] / src / Gargantext / Database / Query / Table / NodesNgramsRepo.hs
1 {-|
2 Module : Gargantext.Database.Schema.NodesNgramsRepo
3 Description :
4 Copyright : (c) CNRS, 2017-Present
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
8 Portability : POSIX
9
10 -}
11
12 {-# OPTIONS_GHC -fno-warn-orphans #-}
13
14 {-# LANGUAGE Arrows #-}
15 {-# LANGUAGE FunctionalDependencies #-}
16 {-# LANGUAGE QuasiQuotes #-}
17 {-# LANGUAGE TemplateHaskell #-}
18
19 module Gargantext.Database.Query.Table.NodesNgramsRepo
20 where
21
22 {-
23 import Gargantext.Database.Schema.Prelude
24 import Gargantext.API.Ngrams (NgramsStatePatch)
25 import Gargantext.Database.Schema.NodesNgramsRepo
26 import Gargantext.Database.Prelude (mkCmd, Cmd, runOpaQuery)
27 import Gargantext.Prelude
28
29
30 selectPatches :: Query RepoDbRead
31 selectPatches = proc () -> do
32 repos <- selectTable repoTable -< ()
33 returnA -< repos
34
35 _selectRepo :: Cmd err [RepoDbNgrams]
36 _selectRepo = runOpaQuery selectPatches
37
38 _insertRepos :: [NgramsStatePatch] -> Cmd err Int64
39 _insertRepos ns = mkCmd $ \conn -> runInsert_ conn $ Insert repoTable (toWrite ns) rCount Nothing
40 where
41 toWrite :: [NgramsStatePatch] -> [RepoDbWrite]
42 toWrite = undefined
43 --ns' = map (\(RepoDbNgrams v ps) -> RepoDbWrite (sqlInt4 v) (pgJSONB ps)) ns
44 -}