MySQL Shell 8.0

10.2.1 Creating User-Defined MySQL Shell Global Objects

To create a new MySQL Shell global object to act as an entry point for your extension objects, first create a new top-level extension object using the built-in shell.createExtensionObject() function in JavaScript or shell.create_extension_object() in Python:


Then register this top-level extension object as a MySQL Shell global object by calling the shell.registerGlobal() method in JavaScript or shell.register_global() in Python. The syntax for the method is as follows:

shell.registerGlobal(name, object[, definition])