Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
145
Issues
145
List
Board
Labels
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
haskell-gargantext
Commits
d49c46a9
Commit
d49c46a9
authored
Jun 18, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[BASHQL] adding tree command.
parent
ac515447
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
13 deletions
+12
-13
Database.hs
src/Gargantext/Database.hs
+12
-13
No files found.
src/Gargantext/Database.hs
View file @
d49c46a9
...
...
@@ -62,6 +62,7 @@ module Gargantext.Database ( module Gargantext.Database.Utils
,
home
,
home'
,
post
,
post'
,
postR'
,
del
,
del'
,
tree
,
tree'
)
where
...
...
@@ -75,7 +76,7 @@ import Data.Text (Text)
import
Opaleye
hiding
(
FromField
)
import
Data.Aeson
import
Data.ByteString
(
ByteString
)
import
Data.List
(
last
)
import
Data.List
(
last
,
concat
)
type
UserId
=
Int
--type NodeId = Int
...
...
@@ -97,8 +98,11 @@ home c = map node_id <$> getNodesWithParentId c 0 Nothing
ls
::
Connection
->
PWD
->
IO
[
Node
Value
]
ls
=
get
tree
::
Connection
->
PWD
->
IO
[[
Node
Value
]]
tree
c
=
undefined
tree
::
Connection
->
PWD
->
IO
[
Node
Value
]
tree
c
p
=
do
ns
<-
get
c
p
cs
<-
mapM
(
\
p'
->
get
c
[
p'
])
$
map
node_id
ns
pure
$
ns
<>
(
concat
cs
)
-- | TODO
...
...
@@ -145,7 +149,11 @@ ls' = do
h
<-
home
c
ls
c
h
type
Children
a
=
Maybe
a
tree'
::
IO
[
Node
Value
]
tree'
=
do
c
<-
connectGargandb
"gargantext.ini"
h
<-
home
c
tree
c
h
post'
::
IO
[
Int
]
post'
=
do
...
...
@@ -159,15 +167,6 @@ post' = do
)
postR'
::
IO
[
Int
]
postR'
=
do
c
<-
connectGargandb
"gargantext.ini"
h
<-
home
c
let
userId
=
1
postR
c
h
[
node
userId
(
last
h
)
Corpus
"name"
"{}"
,
node
userId
(
last
h
)
Project
"name"
"{}"
]
del'
::
[
NodeId
]
->
IO
Int
del'
ns
=
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment