@dbml/connector 5.0.0 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -84,6 +84,13 @@
84
84
  "value": "This table stores information about various items."
85
85
  }
86
86
  },
87
+ {
88
+ "name": "table_with_composite_primary_and_unique_indexes",
89
+ "schemaName": "dbo",
90
+ "note": {
91
+ "value": ""
92
+ }
93
+ },
87
94
  {
88
95
  "name": "Authors",
89
96
  "schemaName": "dbo",
@@ -475,8 +482,8 @@
475
482
  {
476
483
  "name": "status",
477
484
  "type": {
478
- "type_name": "chk_status_status",
479
- "schemaName": "dbo"
485
+ "type_name": "varchar(20)",
486
+ "schemaName": null
480
487
  },
481
488
  "dbdefault": {
482
489
  "type": "string",
@@ -1162,7 +1169,7 @@
1162
1169
  },
1163
1170
  "dbdefault": {
1164
1171
  "type": "string",
1165
- "value": "<Books>\r\n <Book>\r\n <Title>The Great Gatsby</Title>\r\n <Author>F. Scott Fitzgerald</Author>\r\n <Year>1925</Year>\r\n <Price>10.99</Price>\r\n <Publisher>Scribner</Publisher>\r\n <Location>New York</Location>\r\n <Genre>Fiction</Genre>\r\n <Subgenre>Classic</Subgenre>\r\n </Book>\r\n <Book>\r\n <Title>1984</Title>\r\n <Author>George Orwell</Author>\r\n <Year>1949</Year>\r\n <Price>8.99</Price>\r\n <Publisher>Secker & Warburg</Publisher>\r\n <Location>London</Location>\r\n <Genre>Dystopian</Genre>\r\n <Subgenre>Political Fiction</Subgenre>\r\n </Book>\r\n </Books>"
1172
+ "value": "<Books>\n <Book>\n <Title>The Great Gatsby</Title>\n <Author>F. Scott Fitzgerald</Author>\n <Year>1925</Year>\n <Price>10.99</Price>\n <Publisher>Scribner</Publisher>\n <Location>New York</Location>\n <Genre>Fiction</Genre>\n <Subgenre>Classic</Subgenre>\n </Book>\n <Book>\n <Title>1984</Title>\n <Author>George Orwell</Author>\n <Year>1949</Year>\n <Price>8.99</Price>\n <Publisher>Secker & Warburg</Publisher>\n <Location>London</Location>\n <Genre>Dystopian</Genre>\n <Subgenre>Political Fiction</Subgenre>\n </Book>\n </Books>"
1166
1173
  },
1167
1174
  "not_null": false,
1168
1175
  "increment": false,
@@ -1296,8 +1303,8 @@
1296
1303
  {
1297
1304
  "name": "gender",
1298
1305
  "type": {
1299
- "type_name": "chk_gender_gender",
1300
- "schemaName": "dbo"
1306
+ "type_name": "nvarchar(10)",
1307
+ "schemaName": null
1301
1308
  },
1302
1309
  "dbdefault": null,
1303
1310
  "not_null": false,
@@ -1416,6 +1423,60 @@
1416
1423
  }
1417
1424
  }
1418
1425
  ],
