I'm currently learning to use the Go sql drivers (with MySQL) to talk to a database, and I want to insert a trigger that will be activated when a new record is inserted into a table.
I know that to do this in pure SQL, the statement needs to look like:
CREATE TRIGGER ins_sum BEFORE INSERT ON table_1
FOR EACH ROW SET @sum = @sum + new.amount
but I'm not sure what this returns, so don't know how to structure as a go/sql query.
Thanks!