dbeaver.DataSources_DbSchemaTable_constraint - V

type: V ( view ), modify_date: 2021-08-17 18:49:49

RepoObject_guid: 98BE898F-9381-EB11-84E9-A81E8446D5B0

Description

Examples

Entity Diagram

entity-dbeaver.datasources_dbschematable_constraint

Columns

Table 1. Columns of dbeaver.DataSources_DbSchemaTable_constraint - V
PK Column Name Data Type NULL? ID

varchar(max)

NULL

id

int

NOT NULL

int

NULL

key

nvarchar(4000)

NOT NULL

tinyint

NOT NULL

nvarchar(max)

NULL

nvarchar(4000)

NOT NULL

nvarchar(max)

NULL

nvarchar(max)

NULL

nvarchar(4000)

NOT NULL

nvarchar(4000)

NOT NULL

nvarchar(max)

NULL

nvarchar(500)

NULL

nvarchar(max)

NULL

nvarchar(max)

NULL

nvarchar(max)

NULL

nvarchar(max)

NULL

nvarchar(max)

NULL

Foreign Key Diagram

entity_1_1_fk-dbeaver.datasources_dbschematable_constraint

References

Object Reference Diagram - 1 1

entity_1_1_objectref-dbeaver.datasources_dbschematable_constraint

Object Reference Diagram - Referenced - 30 0

entity_30_0_objectref-dbeaver.datasources_dbschematable_constraint

Object Reference Diagram - Referencing - 0 30

entity_0_30_objectref-dbeaver.datasources_dbschematable_constraint

Column Reference Diagram

entity_1_1_colref-dbeaver.datasources_dbschematable_constraint

Column Details

_

BulkColumn

BulkColumn

varchar(max)

NULL

id

id

int

NOT NULL

is_json

is_json

int

NULL

key

key

nvarchar(4000)

NOT NULL

type

type

tinyint

NOT NULL

value

value

nvarchar(max)

NULL

VirtualModel_database

VirtualModel_database

nvarchar(4000)

NOT NULL

VirtualModel_database_json

VirtualModel_database_json

nvarchar(max)

NULL

VirtualModel_json

VirtualModel_json

nvarchar(max)

NULL

VirtualModel_key

VirtualModel_key

nvarchar(4000)

NOT NULL

VirtualModel_schema

VirtualModel_schema

nvarchar(4000)

NOT NULL

VirtualModel_schema_json

VirtualModel_schema_json

nvarchar(max)

NULL

VirtualModel_table

VirtualModel_table

nvarchar(500)

NULL

VirtualModel_table_constraint_attributes_json

VirtualModel_table_constraint_attributes_json

nvarchar(max)

NULL

VirtualModel_table_constraint_type

VirtualModel_table_constraint_type

nvarchar(max)

NULL

VirtualModel_table_constraints_json

VirtualModel_table_constraints_json

nvarchar(max)

NULL

VirtualModel_table_json

VirtualModel_table_json

nvarchar(max)

NULL

VirtualModels

VirtualModels

nvarchar(max)

NULL

sql_modules_definition

dbeaver.DataSources_DbSchemaTable_constraint - V script
CREATE View dbeaver.DataSources_DbSchemaTable_constraint
As
Select
    --
    t1.id
  , t1.BulkColumn
  , t1.is_json
  , t1.VirtualModels
  , t1.VirtualModel_key
  , t1.VirtualModel_json
  , t1.VirtualModel_database
  , t1.VirtualModel_database_json
  , t1.VirtualModel_schema
  , t1.VirtualModel_schema_json
  , t1.VirtualModel_table
  , t1.VirtualModel_table_json
  , t1.VirtualModel_table_constraints_json
  --,[VirtualModel_table_FK_json]
  --,[VirtualModel_table_properties_json]
  , j1.*
  , j2.*
From
    dbeaver.DataSources_DbSchemaTable                               As t1
    Cross Apply OpenJson ( t1.VirtualModel_table_constraints_json ) As j1
    Cross Apply
    OpenJson ( j1.Value )
    With
    (
        VirtualModel_table_constraint_type NVarchar ( Max ) N'$.type'
      , VirtualModel_table_constraint_attributes_json NVarchar ( Max ) N'$.attributes' As Json
    ) As j2