gpt4 book ai didi

mysql - sqljocky 查询 - 未找到方法

转载 作者:行者123 更新时间:2023-11-29 23:35:43 26 4
gpt4 key购买 nike

尝试使用 sqljocky 查询 mysql 数据库。此查询在 phpmyadmin 中运行良好,并返回 5 行包含良好数据的结果。在 Dart 中我遇到了异常:

Class '_ResultsImpl' has no instance method 'forEach'.

我在查询回调中设置了断点。结果对象公共(public)字段为空: enter image description here

Ping 功能正常,已建立与基站的连接。 enter image description here

即使我查询简单的“显示表”查询,它也会返回没有数据的空结果实例。

查询代码如下:

var pool = new ConnectionPool(
host: '127.0.0.1', port: 8889,
user: 'root', password: 'root',
db: 'lulzvideo', max: 5);


pool.query('select id, title from users')
.then((results) {
results.forEach((row) {
print('Name: ${row[0]}, email: ${row[1]}');
});
});

最佳答案

result.listen((row) {
// Import into object
object.Import(row);

sqljocky querying database synchronously

关于mysql - sqljocky 查询 - 未找到方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26385945/

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