vapor / mysql-nio

🐬 Non-blocking, event-driven Swift client for MySQL.
MIT License
90 stars 27 forks source link

Is it Possible to Call Stored Procedures via SimpleQuery ? #69

Open Phil89a opened 2 years ago

Phil89a commented 2 years ago

I am trying out MySQL-NIO and I want to be able to call a Stored Procedure from my MySQL database and return the result set to my Swift application, however the SimpleQuery is failing with...

MySQL error: Server error: PROCEDURE Accounts.display_Transactions can't return a result set in the given context

The Stored Procedure only has one select, so it is only returning one result set. If I replace the call with the actual SQL from the Stored Procedure it works.

Is it possible to call a Stored Procedure in this way - or is there another method I should be using ?

thanks

Phil

0xTim commented 2 years ago

cc @gwynne

gwynne commented 2 years ago

It is currently not possible to call a stored procedure using MySQLNIO at all; there is no implementation of the CLIENT_MULTI_RESULTS capability yet. It's on my TODO list 😕.

Phil89a commented 2 years ago

Ah pity as I need to keep most of my logic on the server. Not having Stored Procedures means lots of client side logic and SQL statements :(

Hopefully something that can be added soon ?

gwynne commented 2 years ago

Yeah, I'm hoping to get to it in the next couple of weeks.

Phil89a commented 2 years ago

Excellent - I can survive until then :-)

whiterockstudios commented 2 years ago

I would also love to have this 😃

pingrami commented 2 years ago

when calls to stored procedures will be supported?

sunpeakstudio commented 1 year ago

Any idea if calling stored procedure from Vapor will ever be available?

0xTim commented 10 months ago

ping @gwynne