10.2 About PGQL Commands

To run PGQL statements against a database, start SQLcl and then turn on PGQL mode by using the following command:

pgql auto on;

After PGQL mode is turned on, all subsequent SELECT, INSERT, UPDATE, DELETE, CREATE, and DROP statements are considered as PGQL statements.

You can also provide different arguments when turning on PGQL mode:

pgql auto on [args]

The possible arguments are:

  • schema <schema_name>: Make queries run against graphs owned by the specified schema.
  • graph <graph_name>: Make queries run against the specified graph.

  • execute: Turn on PGQL execution.

  • executeonly: Turn on PGQL execution and do not show PGQL-to-SQL translation.

  • translate: Show PGQL-to-SQL translation.

  • translateonly: Show PGQL-to-SQL translation and turn off PGQL execution.

  • parallel <parallel>: Run (or translate) PGQL queries using the specified parallel value.

  • dynamic_sampling <dynamic_sampling>: Run (or translate) PGQL queries using the specified dynamic sampling value.

By default, the schema and graph values are not set, PGQL execution is turned on, and PGQL to SQL translation is turned off. The default value for parallel is 0, and the default value for dynamic_sampling is 6.

To run SQL statements again, turn PGQL mode off:

pgql auto off;

To reset all parameters to their default values, turn PGQL mode off and then turn on again.