cordiverse / minato

Type Driven Database Framework.
MIT License
27 stars 12 forks source link

Feature request: sqlite REGEXP #12

Closed MirrorCY closed 1 year ago

MirrorCY commented 1 year ago

dialogue 读取带图片问答时报错,报错内容为 Error: no such function: REGEXP

复现流程:

  1. 安装 koishi desktop 0.9.1
  2. 安装配置 assets-local dialogue onebot 插件
  3. onebot 群聊中添加对话 foo,回答为一张图片
  4. 群聊中输入 foo,没有回复
  5. 查看 log

相关日志:

2022-12-30 17:19:13 [W] sqlite > SELECT * FROM `dialogue` bcrghqyv WHERE (`flag` & 2 = 2 AND 'foo' REGEXP `original` OR `flag` & 2 = 0 AND `question` = 'foo')
2022-12-30 17:19:13 [W] session foo
                        Error: no such function: REGEXP
                            at f.handleError (C:\Users\42\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@minatojs\sql.js\dist\sql-wasm.js:91:290)
                            at f.prepare (C:\Users\42\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@minatojs\sql.js\dist\sql-wasm.js:90:46)
                            at SQLiteDriver.#exec (C:\Users\42\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@minatojs\driver-sqlite\lib\index.js:307:26)
                            at SQLiteDriver.#all (C:\Users\42\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@minatojs\driver-sqlite\lib\index.js:319:48)
                            at SQLiteDriver.get (C:\Users\42\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@minatojs\driver-sqlite\lib\index.js:241:54)
                            at Selection.execute (C:\Users\42\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@minatojs\core\lib\index.cjs:349:34)
                            at Selection.execute (C:\Users\42\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@minatojs\core\lib\index.cjs:414:20)
                            at DatabaseService.get (C:\Users\42\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\@minatojs\core\lib\index.cjs:496:22)
                            at processTicksAndRejections (node:internal/process/task_queues:96:5)
                            at async DialogueService.get (C:\Users\42\AppData\Roaming\Koishi\Desktop\data\instances\default\node_modules\koishi-plugin-dialogue\lib\index.js:126:25)
Anillc commented 1 year ago

请问你那边能稳定复现吗,我这边测试多次并没有遇到这样的问题,能否详细描述一下你的环境

MirrorCY commented 1 year ago

稍晚我尝试复现,按道理应该是百分之百复现的

Anillc commented 1 year ago

尝试一下这里说的禁用 dataview 呢

https://github.com/koishijs/koishi/issues/894#issuecomment-1369569551