/mysql-udf-pubnub

An mysql UDF for sending message to Pubnub.com using database triggers.

Primary LanguageGoMIT LicenseMIT

Pubnub.com Mysql UDF

We are not using this plugin any more. The plugin is good/working state.

  1. edit udf_pubnub.go and setup corret publish(pubKey), subscribe(subKey), security(secKey).
const (
	pubKey = "pub-c-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
	subKey = "sub-c-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
	secKey = "sec-c-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
)
  1. Build plugin
make build 
  1. Upload the plugin into server by ftp and copy the file in the mysql plugin path
mysql> show variables like 'plugin_dir';
+---------------+--------------------------+
| Variable_name | Value                    |
+---------------+--------------------------+
| plugin_dir    | /usr/lib64/mysql/plugin/ |
+---------------+--------------------------+
1 row in set (0.00 sec)
  1. Install the plugin
DROP FUNCTION IF EXISTS pubnub_grant;
CREATE FUNCTION pubnub_publish RETURNS INT SONAME 'pubnub_udf.so'
DROP FUNCTION IF EXISTS pubnub_publish;
CREATE FUNCTION pubnub_grant RETURNS INT SONAME 'pubnub_udf.so';