Skip to main content

SQL Development Policies Overview

NineData provides SQL development policies to facilitate secure control in scenarios involving collaborative development among multiple individuals in an enterprise, ensuring the security of the enterprise database. This article presents an overview of the currently supported SQL development policies and the types of data sources supported by the policies.

CategoryPolicy NameMySQLSQL
Server
Postgre
SQL
OracleOB
Oracle
DB2Mongo
DB
RedisDorisSelectDBDAMENGDWSTiDBGreatSQLAnalyticDB
PostgreSQL
GBaseTDSQL
MySQL
Oceanbase
MySQL
GoldenDBMariaDBVastbaseGaussDBopenGaussElastiCachePegaDB
Column**Restrict Auto-Increment column is named 'ID'**✔️✔️✔️✔️✔️✔️✔️✔️
**Restrict Auto-Increment columns to be unsigned**✔️✔️✔️✔️✔️✔️✔️
**Limit Length for CHAR**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Restrict Field Name Case**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Field name cannot be keyword**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Columns must have comments**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Column must have default value**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Restrict Column should NOT NULL**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Restrict column from using certain data types.**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Cannot set character set for the column**✔️✔️✔️✔️✔️✔️✔️
**Cannot set Column Collate explicitly**✔️✔️✔️✔️✔️✔️✔️✔️
**Limit Length for VARCHAR**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Length limit when Shardkey is 'char' or 'varchar' type**✔️
**ShardKey field type**✔️✔️
**It is not recommended to index a VARCHAR field whose length is greater than the threshold.**✔️
**Column risk operation control**✔️✔️✔️✔️✔️
Table(DDL)**Limit Number of Fields**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Suggested to use "ALTER TABLE CONVERT" to alter the character set**✔️✔️✔️✔️✔️✔️✔️
**Restrict Table Character Set**✔️✔️✔️✔️✔️✔️✔️
**Restrict Table Validation Rules**✔️✔️✔️✔️✔️✔️✔️
**Restrict Table Name Case**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Table names cannot be keywords.**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Table should have comments**✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Table must have PRIMARY KEY**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Restrict table not allowed use FOREIGN KEY**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**OnlineDDL: Risk detection of large table schema change**✔️✔️✔️
**Table needs to include certain columns**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Restrict table storage engine**✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Limit the initial value for Auto-Increment in table creation**✔️✔️✔️✔️✔️✔️✔️✔️
**Combine multiple ALTER statements for the same table.**✔️✔️✔️✔️✔️✔️✔️
Database**Restrict Database Character Set **✔️✔️✔️✔️✔️✔️✔️
Update**UPDATE/DELETE statements should have WHERE clause specified.**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**UPDATE/DELETE statement cannot include an ORDER BY clause**✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Check whether the columns specified in SET have table prefixes when updating multiple tables.**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Avoid updating 'create_time' column in UPDATE statement**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Check if PRIMARY KEY is updated in UPDATE statement**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Recommend updating 'create_time' column in UPDATE statement**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Check the separator between multiple columns in the SET clause of the UPDATE statement. ( AND Illegal character)**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Checking table/fields existence in UPDATE statement**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Check if UK is updated in UPDATE statement**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**UPDATE/DELETE Must Use Index**✔️✔️✔️✔️✔️✔️✔️
**Limit UPDATE/DELETE statement's total affected rows**✔️✔️✔️✔️✔️✔️✔️✔️
**OnlineDML: Risk detection of large-scale data changes**✔️✔️✔️
**UPDATE cannot update the shardkey on the table**✔️✔️
Object**Field disabled zerofill attribute**✔️✔️✔️✔️✔️✔️✔️
**NOT Allowed EVENT Operation**✔️✔️✔️✔️✔️✔️✔️
**NOT Allowed customize FUNCTION Operation**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**NOT Allowed PROCEDURE Operation**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**NOT Allowed TRIGGER Operation**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**NOT Allowed VIEW operation**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
Index**Limit Table INDEX Number**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**INDEX name is required**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Restrict NORMAL INDEX Name Format**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**PRIMARY KEY requires Auto_Increment**✔️✔️✔️✔️✔️✔️✔️✔️
**Restrict the number of columns the primary key contains**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Restrict PRIMARY KEY Column Types**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Limit the number of columns included in a single index**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Restrict UNIQUE INDEX Name Format**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Index name cannot be duplication**✔️✔️✔️✔️✔️✔️✔️
**The corresponding field of Shardkey must be in the primary key or unique key**✔️✔️
**Check for syntax conflicts in DDL statements**✔️
Write**Column name cannot be repeated in the INSERT statement**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**The fields and values must match in the INSERT statement.**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**INSERT statements should specify a list of INSERT columns**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**INSERT statement cannot insert NULL values into NOT NULL columns.**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Not recommended to use SYSDATE() in INSERT statements**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Restrict the total number of rows for a single INSERT VALUES statement**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Checking table/fields existence in INSERT statement**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**INSERT/REPLACE must specify shardkey**✔️✔️
**Shardkey cannot be written in Chinese**✔️
Query(DQL)**Not recommended to use the GROUP BY clause on constants in a SELECT statement**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Limit the number of table joins in a SELECT statement**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Recommended to include a WHERE condition in SELECT statements**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Limit the size of the OFFSET in a LIMIT clause in a SELECT statement**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Not recommended to use GROUP BY or ORDER BY on different tables in a SELECT statement**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Not recommended to use ORDER BY with constants in SELECT statements.**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Not recommended to use different sorting directions for ORDER BY with multiple fields in SELECT statements**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Not recommended to use ORDER BY RAND() in SELECT statements**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Not recommended to use HAVING in SELECT statements**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Not recommended to use UNION in SELECT statements**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Limit the number of elements in the IN clause in the WHERE condition**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Not recommended to use a leading wildcard in the 'WHERE' condition for searching**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Not recommended to include mathematical or functional operations on indexed fields in the 'WHERE' condition**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Not recommended to use reverse queries (NOT IN / NOT LIKE) in the 'WHERE' condition**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Check for 'LIKE' statements without wildcards in the 'WHERE' condition**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**The SELECT statement is not recommended to use GROUP BY or ORDER BY expressions or functions.**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Avoid using SELECT ***✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
** SELECT statement not suggest multiple sub query **✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**SELECT Must Use Index**✔️✔️✔️✔️✔️✔️✔️
**Do not use non-sharding keys to join sharded tables**✔️✔️
**It is recommended to include shard key in the WHERE condition**✔️✔️
Query/Modify**Check for implicit type conversions in the WHERE clause.**✔️✔️✔️✔️✔️✔️✔️✔️
**Check if filtering conditions in the WHERE clause are connected using the OR operator.**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
Table(DML)**Check if WHERE conditions in UPDATE/DELETE statements contain subqueries**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Limit the data size for UPDATE/DELETE statements**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Verify JOIN syntax completeness (missing ON clause) in UPDATE/DELETE statements**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
**Limit the number of table joins in a UPDATE/DELETE statement**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
Query(DML)**Mathematical and functional operations are prohibited on the partition key of the WHERE condition.**✔️✔️
-**SQL type risk management**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️
DELETE**DELETE statement to detect whether the table exists**✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️✔️