Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

galileo_sqljocky5 there is an error in MySqlConnection.prepare #11

Open
Cinichengbuweikong opened this issue Sep 19, 2023 · 0 comments
Open

Comments

@Cinichengbuweikong
Copy link

I have code like this:

Prepared sql = await connect.prepare("select * from users where name=?");
StreamedResults res = await sql.execute(["somename"]);

When I run the above code, Dart reports an error saying:
"Unhandled exception: type 'Future' is not a subtype of type 'FutureOr' in type cast“

I found this problem by simply changing the prepare function in the MysqlConnection class in "package:galileo_sqljocky5/internal/connection/impl.dart" to:

@override
Future<Prepared> prepare(String sql) async {
  var query = await _socket.execHandler(PrepareHandler(sql), _timeout);  // here
  return PreparedImpl._(this, query);
}

That's it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant