@dbml/connector 5.1.0 → 5.3.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.
Files changed (58) hide show
  1. package/__tests__/connector.test.ts +1 -1
  2. package/__tests__/connectors/mssql/expect-out-files/schema.json +98 -7
  3. package/__tests__/connectors/mssql/out-files/schema.json +2165 -0
  4. package/__tests__/connectors/mysql/expect-out-files/schema.json +99 -9
  5. package/__tests__/connectors/mysql/out-files/schema.json +1520 -0
  6. package/__tests__/connectors/oracle/connection.json +4 -0
  7. package/__tests__/connectors/oracle/expect-out-files/schema.json +3866 -0
  8. package/__tests__/connectors/oracle/out-files/schema.json +3866 -0
  9. package/__tests__/connectors/postgres/expect-out-files/schema.json +119 -8
  10. package/__tests__/connectors/postgres/out-files/schema.json +1830 -0
  11. package/dist/connectors/{bigqueryConnector.d.ts → bigquery/index.d.ts} +1 -1
  12. package/dist/connectors/{bigqueryConnector.js → bigquery/index.js} +3 -4
  13. package/dist/connectors/connector.js +13 -10
  14. package/dist/connectors/{snowflakeConnector.d.ts → mssql/index.d.ts} +1 -1
  15. package/dist/connectors/{mssqlConnector.js → mssql/index.js} +13 -10
  16. package/dist/connectors/{mysqlConnector.d.ts → mysql/index.d.ts} +1 -1
  17. package/dist/connectors/{mysqlConnector.js → mysql/index.js} +1 -1
  18. package/dist/connectors/oracle/constraints.d.ts +7 -0
  19. package/dist/connectors/oracle/constraints.js +112 -0
  20. package/dist/connectors/oracle/index.d.ts +3 -0
  21. package/dist/connectors/oracle/index.js +68 -0
  22. package/dist/connectors/oracle/indexes.d.ts +3 -0
  23. package/dist/connectors/oracle/indexes.js +65 -0
  24. package/dist/connectors/oracle/refs.d.ts +3 -0
  25. package/dist/connectors/oracle/refs.js +67 -0
  26. package/dist/connectors/oracle/tables.d.ts +7 -0
  27. package/dist/connectors/oracle/tables.js +280 -0
  28. package/dist/connectors/oracle/utils.d.ts +9 -0
  29. package/dist/connectors/oracle/utils.js +27 -0
  30. package/dist/connectors/{postgresConnector.d.ts → postgres/index.d.ts} +1 -1
  31. package/dist/connectors/{postgresConnector.js → postgres/index.js} +21 -16
  32. package/dist/connectors/{mssqlConnector.d.ts → snowflake/index.d.ts} +1 -1
  33. package/dist/connectors/{snowflakeConnector.js → snowflake/index.js} +1 -2
  34. package/dist/connectors/types.d.ts +1 -1
  35. package/dist/index.d.ts +1 -1
  36. package/dist/index.js +17 -7
  37. package/dist/utils/parseSchema.d.ts +1 -1
  38. package/dist/utils/parseSchema.js +13 -13
  39. package/eslint.config.ts +70 -0
  40. package/jest.config.ts +2 -2
  41. package/package.json +17 -6
  42. package/src/connectors/{bigqueryConnector.ts → bigquery/index.ts} +4 -5
  43. package/src/connectors/connector.ts +8 -5
  44. package/src/connectors/{mssqlConnector.ts → mssql/index.ts} +20 -15
  45. package/src/connectors/{mysqlConnector.ts → mysql/index.ts} +3 -3
  46. package/src/connectors/oracle/constraints.ts +113 -0
  47. package/src/connectors/oracle/index.ts +76 -0
  48. package/src/connectors/oracle/indexes.ts +71 -0
  49. package/src/connectors/oracle/refs.ts +73 -0
  50. package/src/connectors/oracle/tables.ts +305 -0
  51. package/src/connectors/oracle/utils.ts +23 -0
  52. package/src/connectors/{postgresConnector.ts → postgres/index.ts} +25 -18
  53. package/src/connectors/{snowflakeConnector.ts → snowflake/index.ts} +7 -6
  54. package/src/connectors/types.ts +14 -13
  55. package/src/index.ts +1 -1
  56. package/src/utils/parseSchema.ts +11 -11
  57. package/tsconfig.json +1 -1
  58. package/.eslintrc.json +0 -24
@@ -97,6 +97,13 @@
97
97
  "note": {
98
98
  "value": ""
99
99
  }
100
+ },
101
+ {
102
+ "name": "table_with_composite_primary_and_unique_indexes",
103
+ "schemaName": "public",
104
+ "note": {
105
+ "value": ""
106
+ }
100
107
  }
101
108
  ],
102
109
  "fields": {
@@ -1270,6 +1277,60 @@
1270
1277
  "value": ""
1271
1278
  }
1272
1279
  }
