Testing ZCQL Queries

As discussed in the introduction, you can test ZCQL queries from the console before implementing it in your application’s code. This enables you to test and verify the execution of queries before you begin building with it.

If your project’s Data Store is populated, you can perform operations on it from the ZCQL console to retrieve, insert, update, or delete data from the Data Store’s tables. You can view the output of the query executions on the same page.

catalyst_zcql_v2_first_view

ZCQL V2 Console

The Catalyst ZCQL V2 contains additional features and syntax upgrades, ensuring you have an easier experience in implementing the query language. These enhancements are only available in V2, which we recommend that you upgrade to, in order to perform querying operations with greater efficiency.

Currently, in the Catalyst console you will be able to access both V1 and V2 versions of ZCQL.

To switch between versions, you can click the drop-down icon in the top-right corner of the console and select your required version. catalyst_zcql_v2_drop_down

You will be directed to the V2 version by default.

Note: Catalyst will end support for ZCQL V1 Feb 29th, 2024. Only V2 will be available. We recommend that you migrate your existing codebase from V1 to V2. You can find out more about V2's feature enhancements from this help document.

To execute a ZCQL query in the Catalyst console:

  1. Navigate to Query Console under Storage in the Cloud Scale section of the console. catalyst_zcql_v2_empty_console
  2. Type the query in the ZCQL query window. catalyst_zcql_commands_written
Note: You need not use the end-of-statement delimiter ';' at the end of a ZCQL query, while executing it in the ZCQL console.
3. Click Execute. catalyst_execute_zcql_query

The output of your query’s execution will be displayed below the query window.

Using ZCQL V2 in Function Code

To use ZCQL V2 code in your function, you will need to set an environment variable for it in the following manner:

  1. Navigate to Serverless > Functions. catalyst_zcql_v2_func_list
  2. Click the function that contains your ZCQL V2 code.
  3. Click the Configuration tab, then click Create Variable under Environmental Variables. zcql_v2_create_env_variable
  4. Enter the following values in the respective fields:
    Key: ZOHO_CATALYST_ZCQL_PARSER
    Development Value: V2 catalyst_zcql_parser_env_setting
  5. Click Save. catalyst_zcql_env_variable_set

You will now be able to use ZCQL V2 in your function code.

Note:
  • You do not have to reference the environment variable anywhere in your code. Once you have configured it in the console, you can use ZCQL V2 in your function code.

  • We strongly recommend that you migrate your code to ZCQL V2, as V1 support will be completely stopped on Feb 29th, 2024.

Last Updated 2023-08-28 18:12:09 +0530 +0530