Skip to main content

Manage SQL development policies

NineData provides default SQL development policies for development and production environments. Use these policies to enforce SQL review rules, control risky operations, and apply different standards to environments or individual data sources.

Important notes

  • Newly created policies must be based on existing policies.
  • The default policies provided by the system cannot be deleted but can be edited.
  • In the DevOps Pro edition, creating policies is not supported, while DevOps Enterprise edition has no such limitation.

Prerequisites

  • You have created or joined an organization, and this organization has subscribed to either DevOps Pro or DevOps Enterprise. Please ensure that your annual or monthly subscription is still active. For more information, please refer to Manage Organizations.
  • Your current account has switched to the target organization. For more information, please refer to Switching to an Organization.
  • You have the role of system administrator in the organization.

Create a policy

  1. Log in to the NineData Console.

  2. In the left navigation pane, click DevOps > Policy & Process.

  3. On the Policy & Process page, click the SQL Dev Policy tab, and then click Create Policy in the upper-right corner.

    tip

    You can also click Duplicate in the Actions column on the right of the target policy to create a new policy based on it.

  4. In the Create Policy dialog box that appears, configure the following parameters and click OK.

    • Duplicate Policy: Select the policy on which to base the new policy.

      tip

      If you arrived at this dialog box by clicking Duplicate, this has already been selected by default.

    • Name: Enter a meaningful name for the new policy. The name must be 1 to 32 characters.

      tip

      If you arrived at this dialog box by clicking Duplicate, this has already been filled in by default.

    • Description (optional): Enter a description for the new policy, which can be between 1 and 64 characters.

  5. The console automatically jumps to the Details page, where you can edit and switch the target rules.

    tip

    SQL development rules are grouped by module. Use the category tabs to switch between rule groups.

:::

Edit a policy

  1. Log in to the NineData Console.

  2. In the left navigation pane, click DevOps > Policy & Process.
  3. On the Policy & Process page, click the SQL Dev Policy tab, and then click the target Name.
  4. The console will navigate to the Details page, where you can edit and toggle the target policy.

Delete a policy

  1. Log in to the NineData Console.

  2. In the left navigation pane, click DevOps > Policy & Process.

  3. On the Policy & Process page, click the SQL Dev Policy tab.

  4. Click the policy you want to delete, and then click the Delete button in the upper right corner of the Details page.

    tip

    You can also click the Delete button in the Actions column on the right side of the target policy.

  5. In the confirmation window that appears, click Delete.

    tip

    If the current policy is already associated with an environment or data source, you need to select a new process for these resources in the Associated Envir. and datasources existed, Please modify first. window that pops up, and then click Modify and Delete.

Associate a policy with an environment

After you associate a SQL development policy with an environment, the new policy replaces the previous environment policy. All data sources in that environment use the new policy.

  1. Log in to the NineData Console.

  2. In the left navigation pane, click DevOps > Policy & Process.
  3. On the Envir. Config tab, find the name of the target environment, and click the Edit button in the Actions column on the right side.
  4. In the Edit Envir. Config window that pops up, select the SQL Dev Policy you need, and click OK.

Associate a policy with a data source

After you associate a SQL development policy with a data source, that data source uses the selected policy instead of the policy inherited from its environment. Other data sources in the same environment are not affected.

  1. Log in to the NineData Console.

  2. In the left navigation bar, click DevOps > Policy & Process.

  3. Click the Datasource Config tab, find the target data source name, and click Edit on the right of the Actions column.

    tip

    In the SQL Dev Policy associated with the data source, the bind icon on the left indicates that SQL Dev Policy has inherited the configuration in the environment.

  4. In the popup window of Edit Datasource Config,

  5. Clear the checkbox on the left of Inheriting Envir. Config under SQL Dev Policy, select the policy you need, and click OK.

    tip

    To restore the SQL Dev Policy configured in the environment, simply reselect Inheriting Envir. Config.

Appendix: Conceptual explanation

When configuring SQL development policy, you can edit each policy. Here, we explain two important configuration items.

Configuration Item
Explanation
LevelsIn terms of Must Modify and Suggested, you can adjust the level of each rule based on actual business requirements.
  • Must Modify: This is the highest level of SQL issues. Apply this level to SQL rules that could have a severe impact on the database. Ensure that developers address and fix such issues.
  • Suggested: Typically applicable to more lenient specifications. You can choose whether to comply based on the actual situation. Non-compliance with these rules may result in SQL statements that are difficult to maintain or have low execution efficiency.
DB TypeLists all database types supported by the policy. Select one or more database types that the policy applies to.

Result

The selected SQL development policy takes effect at the configured scope. Environment-level policies apply to all data sources in the environment, while data source policies override the inherited environment policy only for that data source.

Next steps

  • Review the policy rules before applying them to production data sources.
  • Assign approval processes in Manage approval processes so SQL tasks follow the expected workflow.