|
| 1 | +````sql |
| 2 | +/* |
| 3 | + { "name": "table" } |
| 4 | +*/ |
| 5 | +select "@schema" /* { "label": "owner", "description": "Owner of the table", "visible": true } */ |
| 6 | + , "@table" /* { "label": "table name", "description": "Name of the table", "visible": true } */ |
| 7 | + , remarks properties |
| 8 | + , last_modification /* { "label": "last modification", "description": "Last modification" } */ |
| 9 | + , table_type /* { "label": "table type", "description": "Typical types", "visible": true, "values": ['TABLE', 'VIEW', 'SYSTEM TABLE', 'GLOBAL TEMPORARY', 'LOCAL TEMPORARY', 'ALIAS', 'SYNONYM'] } */ |
| 10 | + from (select t.table_schema as "@schema" |
| 11 | + , t.table_name as "@table" |
| 12 | + , t.* |
| 13 | + from information_schema.tables t |
| 14 | + where lower(t.table_schema) like lower('${uri.path(0)}') |
| 15 | + and lower(t.table_name) like lower('${uri.path(1)}')) |
| 16 | +order by "@schema", "@table" |
| 17 | +```` |
| 18 | + |
| 19 | +````sql |
| 20 | +/* |
| 21 | + { "name": "column" } |
| 22 | +*/ |
| 23 | +select "@schema" /* { "label": "owner", "description": "Owner of the table", "visible": true } */ |
| 24 | + , "@table" /* { "label": "table name", "description": "Name of the table", "visible": true } */ |
| 25 | + , "@column" /* { "label": "column name", "description": "Name of the column", "visible": true } */ |
| 26 | + , type_name /* { "label": "type name", "description": "Data source dependent type name, for a UDT the type name is fully qualified", "visible": true } */ |
| 27 | + , character_maximum_length /* { "label": "size", "description": "Column size", "visible": true } */ |
| 28 | + , nullable /* { "label": "nullable", "description": "Is NULL allowed", "visible": true } */ |
| 29 | + , column_default /* { "label": "default value", "description": "Default value for the column, which should be interpreted as a string when the value is enclosed in single quotes (may be null)" } */ |
| 30 | + from (select c.table_schema as "@schema" |
| 31 | + , c.table_name as "@table" |
| 32 | + , c.column_name as "@column" |
| 33 | + , c.* |
| 34 | + from information_schema.columns c) |
| 35 | +```` |
| 36 | + |
| 37 | +````sql |
| 38 | +/* |
| 39 | + { "name": "pk" } |
| 40 | +*/ |
| 41 | + select "@schema" /* { "label": "owner", "description": "Owner of the table", "visible": true } */ |
| 42 | + , "@table" /* { "label": "table name", "description": "Name of the table", "visible": true } */ |
| 43 | + , "@pk" /* { "label": "pk", "description": "Primary key name", "visible": true } */ |
| 44 | + , COLUMN_LIST |
| 45 | + , REMARKS |
| 46 | + , CHECK_EXPRESSION |
| 47 | + from (select c.table_schema as "@schema" |
| 48 | + , c.table_name as "@table" |
| 49 | + , c.constraint_name as "@pk" |
| 50 | + , c.* |
| 51 | + from information_schema.constraints c) |
| 52 | +```` |
| 53 | + |
| 54 | +````sql |
| 55 | +/* |
| 56 | + { "name": "index" } |
| 57 | +*/ |
| 58 | +select "@schema" /* { "label": "owner", "description": "Owner of the table", "visible": true } */ |
| 59 | + , "@table" /* { "label": "table name", "description": "Name of the table", "visible": true } */ |
| 60 | + , "@index" /* { "label": "index name", "description": "Name of the index", "visible": true } */ |
| 61 | + , ORDINAL_POSITION |
| 62 | + , COLUMN_NAME |
| 63 | + , CARDINALITY |
| 64 | + , PRIMARY_KEY |
| 65 | + , INDEX_TYPE_NAME |
| 66 | + , IS_GENERATED |
| 67 | + , INDEX_TYPE |
| 68 | + , ASC_OR_DESC |
| 69 | + , PAGES |
| 70 | + , FILTER_CONDITION |
| 71 | + , REMARKS |
| 72 | + , SQL |
| 73 | + , ID |
| 74 | + , SORT_TYPE |
| 75 | + , CONSTRAINT_NAME |
| 76 | + , INDEX_CLASS |
| 77 | + , AFFINITY |
| 78 | + from (select TABLE_SCHEMA as "@schema" |
| 79 | + , TABLE_NAME as "@table" |
| 80 | + , INDEX_NAME as "@index" |
| 81 | + , i.* |
| 82 | + from information_schema.indexes i) |
| 83 | +```` |
0 commit comments