1426
+ "dbo.table_with_composite_primary_and_unique_indexes": [
1427
+ {
1428
+ "name": "col1",
1429
+ "type": {
1430
+ "type_name": "int(10)",
1431
+ "schemaName": null
1432
+ },
1433
+ "dbdefault": null,
1434
+ "not_null": true,
1435
+ "increment": false,
1436
+ "note": {
1437
+ "value": ""
1438
+ }
1439
+ },
1440
+ {
1441
+ "name": "col2",
1442
+ "type": {
1443
+ "type_name": "int(10)",
1444
+ "schemaName": null
1445
+ },
1446
+ "dbdefault": null,
1447
+ "not_null": true,
1448
+ "increment": false,
1449
+ "note": {
1450
+ "value": ""
1451
+ }
1452
+ },
1453
+ {
1454
+ "name": "col3",
1455
+ "type": {
1456
+ "type_name": "int(10)",
1457
+ "schemaName": null
1458
+ },
1459
+ "dbdefault": null,
1460
+ "not_null": false,
1461
+ "increment": false,
1462
+ "note": {
1463
+ "value": ""
1464
+ }
1465
+ },
1466
+ {
1467
+ "name": "col4",
1468
+ "type": {
1469
+ "type_name": "int(10)",
1470
+ "schemaName": null
1471
+ },
1472
+ "dbdefault": null,
1473
+ "not_null": false,
1474
+ "increment": false,
1475
+ "note": {
1476
+ "value": ""
1477
+ }
1478
+ }
1479
+ ],
1419
1480
  "dbo.Authors": [
1420
1481
  {
1421
1482
  "name": "AuthorID",
@@ -1541,8 +1602,8 @@
1541
1602
  {
1542
1603
  "name": "AddressID",
1543
1604
  "type": {
1544
- "type_name": "CK_Address_Valid_AddressID_AddressFormatID",
1545
- "schemaName": "dbo"
1605
+ "type_name": "uniqueidentifier(16)",
1606
+ "schemaName": null
1546
1607
  },
1547
1608
  "dbdefault": null,
1548
1609
  "not_null": true,
@@ -1554,8 +1615,8 @@
1554
1615
  {
1555
1616
  "name": "AddressFormatID",
1556
1617
  "type": {
1557
- "type_name": "CK_Address_Valid_AddressID_AddressFormatID",
1558
- "schemaName": "dbo"
1618
+ "type_name": "uniqueidentifier(16)",
1619
+ "schemaName": null
1559
1620
  },
1560
1621
  "dbdefault": null,
1561
1622
  "not_null": true,
@@ -1569,8 +1630,8 @@
1569
1630
  {
1570
1631
  "name": "A1",
1571
1632
  "type": {
1572
- "type_name": "CK_Address_Valid2_A1",
1573
- "schemaName": "dbo"
1633
+ "type_name": "uniqueidentifier(16)",
1634
+ "schemaName": null
1574
1635
  },
1575
1636
  "dbdefault": null,
1576
1637
  "not_null": true,
@@ -1582,8 +1643,8 @@
1582
1643
  {
1583
1644
  "name": "A2",
1584
1645
  "type": {
1585
- "type_name": "CK_Address_Valid2_A2_A3",
1586
- "schemaName": "dbo"
1646
+ "type_name": "uniqueidentifier(16)",
1647
+ "schemaName": null
1587
1648
  },
1588
1649
  "dbdefault": null,
1589
1650
  "not_null": true,
@@ -1595,8 +1656,8 @@
1595
1656
  {
1596
1657
  "name": "A3",
1597
1658
  "type": {
1598
- "type_name": "CK_Address_Valid2_A2_A3",
1599
- "schemaName": "dbo"
1659
+ "type_name": "uniqueidentifier(16)",
1660
+ "schemaName": null
1600
1661
  },
1601
1662
  "dbdefault": null,
1602
1663
  "not_null": true,
@@ -1608,8 +1669,8 @@
1608
1669
  {
1609
1670
  "name": "A4",
1610
1671
  "type": {
1611
- "type_name": "CK_Address_Valid2_A4",
1612
- "schemaName": "dbo"
1672
+ "type_name": "uniqueidentifier(16)",
1673
+ "schemaName": null
1613
1674
  },
1614
1675
  "dbdefault": null,
1615
1676
  "not_null": true,
@@ -1648,95 +1709,7 @@
1648
1709
  }
1649
1710
  ]
1650
1711
  },
1651
- "enums": [
1652
- {
1653
- "name": "chk_status_status",
1654
- "schemaName": "dbo",
1655
- "values": [
1656
- {
1657
- "name": "cancelled"
1658
- },
1659
- {
1660
- "name": "delivered"
1661
- },
1662
- {
1663
- "name": "shipped"
1664
- },
1665
- {
1666
- "name": "processing"
1667
- },
1668
- {
1669
- "name": "pending"
1670
- }
1671
- ]
1672
- },
1673
- {
1674
- "name": "chk_gender_gender",
1675
- "schemaName": "dbo",
1676
- "values": [
1677
- {
1678
- "name": "Other"
1679
- },
1680
- {
1681
- "name": "Female"
1682
- },
1683
- {
1684
- "name": "Male"
1685
- }
1686
- ]
1687
- },
1688
- {
1689
- "name": "CK_Address_Valid_AddressID_AddressFormatID",
1690
- "schemaName": "dbo",
1691
- "values": [
1692
- {
1693
- "name": "176029FA-D6D3-49E1-A48C-000000000002"
1694
- },
1695
- {
1696
- "name": "176029FA-D6D3-49E1-A48C-000000000001"
1697
- }
1698
- ]
1699
- },
1700
- {
1701
- "name": "CK_Address_Valid2_A1",
1702
- "schemaName": "dbo",
1703
- "values": [
1704
- {
1705
- "name": "333"
1706
- },
1707
- {
1708
- "name": "2222"
1709
- },
1710
- {
1711
- "name": "1111"
1712
- }
1713
- ]
1714
- },
1715
- {
1716
- "name": "CK_Address_Valid2_A2_A3",
1717
- "schemaName": "dbo",
1718
- "values": [
1719
- {
1720
- "name": "2222"
1721
- },
1722
- {
1723
- "name": "1111"
1724
- }
1725
- ]
1726
- },
1727
- {
1728
- "name": "CK_Address_Valid2_A4",
1729
- "schemaName": "dbo",
1730
- "values": [
1731
- {
1732
- "name": "3333"
1733
- },
1734
- {
1735
- "name": "2222"
1736
- }
1737
- ]
1738
- }
1739
- ],
1712
+ "enums": [],
1740
1713
  "refs": [
1741
1714
  {
1742
1715
  "name": "FK_AuthorNationality",
@@ -1870,7 +1843,9 @@
1870
1843
  "type": "column",
1871
1844
  "value": "product_id"
1872
1845
  }
1873
- ]
1846
+ ],
1847
+ "pk": false,
1848
+ "unique": false
1874
1849
  }
1875
1850
  ],
1876
1851
  "dbo.orders": [
@@ -1886,7 +1861,9 @@
1886
1861
  "type": "column",
1887
1862
  "value": "order_date"
1888
1863
  }
1889
- ]
1864
+ ],
1865
+ "pk": false,
1866
+ "unique": false
1890
1867
  }
