The best way to learn about plugins is to examine one. An example
Lua plugin is located in the C:\Program
Files\MySQL\MySQL Workbench
directory.
In that directory you can find the
version
\modulescatalog_utils.grt.lua
Lua file. This is the
plugin for copying SQL to the clipboard.
Any plugin must contain at least three functions:
getModuleInfo()
– This function
tells the GRT that the file is a module.
getPluginInfo()
– This function
tells MySQL Workbench that the module is a function and
registers that plugin.
The function or functions that perform the work of the module.
Open the catalog_utils.grt.lua
file in a text
editor. and you can see that it has the required
objectPluginInput()
and
getPluginInfo()
functions, a helper function
called objectPluginInput()
and the function
that performs the work of this module,
copySQLToClipboard()
.