Documentation Home
MySQL Shell 8.4
Download this Manual
PDF (US Ltr) - 2.3Mb
PDF (A4) - 2.3Mb


MySQL Shell 8.4  / ...  / Extending MySQL Shell  / MySQL Shell Plugins  /  Creating Plugin Groups

10.3.2 Creating Plugin Groups

You can create a plugin group by placing the folders for multiple MySQL Shell plugins in a containing folder under theplugins folder. A plugin group can contain a mix of plugins defined using JavaScript and plugins defined using Python. Plugin groups can be used to organize plugins that have something in common, for example:

  • Plugins that provide reports on a particular theme.

  • Plugins that reuse the same common code.

  • Plugins that add functions to the same extension object.

If a subdirectory of theplugins folder does not contain an initialization script (aninit.js orinit.py file), MySQL Shell treats it as a plugin group and searches its subfolders for the initialization scripts for the plugins. The containing folder can contain other files with code that is shared by the plugins in the plugin group. As for a plugin's subfolder, the containing folder is ignored if its name begins with a dot (.) but otherwise the name is not important to MySQL Shell.

For example, a plugin group comprising all the functions provided by the user-defined MySQL Shell global objectext can be structured like this:

  • The folderC:\Users\exampleuser\AppData\Roaming\MySQL\mysqlsh\plugins\ext is the containing folder for the plugin group.

  • Common code for the plugins is stored in this folder atC:\Users\exampleuser\AppData\Roaming\MySQL\mysqlsh\plugins\ext\common.py

  • The plugins in the plugin group are stored in subfolders of theext folder, each with aninit.py file, for exampleC:\Users\exampleuser\AppData\Roaming\MySQL\mysqlsh\plugins\ext\helloWorld\init.py.

  • The plugins import the common code fromext.common and use its functions.