Skip to main content

Design ClickHouse Table Structures

NineData provides a visual table designer in SQL Console. You can create ClickHouse tables, configure columns and indexes, and generate the corresponding SQL script without writing the full statement manually.

Before you begin

  • The data source type is ClickHouse.

  • In Organizational mode, you have permission to use SQL Console.

  • In Organizational mode, you have read and write permissions on the target data source.

    tip

    If you do not have these permissions, contact your organization administrator to configure permissions or bind roles.

  • In the commercial versions (DevOps Pro, DevOps Enterprise), make sure your monthly or yearly subscription has not expired. An expired subscription may prevent you from using the Database DevOps service. You can check the remaining quota and expiration date in the NineData Console header.

    check_quota

Procedure

You can design the table structure when you create or edit a table in SQL Console. This procedure uses table creation as the example.

  1. Open SQL Console and go to the target data source.

  2. In the SQL Console database tree, right-click the target database and click Create Table.

    ck_create_table

    tip

    NineData creates the table in the target database.

  3. On the Create Table tab, configure the table structure. NineData generates SQL Script at the bottom of the page based on your configuration. Use the tabs below to review the available settings.

    ck_table_creation

  • Name: Enter a custom table name.
  • Database: Database where the table is created. The default value is the database you right-clicked in step 2.
  • Comment: Table comment, which is written as the COMMENT attribute.
  • Table Engine: Storage engine used by the table.
  • Local Table (Displayed only when the table engine is Distributed): Local table used to create a distributed table.
  • Distributed Parameters (Displayed only when the table engine is Distributed): Parameters of the distributed table.
  • Engine Parameters: Engine parameters for the selected table engine.
  • On Cluster: Cluster to which the current ClickHouse database belongs. The current table operation takes effect on all databases in the cluster. **Create Distributed Table** is selected by default, and the generated CREATE TABLE statement uses the Distributed engine.
  1. Click Save and click OK in the Submit window.

    tip

    You can copy the generated SQL script and run it in another database client if needed.

Result

NineData creates the ClickHouse table and keeps the generated SQL script available for review or reuse.

Next steps

  • Review the generated SQL script before you run the change in production.
  • Use SQL Console to query the new table and confirm that the structure matches your design.