This command returns the DDL of all objects in a database.
GENERATE [IN JSON] DATABASE <database name> [[WITH][GLOBALS | NOGLOBALS][OWNERSHIPS | NOOWNERSHIPS][PRIVILEGES | NOPRIVILEGES]]
This is an example:
generate database database_name with globals with ownerships;