1891
1868
  ],
1892
1869
  "dbo.products": [
@@ -1898,7 +1875,9 @@
1898
1875
  "type": "column",
1899
1876
  "value": "category"
1900
1877
  }
1901
- ]
1878
+ ],
1879
+ "pk": false,
1880
+ "unique": false
1902
1881
  }
1903
1882
  ],
1904
1883
  "dbo.users": [
@@ -1910,7 +1889,9 @@
1910
1889
  "type": "column",
1911
1890
  "value": "email"
1912
1891
  }
1913
- ]
1892
+ ],
1893
+ "pk": false,
1894
+ "unique": false
1914
1895
  },
1915
1896
  {
1916
1897
  "name": "idx_users_full_name",
@@ -1920,7 +1901,9 @@
1920
1901
  "type": "column",
1921
1902
  "value": "full_name"
1922
1903
  }
1923
- ]
1904
+ ],
1905
+ "pk": false,
1906
+ "unique": false
1924
1907
  },
1925
1908
  {
1926
1909
  "name": "idx_users_is_active_full_name",
@@ -1934,107 +1917,249 @@
1934
1917
  "type": "column",
1935
1918
  "value": "full_name_lower"
1936
1919
  }
1937
- ]
1920
+ ],
1921
+ "pk": false,
1922
+ "unique": false
1938
1923
  }
1939
1924
  ]
1940
1925
  },
1941
1926
  "tableConstraints": {
1942
1927
  "dbo.Authors": {
1943
1928
  "AuthorID": {
1929
+ "checks": [],
1944
1930
  "pk": true
1945
1931
  },
1946
1932
  "NationalityID": {
1933
+ "checks": [],
1947
1934
  "pk": true
1948
1935
  },
1949
1936
  "AuthorName": {
1937
+ "checks": [],
1950
1938
  "unique": true
1951
1939
  },
1952
1940
  "BirthYear": {
1941
+ "checks": [],
1953
1942
  "unique": true
1954
1943
  }
1955
1944
  },
1956
1945
  "dbo.Books": {
1957
1946
  "BookID": {
1947
+ "checks": [],
1958
1948
  "pk": true
1959
1949
  },
1960
1950
  "AuthorID": {
1951
+ "checks": [],
1961
1952
  "pk": true
1962
1953
  },
1963
1954
  "ISBN": {
1955
+ "checks": [],
1964
1956
  "unique": true
1965
1957
  }
1966
1958
  },
1967
1959
  "dbo.DatetimeTypes": {
1968
1960
  "ID": {
1961
+ "checks": [],
1969
1962
  "pk": true
1970
1963
  }
1971
1964
  },
1972
1965
  "dbo.gender_reference": {
1973
1966
  "value": {
1967
+ "checks": [],
1974
1968
  "pk": true
1975
1969
  }
1976
1970
  },
1977
1971
  "dbo.NumberTypes": {
1978
1972
  "ID": {
1973
+ "checks": [],
1979
1974
  "pk": true
1980
1975
  }
1981
1976
  },
1982
1977
  "dbo.NumberTypesNoDefault": {
1983
1978
  "ID": {
1979
+ "checks": [],
1984
1980
  "pk": true
1985
1981
  }
1986
1982
  },
1987
1983
  "dbo.ObjectTypes": {
1988
1984
  "Id": {
1985
+ "checks": [],
1989
1986
  "pk": true
1990
1987
  }
1991
1988
  },
1992
1989
  "dbo.order_items": {
1993
1990
  "order_item_id": {
1991
+ "checks": [],
1994
1992
  "pk": true
1995
1993
  },
1996
1994
  "order_id": {
1995
+ "checks": [],
1997
1996
  "unique": true
1998
1997
  },
1999
1998
  "product_id": {
1999
+ "checks": [],
2000
2000
  "unique": true
2001
+ },
2002
+ "quantity": {
2003
+ "checks": [
2004
+ {
2005
+ "name": "chk_quantity_positive",
2006
+ "expression": "[quantity]>(0)"
2007
+ }
2008
+ ]
2009
+ },
2010
+ "unit_price": {
2011
+ "checks": [
2012
+ {
2013
+ "name": "chk_unit_price_positive",
2014
+ "expression": "[unit_price]>(0)"
2015
+ }
2016
+ ]
2001
2017
  }
2002
2018
  },
2003
2019
  "dbo.orders": {
2004
2020
  "order_id": {
2021
+ "checks": [],
2005
2022
  "pk": true
2023
+ },
2024
+ "total_amount": {
2025
+ "checks": [
2026
+ {
2027
+ "name": "chk_total_amount_positive",
2028
+ "expression": "[total_amount]>(0)"
2029
+ }
2030
+ ]
2031
+ },
2032
+ "status": {
2033
+ "checks": [
2034
+ {
2035
+ "name": "chk_status",
2036
+ "expression": "[status]='cancelled' OR [status]='delivered' OR [status]='shipped' OR [status]='processing' OR [status]='pending'"
2037
+ }
2038
+ ]
2006
2039
  }
2007
2040
  },
2008
2041
  "dbo.products": {
2009
2042
  "product_id": {
2043
+ "checks": [],
2010
2044
  "pk": true
2045
+ },
2046
+ "price": {
2047
+ "checks": [
2048
+ {
2049
+ "name": "chk_price_positive",
2050
+ "expression": "[price]>(0)"
2051
+ }
2052
+ ]
2053
+ },
2054
+ "stock_quantity": {
2055
+ "checks": [
2056
+ {
2057
+ "name": "chk_stock_non_negative",
2058
+ "expression": "[stock_quantity]>=(0)"
2059
+ }
2060
+ ]
2011
2061
  }
2012
2062
  },
2013
2063
  "dbo.StringTypes": {
2014
2064
  "Id": {
2065
+ "checks": [],
2015
2066
  "pk": true
2016
2067
  }
2017
2068
  },
2018
2069
  "dbo.table_with_comments": {
2019
2070
  "id": {
2071
+ "checks": [],
2020
2072
  "pk": true
2021
2073
  }
2022
2074
  },
2075
+ "dbo.table_with_composite_primary_and_unique_indexes": {
2076
+ "col1": {
2077
+ "checks": [],
2078
+ "pk": true
2079
+ },
2080
+ "col2": {
2081
+ "checks": [],
2082
+ "pk": true
2083
+ },
2084
+ "col3": {
2085
+ "checks": [],
2086
+ "unique": true
2087
+ },
2088
+ "col4": {
2089
+ "checks": [],
2090
+ "unique": true
2091
+ }
2092
+ },
2023
2093
  "dbo.user_define_data_types": {
2024
2094
  "id": {
2095
+ "checks": [],
2025
2096
  "pk": true
2097
+ },
2098
+ "gender": {
2099
+ "checks": [
2100
+ {
2101
+ "name": "chk_gender",
2102
+ "expression": "[gender]='Other' OR [gender]='Female' OR [gender]='Male'"
2103
+ }
2104
+ ]
2026
2105
  }
2027
2106
  },
2028
2107
  "dbo.users": {
2029
2108
  "user_id": {
2109
+ "checks": [],
2030
2110
  "pk": true
2031
2111
  },
2032
2112
  "email": {
2113
+ "checks": [
2114
+ {
2115
+ "name": "chk_email_format",
2116
+ "expression": "[email] like '%_@_%._%'"
2117
+ }
2118
+ ],
2033
2119
  "unique": true
2034
2120
  },
2035
2121
  "username": {
2122
+ "checks": [],
2036
2123
  "unique": true
2124
+ },
2125
+ "date_of_birth": {
2126
+ "checks": [
2127
+ {
2128
+ "name": "chk_age",
2129
+ "expression": "[date_of_birth]<=dateadd(year,(-13),getdate())"
2130
+ }
2131
+ ]
2132
+ }
2133
+ },
2134
+ "dbo.TestDescriptionTable": {
2135
+ "Name": {
2136
+ "checks": [
2137
+ {
2138
+ "name": "chk_name_len",
2139
+ "expression": "len([Name])>(6)"
2140
+ }
2141
+ ]
2037
2142
  }
2038
2143
  }
2144
+ },
2145
+ "checks": {
2146
+ "dbo.user_define_data_types": [
2147
+ {
2148
+ "name": "chk_age_range",
2149
+ "expression": "[age_start]<=[age_end]"
2150
+ }
2151
+ ],
2152
+ "dbo.AddressInfo": [
2153
+ {
2154
+ "name": "CK_Address_Valid",
2155
+ "expression": "([AddressID]='176029FA-D6D3-49E1-A48C-000000000002' OR [AddressID]='176029FA-D6D3-49E1-A48C-000000000001') AND ([AddressFormatID]='176029FA-D6D3-49E1-A48C-000000000002' OR [AddressFormatID]='176029FA-D6D3-49E1-A48C-000000000001')"
2156
+ }
2157
+ ],
2158
+ "dbo.AddressInfo2": [
2159
+ {
2160
+ "name": "CK_Address_Valid2",
2161
+ "expression": "([A1]='333' OR [A1]='2222' OR [A1]='1111') AND ([A2]='2222' OR [A2]='1111') AND ([A3]='1111' OR [A3]='2222') AND ([A4]='3333' OR [A4]='2222')"
2162
+ }
2163
+ ]
2039
2164
  }
2040
- }
2165
+ }