mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-06-01 12:50:40 +00:00
* feat: impl table_constraints table for information_schema * test: update information_schema sqlness test * test: adds table_constraints sqlness test
59 lines
3.4 KiB
Plaintext
59 lines
3.4 KiB
Plaintext
--- test information_schema.table_constraints ----
|
|
USE INFORMATION_SCHEMA;
|
|
|
|
Affected Rows: 0
|
|
|
|
DESC TABLE TABLE_CONSTRAINTS;
|
|
|
|
+--------------------+--------+-----+------+---------+---------------+
|
|
| Column | Type | Key | Null | Default | Semantic Type |
|
|
+--------------------+--------+-----+------+---------+---------------+
|
|
| constraint_catalog | String | | NO | | FIELD |
|
|
| constraint_schema | String | | NO | | FIELD |
|
|
| constraint_name | String | | NO | | FIELD |
|
|
| table_schema | String | | NO | | FIELD |
|
|
| table_name | String | | NO | | FIELD |
|
|
| constraint_type | String | | NO | | FIELD |
|
|
| enforced | String | | NO | | FIELD |
|
|
+--------------------+--------+-----+------+---------+---------------+
|
|
|
|
SELECT * FROM TABLE_CONSTRAINTS ORDER BY TABLE_NAME, CONSTRAINT_NAME;
|
|
|
|
+--------------------+-------------------+-----------------+--------------+------------+-----------------+----------+
|
|
| constraint_catalog | constraint_schema | constraint_name | table_schema | table_name | constraint_type | enforced |
|
|
+--------------------+-------------------+-----------------+--------------+------------+-----------------+----------+
|
|
| def | public | PRIMARY | public | numbers | PRIMARY KEY | YES |
|
|
+--------------------+-------------------+-----------------+--------------+------------+-----------------+----------+
|
|
|
|
CREATE TABLE test(i double, j string, ts timestamp time index, primary key(j));
|
|
|
|
Affected Rows: 0
|
|
|
|
SELECT * FROM TABLE_CONSTRAINTS ORDER BY TABLE_NAME, CONSTRAINT_NAME;
|
|
|
|
+--------------------+--------------------+-----------------+--------------------+------------+-----------------+----------+
|
|
| constraint_catalog | constraint_schema | constraint_name | table_schema | table_name | constraint_type | enforced |
|
|
+--------------------+--------------------+-----------------+--------------------+------------+-----------------+----------+
|
|
| def | public | PRIMARY | public | numbers | PRIMARY KEY | YES |
|
|
| def | information_schema | PRIMARY | information_schema | test | PRIMARY KEY | YES |
|
|
| def | information_schema | TIME INDEX | information_schema | test | TIME INDEX | YES |
|
|
+--------------------+--------------------+-----------------+--------------------+------------+-----------------+----------+
|
|
|
|
SELECT * FROM TABLE_CONSTRAINTS WHERE TABLE_NAME = 'test' ORDER BY TABLE_NAME, CONSTRAINT_NAME;
|
|
|
|
+--------------------+--------------------+-----------------+--------------------+------------+-----------------+----------+
|
|
| constraint_catalog | constraint_schema | constraint_name | table_schema | table_name | constraint_type | enforced |
|
|
+--------------------+--------------------+-----------------+--------------------+------------+-----------------+----------+
|
|
| def | information_schema | PRIMARY | information_schema | test | PRIMARY KEY | YES |
|
|
| def | information_schema | TIME INDEX | information_schema | test | TIME INDEX | YES |
|
|
+--------------------+--------------------+-----------------+--------------------+------------+-----------------+----------+
|
|
|
|
DROP TABLE test;
|
|
|
|
Affected Rows: 0
|
|
|
|
USE public;
|
|
|
|
Affected Rows: 0
|
|
|