mysql - sqljocky 查询 - 未找到方法

标签 mysql dart dart-io sqljocky

尝试使用 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/

相关文章:

mysql - Doctrine2 多重连接

dart - Dart 类型数据库中的可增长列表

flutter - 如何创建在事件菜单项上带有顶行的 Flutter 底部导航?

dart - 在 Dart 中读取文件

java - 如何解决异常 “com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data source rejected establishment of connection”?

mysql - 如何使用 Eclipse IDE 设置 MySQL?

java - GWT + MySQL - 如何创建连接?

dart - angular.dart NgTwoWay和NgAttr已弃用?

dart - 如何在 Dart 中获取当前脚本的目录?

dart - 杀死进程组