Skip to content

Instantly share code, notes, and snippets.

@ToeJamson
Created August 29, 2013 16:15
Show Gist options
  • Select an option

  • Save ToeJamson/6380179 to your computer and use it in GitHub Desktop.

Select an option

Save ToeJamson/6380179 to your computer and use it in GitHub Desktop.
Why Business Intelligence Tools Need a Real-time Service Provider
DELIMITER $$
CREATE PROCEDURE push_message
(p1 DOUBLE,
p2 DOUBLE,
p3 BIGINT)
BEGIN
DECLARE cmd CHAR(255);
DECLARE result CHAR(255);
SET cmd = CONCAT('curl https://pubsub.pubnub.com/publish/demo/demo/0/mysql_triggers/0/%22',p1, ',' ,p2, ',' ,p3,'%22');
SET result = sys_eval(cmd);
END$$;
NOTE: Make sure your PROCEDURE types are correct DOUBLE or VARCHAR or TEXT.
CREATE TRIGGER push_message_trigger AFTER INSERT ON your_table_name_here
FOR EACH ROW
CALL push_message(NEW.Column1, NEW.Column2, NEW.Column3);
NOTE: Make sure to include the columns you need here in your push message.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment