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
Multiple statements #27
Comments
I found the following: https://dev.mysql.com/doc/internals/en/multi-statement.html |
As you can see multiple statements is still in the roadmap. Right now I am working on refactoring errors, this is more important and hard to implement with all this async stuff under the hood. So... Not now |
Multiple statements is something that need to be supported and negotiated between client and server and also there some specific things in parsing protocol packets |
Which one is it, Multiple ResultSet? |
CLIENT_MULTI_STATEMENTS |
The question is how to handle multiple result sets on select statements. How to return multiple result sets |
Right now execute() method returns single ResultSet |
Should we add another pair of methods like executeMultiple and prepareMultiple? Or maybe make ResultSet possible to contain inner result sets |
I think good solution is to leave execute and prepare methods as is. Instead make ResultSet extends Iterator, and add property called next to it. So it can ve iterated in for loop or manually |
The above code I posted return one result in phpMyAdmin. (The first In my use case I need to get id to then fetch other product attributes by certain value from the Flutter app. My goal is to fetch all product attributes in one execute |
Ok I will start to research this issue |
I've pushed recently support for multiple statements to master branch. Can you switch temporary to master branch in your pubspec file and test it? It should now support multiple statements |
That's super to hear! I will try it the first thing I do on Monday and report back |
It works, printing the results of the iterator you added:
It can be noted I could not use original syntax |
Just iterate over results in for loop. It extends Iterable. See updated docs |
So I can close this issue? |
Yes you can close |
Multiple statements
When I run the following sql:
...it failes.
It also happened to me with mysql1 driver pub package. As stated the code runs fine in phpMyAdmin (and returns one result set). The error code lead to SO posts about needing to specify delimiter.
When I adding it, it fails:
While this code works fin everywhere:
Is it supported to make more statements than one in the same
conn.execute(sql)
call? Also, any help understanding why it not seem to work in (2) Flutter mysql drivers but works in phpMyAdmin would be appreciated.The text was updated successfully, but these errors were encountered: