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
199
Issues
199
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
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
9179315e
Commit
9179315e
authored
Mar 25, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DEBUG] message for SQL.
parent
33cee927
Pipeline
#302
failed with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
13 deletions
+21
-13
NgramsByNode.hs
src/Gargantext/Database/Metrics/NgramsByNode.hs
+1
-1
Utils.hs
src/Gargantext/Database/Utils.hs
+20
-12
No files found.
src/Gargantext/Database/Metrics/NgramsByNode.hs
View file @
9179315e
...
...
@@ -253,7 +253,7 @@ SELECT nng.node_id, ng.id, ng.terms FROM nodes_ngrams nng
AND nng.ngrams_type = ? -- NgramsTypeId
GROUP BY nng.node_id, ng.id, ng.terms)
SELECT m.node_id, m.terms FROM nodesByNgramsMaster m
SELECT
x
m.node_id, m.terms FROM nodesByNgramsMaster m
RIGHT JOIN nodesByNgramsUser u ON u.id = m.id
|]
...
...
src/Gargantext/Database/Utils.hs
View file @
9179315e
...
...
@@ -20,10 +20,9 @@ commentary with @some markup@.
module
Gargantext.Database.Utils
where
import
Prelude
(
String
)
import
Control.Monad
((
>>
))
--import Data.Text (Text)
import
Control.Monad.Error.Class
(
MonadError
(
..
))
import
Control.Exception
import
Data.Text
(
Text
)
import
Control.Monad.Error.Class
-- (MonadError(..), Error)
import
Control.Lens
(
Getter
,
view
)
import
Control.Monad.Reader
import
Control.Monad.Except
...
...
@@ -84,17 +83,26 @@ runOpaQuery q = mkCmd $ \c -> runQuery c q
formatPGSQuery
::
PGS
.
ToRow
a
=>
PGS
.
Query
->
a
->
Cmd
err
DB
.
ByteString
formatPGSQuery
q
a
=
mkCmd
$
\
conn
->
PGS
.
formatQuery
conn
q
a
runPGSQuery
'
::
(
PGS
.
ToRow
a
,
PGS
.
FromRow
b
)
=>
PGS
.
Query
->
a
->
Cmd
err
[
b
]
runPGSQuery
'
q
a
=
mkCmd
$
\
conn
->
PGS
.
query
conn
q
a
runPGSQuery
::
(
PGS
.
ToRow
a
,
PGS
.
FromRow
b
)
=>
PGS
.
Query
->
a
->
Cmd
err
[
b
]
runPGSQuery
q
a
=
mkCmd
$
\
conn
->
PGS
.
query
conn
q
a
runPGSQuery
::
(
MonadError
err
m
,
MonadReader
env
m
,
data
SqlErrorX
=
SqlErrorX
deriving
(
Eq
,
Show
)
instance
Exception
SqlErrorX
runPGSQuery'
::
(
MonadError
(
SqlErrorX
)
m
,
MonadReader
env
m
,
PGS
.
FromRow
r
,
PGS
.
ToRow
q
,
MonadIO
m
,
HasConnection
env
)
=>
PGS
.
Query
->
q
->
m
[
r
]
runPGSQuery
q
a
=
mkCmd
$
\
conn
->
catchError
(
PGS
.
query
conn
q
a
)
(
\
e
->
putStrLn
(
"Text xxxxxxxxxxxxxxxxxxx"
::
String
)
--(\e -> putStrLn ((cs $ formatPGSQuery q a):: Text)
>>
throwError
e
)
runPGSQuery'
q
a
=
mkCmd
$
\
conn
->
catchError
(
PGS
.
query
conn
q
a
)
(
printError
conn
)
where
printError
c
e
=
do
q'
<-
(
PGS
.
formatQuery
c
q
a
::
IO
DB
.
ByteString
)
putStrLn
(
cs
q'
::
Text
)
throwError
e
execPGSQuery
::
PGS
.
ToRow
a
=>
PGS
.
Query
->
a
->
Cmd
err
Int64
execPGSQuery
q
a
=
mkCmd
$
\
conn
->
PGS
.
execute
conn
q
a
...
...
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