I've a project in GO that check if there are new migrations to apply when the app starts (I'm using library https://github.com/mattes/migrate).
Now the problem is that I have a stored procedure to create in one of this migration (because this will be called later, and I need to create it in a migration otherwise the test suite will fail of course).
An example can be this one:
DELIMITER @@
CREATE PROCEDURE get_value(my_id BIGINT(20), OUT out_value DOUBLE)
BEGIN
SELECT CASE
WHEN o.financial_status = "test" THEN 0
ELSE 1
END
INTO out_value
FROM `order` o
LEFT JOIN `my_table_2` io ON io.field_2 = o.id
LEFT JOIN `my_table_3` ip ON io.field_3 = ip.id
WHERE o.id = my_id;
END @@
DELIMITER ;
As far as I read, this might not be possible because sql driver for go does not support multi statement (we're using mysql 5.6).
There are any other way to do that? Thanks!