# Schema report

## Database's schemas list

Here is the list of database's schemas ( found)

List of schemas

Schema | Internal ?
--- | ---
| Internal No

## In the default schema

### Tables

select * from _tables where table_short_name != table_full_name AND table_type LIKE '%TABLE%'

#### table

select * from _columns WHERE table_name = ##direct_tables|@table_name::string AND table_schema = ##direct_tables|@table_schema::string ORDER BY ordinal_position

Column name | Type | Can be NULL | Default | Comments
--- | --- | --- | --- | ---
|  | Yes No |  |

select constraint_name, constraint_type, check_clause FROM _table_constraints WHERE table_name = ##direct_tables|@table_name::string AND table_schema = ##direct_tables|@table_schema::string AND constraint_type != 'FOREIGN KEY' ORDER BY constraint_type

- :

  SELECT k.column_name FROM _key_column_usage k WHERE table_name = ##direct_tables|@table_name::string AND table_schema = ##direct_tables|@table_schema::string AND constraint_name = ##constraints|@constraint_name ORDER BY ordinal_position

SELECT tc.constraint_name, r.ref_table_schema, r.ref_table_name, tc.constraint_type, r.update_rule, r.delete_rule FROM _table_constraints tc INNER JOIN _referential_constraints r ON (tc.table_schema=r.table_schema AND tc.table_name=r.table_name AND tc.constraint_name=r.constraint_name) WHERE tc.table_name = ##direct_tables|@table_name::string AND tc.table_schema = ##direct_tables|@table_schema::string AND constraint_type = 'FOREIGN KEY' ORDER BY constraint_type

- : => '.' select * from _detailed_fk WHERE fk_table_name = ##direct_tables|@table_name::string AND fk_table_schema = ##direct_tables|@table_schema::string AND fk_constraint_name = ##constraints|@constraint_name ORDER BY ordinal_position

  - =>

ON UPDATE:

ON DELETE:

### Views

SELECT v.table_name, v.table_schema, v.view_definition FROM _tables t INNER JOIN _views v ON (v.table_name = t.table_name AND v.table_schema = t.table_schema) WHERE table_short_name != table_full_name AND table_type LIKE 'VIEW'

- : select * from _columns WHERE table_name = ##direct_views|@table_name::string AND table_schema = ##direct_views|@table_schema::string ORDER BY ordinal_position

  Column name | Type | Comments
  --- | --- | ---