gpt4 book ai didi

node.js - 错误 : no such function: json_each in SQLite with JSON1 installed

转载 作者:搜寻专家 更新时间:2023-11-01 00:39:06 24 4
gpt4 key购买 nike

我已经通过 brew 安装了带有 JSON1 的 SQLite3:

brew install sqlite3 --with-json1 --with-fts5

版本:

3.15.2 2016-11-28 19:13:37 bbd85d235f7037c6a033a9690534391ffeacecc8

运行查询时,某些函数可以正常工作,例如 json_extract:

sqlite> SELECT json_extract(Body, '$.issue.fields.labels') FROM Event WHERE json_extract(Body, '$.issue.fields.labels') != '[]';

["foo","bar","baz"]

但是,当我尝试使用 json_eachjson_tree 时,它失败了:

sqlite> SELECT json_each(Body, '$.issue.fields.labels') FROM Event WHERE json_extract(Body, '$.issue.fields.labels') != '[]';

Error: no such function: json_each

Event 表中的 Body 字段是一个有效的 JSON 字符串:

{"issue":{"fields":{"labels": ["foo","bar","baz"]}}}

labels 的值是一个数组。

我已阅读文档(并查看了 json_each examples ),搜索了互联网,但找不到启用此功能的任何其他要求。

我做错了什么,或者:我如何从 json_each/json_tree 中获益?

最佳答案

AFAIK,您不能将 json_each()json_tree() 用作查询中的字段,它们是 table-valued functions .您只能像使用表格一样使用它们。

关于node.js - 错误 : no such function: json_each in SQLite with JSON1 installed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41309722/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com