Light
Dark
System
v3latest
v3latest
v2
v1

Modules

This section describes the DDL commands pertaining to modules.

Create a new module.

create module name [ if not exists ];

There’s a corresponding SDL declaration for a module, although in SDL a module declaration is likely to also include that module’s content.

New

You may also create a nested module.

create module parent-name::name [ if not exists ];

The command create module defines a new module for the current database. The name of the new module must be distinct from any existing module in the current database. Unlike SDL module declaration the create module command does not have sub-commands, as module contents are created separately.

if not exists

Normally creating a module that already exists is an error, but with this flag the command will succeed. It is useful for scripts that add something to a module or if the module is missing the module is created as well.

Create a new module:

Copy
create module payments;
New

Create a new nested module:

Copy
create module payments::currencies;

Remove a module.

drop module name ;

The command drop module removes an existing module from the current database. All schema items and data contained in the module are removed as well.

Remove a module:

Copy
drop module payments;
Light
Dark
System

We use ChatGPT with additional context from our documentation to answer your questions. Not all answers will be accurate. Please join our Discord if you need more help.