]> Git — Sourcephile - gargantext.git/blob - bin/gargantext-upgrade/Main.hs
[FEAT] Distributional (WIP)
[gargantext.git] / bin / gargantext-upgrade / Main.hs
1 {-|
2 Module : Main.hs
3 Description : Gargantext Import Corpus
4 Copyright : (c) CNRS, 2017-Present
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
8 Portability : POSIX
9
10 Import a corpus binary.
11
12 -}
13
14 {-# LANGUAGE Strict #-}
15
16 module Main where
17
18 import Gargantext.API.Dev (withDevEnv, runCmdDev)
19 import Gargantext.API.Prelude (GargError)
20 import Gargantext.API.Node () -- instances only
21 import Gargantext.Database.Admin.Types.Node
22 import Gargantext.Database.Admin.Types.Hyperdata
23 import Gargantext.Database.Query.Table.Node.UpdateOpaleye
24 import Gargantext.Database.Prelude (Cmd, )
25 import Gargantext.Prelude
26 import System.Environment (getArgs)
27
28
29 main :: IO ()
30 main = do
31 [iniPath] <- getArgs
32
33 let
34 updateNodes :: Cmd GargError [Int64]
35 updateNodes = updateNodesWithType_
36 NodeList
37 defaultHyperdataList
38
39 withDevEnv iniPath $ \env -> do
40 x <- runCmdDev env updateNodes
41 putStrLn $ show x
42 pure ()