1280
+ ],
1281
+ "public.table_with_composite_primary_and_unique_indexes": [
1282
+ {
1283
+ "name": "col1",
1284
+ "type": {
1285
+ "type_name": "int4",
1286
+ "schemaName": null
1287
+ },
1288
+ "dbdefault": null,
1289
+ "not_null": true,
1290
+ "increment": false,
1291
+ "note": {
1292
+ "value": ""
1293
+ }
1294
+ },
1295
+ {
1296
+ "name": "col2",
1297
+ "type": {
1298
+ "type_name": "int4",
1299
+ "schemaName": null
1300
+ },
1301
+ "dbdefault": null,
1302
+ "not_null": true,
1303
+ "increment": false,
1304
+ "note": {
1305
+ "value": ""
1306
+ }
1307
+ },
1308
+ {
1309
+ "name": "col3",
1310
+ "type": {
1311
+ "type_name": "int4",
1312
+ "schemaName": null
1313
+ },
1314
+ "dbdefault": null,
1315
+ "not_null": false,
1316
+ "increment": false,
1317
+ "note": {
1318
+ "value": ""
1319
+ }
1320
+ },
1321
+ {
1322
+ "name": "col4",
1323
+ "type": {
1324
+ "type_name": "int4",
1325
+ "schemaName": null
1326
+ },
1327
+ "dbdefault": null,
1328
+ "not_null": false,
1329
+ "increment": false,
1330
+ "note": {
1331
+ "value": ""
1332
+ }
1333
+ }
1273
1334
  ]
1274
1335
  },
1275
1336
  "refs": [
@@ -1447,7 +1508,9 @@
1447
1508
  "type": "column",
1448
1509
  "value": "nationalityid"
1449
1510
  }
1450
- ]
1511
+ ],
1512
+ "pk": true,
1513
+ "unique": false
1451
1514
  }
1452
1515
  ],
1453
1516
  "public.order_items": [
@@ -1463,7 +1526,9 @@
1463
1526
  "type": "column",
1464
1527
  "value": "product_id"
1465
1528
  }
1466
- ]
1529
+ ],
1530
+ "pk": false,
1531
+ "unique": true
1467
1532
  },
1468
1533
  {
1469
1534
  "name": "idx_order_items_order_product",
@@ -1477,7 +1542,9 @@
1477
1542
  "type": "column",
1478
1543
  "value": "product_id"
1479
1544
  }
1480
- ]
1545
+ ],
1546
+ "pk": false,
1547
+ "unique": false
1481
1548
  }
1482
1549
  ],
1483
1550
  "public.orders": [
@@ -1493,7 +1560,9 @@
1493
1560
  "type": "column",
1494
1561
  "value": "order_date"
1495
1562
  }
1496
- ]
1563
+ ],
1564
+ "pk": false,
1565
+ "unique": false
1497
1566
  }
1498
1567
  ],
1499
1568
  "public.products": [
@@ -1505,7 +1574,43 @@
1505
1574
  "type": "column",
1506
1575
  "value": "category"
1507
1576
  }
1508
- ]
1577
+ ],
1578
+ "pk": false,
1579
+ "unique": false
1580
+ }
1581
+ ],
1582
+ "public.table_with_composite_primary_and_unique_indexes": [
1583
+ {
1584
+ "name": "table_with_composite_primary_and_unique_indexes_pkey",
1585
+ "type": "btree",
1586
+ "columns": [
1587
+ {
1588
+ "type": "column",
1589
+ "value": "col1"
1590
+ },
1591
+ {
1592
+ "type": "column",
1593
+ "value": "col2"
1594
+ }
1595
+ ],
1596
+ "pk": true,
1597
+ "unique": false
1598
+ },
1599
+ {
1600
+ "name": "table_with_composite_primary_and_unique_indexes_col3_col4_key",
1601
+ "type": "btree",
1602
+ "columns": [
1603
+ {
1604
+ "type": "column",
1605
+ "value": "col3"
1606
+ },
1607
+ {
1608
+ "type": "column",
1609
+ "value": "col4"
1610
+ }
1611
+ ],
1612
+ "pk": false,
1613
+ "unique": true
1509
1614
  }
1510
1615
  ],
1511
1616
  "public.users": [
@@ -1517,7 +1622,9 @@
1517
1622
  "type": "column",
1518
1623
  "value": "full_name"
1519
1624
  }
1520
- ]
1625
+ ],
1626
+ "pk": false,
1627
+ "unique": false
1521
1628
  },
1522
1629
  {
1523
1630
  "name": "idx_users_email",
@@ -1527,7 +1634,9 @@
1527
1634
  "type": "column",
1528
1635
  "value": "email"
1529
1636
  }
1530
- ]
1637
+ ],
1638
+ "pk": false,
1639
+ "unique": false
1531
1640
  },
1532
1641
  {
1533
1642
  "name": "users_is_active_lower_idx",
@@ -1541,7 +1650,9 @@
1541
1650
  "type": "expression",
1542
1651
  "value": "lower((full_name)::text)"
1543
1652
  }
1544
- ]
1653
+ ],
1654
+ "pk": false,
1655
+ "unique": false
1545
1656
  }
1546
1657
  ]
1547
1658
  },