]> Git — Sourcephile - gargantext.git/blob - bin/gargantext-upgrade/Main.hs
[VERSION] +1 to 0.0.1.91.0
[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 Data.Proxy
19 import Gargantext.API.Admin.Settings (withDevEnv, runCmdDev)
20 import Gargantext.API.Prelude (GargError)
21 import Gargantext.API.Node () -- instances only
22 import Gargantext.Database.Admin.Types.Node
23 import Gargantext.Database.Admin.Types.Hyperdata
24 import Gargantext.Database.Query.Table.Node.UpdateOpaleye
25 import Gargantext.Database.Prelude (Cmd, )
26 import Gargantext.Prelude
27 import System.Environment (getArgs)
28
29
30 main :: IO ()
31 main = do
32 [iniPath] <- getArgs
33
34 let
35 updateNodes :: Cmd GargError [Int64]
36 updateNodes = updateNodesWithType_
37 NodeList
38 defaultHyperdataList
39
40 withDevEnv iniPath $ \env -> do
41 x <- runCmdDev env updateNodes
42 putStrLn $ show x
43 pure ()