gpt4 book ai didi

sqlite - 如何用red连接sqlite3

转载 作者:行者123 更新时间:2023-12-02 14:24:07 25 4
gpt4 key购买 nike

我尝试加载红色网站上提到的两个 sqlite 库,但是它们都是基于 rebol 的,并给出“无效问题”错误,例如:

*** Syntax Error: invalid issue! at "^-^-^-#[datatype! integer!]^-[*bind-int (sid"
*** Where: do
*** Stack: do-file expand-directives load

想要从 sqlite 存储中获取数据并从 red 更新相同的数据。

编辑:我已经设法使用call/output来调用sqlite3可执行文件,但不知道是否有更好的方法来做到这一点。

files: ""
call/output {sqlite3 test.sqlite "select bookid, title from books order by rowid desc limit 10"} files
rows: split files "^/"

然后需要拆分每一行。

最佳答案

在您的案例中,解释器被所谓的构造语法 #[...] 所困扰,目前 Red 只部分支持该语法。

此外,使用 SQLite3 绑定(bind)(以及任何面向 I/O 的库)需要 port! 数据类型实现,该实现仅在 0.7.0 版本中提供。与此同时,call 应该能很好地满足您的需求,即使它看起来像是一个临时解决方案。

关于sqlite - 如何用red连接sqlite3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54157175/

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