我jsonExample
在 postgresql 数据库中有一个列 (),类型为jsonb
.
selectCALogs :: IO [(Int, Object)]
selectCALogs = do
con <- connection
query_ con "select \"clusterId\", \"jsonExample\" from cluster"
这给出了以下错误:
• No instance for (Database.PostgreSQL.Simple.FromField.FromField
(unordered-containers-0.2.10.0:Data.HashMap.Base.HashMap
Text Value))
arising from a use of ‘query_’
• In a stmt of a 'do' block:
query_ con "select \"clusterId\", \"clusterCALogs\"
from cluster"
In the expression:
do con <- connection
query_ con "select \"clusterId\", \"clusterCALogs\"from cluster"
In an equation for ‘selectCALogs’:
selectCALogs
= do con <- connection
query_ con "select \"clusterId\",
\"clusterCALogs\" from cluster"
|
80 | query_ con "select \"clusterId\", \"clusterCALogs\"
from cluster"
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
我怎样才能让它返回一个 JSON 对象 - 使用 aeson 或其他东西?