@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
@@ -72,6 +72,12 @@
72
72
  "value": ""
73
73
  }
74
74
  },
75
+ {
76
+ "name": "table_with_composite_primary_and_unique_indexes",
77
+ "note": {
78
+ "value": ""
79
+ }
80
+ },
75
81
  {
76
82
  "name": "users",
77
83
  "note": {
@@ -882,6 +888,60 @@
882
888
  }
883
889
  }
884
890
  ],
891
+ "table_with_composite_primary_and_unique_indexes": [
892
+ {
893
+ "name": "col1",
894
+ "type": {
895
+ "type_name": "int",
896
+ "schemaName": null
897
+ },
898
+ "dbdefault": null,
899
+ "not_null": true,
900
+ "increment": false,
901
+ "note": {
902
+ "value": ""
903
+ }
904
+ },
905
+ {
906
+ "name": "col2",
907
+ "type": {
908
+ "type_name": "int",
909
+ "schemaName": null
910
+ },
911
+ "dbdefault": null,
912
+ "not_null": true,
913
+ "increment": false,
914
+ "note": {
915
+ "value": ""
916
+ }
917
+ },
918
+ {
919
+ "name": "col3",
920
+ "type": {
921
+ "type_name": "int",
922
+ "schemaName": null
923
+ },
924
+ "dbdefault": null,
925
+ "not_null": false,
926
+ "increment": false,
927
+ "note": {
928
+ "value": ""
929
+ }
930
+ },
931
+ {
932
+ "name": "col4",
933
+ "type": {
934
+ "type_name": "int",
935
+ "schemaName": null
936
+ },
937
+ "dbdefault": null,
938
+ "not_null": false,
939
+ "increment": false,
940
+ "note": {
941
+ "value": ""
942
+ }
943
+ }
944
+ ],
885
945
  "users": [
886
946
  {
887
947
  "name": "user_id",
@@ -1297,7 +1357,7 @@
1297
1357
  "composite_key_1": [
1298
1358
  {
1299
1359
  "name": "PRIMARY",
1300
- "primary": true,
1360
+ "pk": true,
1301
1361
  "columns": [
1302
1362
  {
1303
1363
  "type": "column",
@@ -1327,7 +1387,7 @@
1327
1387
  "composite_key_2": [
1328
1388
  {
1329
1389
  "name": "PRIMARY",
1330
- "primary": true,
1390
+ "pk": true,
1331
1391
  "columns": [
1332
1392
  {
1333
1393
  "type": "column",
@@ -1339,6 +1399,36 @@
1339
1399
  }
1340
1400
  ]
1341
1401
  }
1402
+ ],
1403
+ "table_with_composite_primary_and_unique_indexes": [
1404
+ {
1405
+ "name": "col3",
1406
+ "unique": true,
1407
+ "columns": [
1408
+ {
1409
+ "type": "column",
1410
+ "value": "col3"
1411
+ },
1412
+ {
1413
+ "type": "column",
1414
+ "value": "col4"
1415
+ }
1416
+ ]
1417
+ },
1418
+ {
1419
+ "name": "PRIMARY",
1420
+ "pk": true,
1421
+ "columns": [
1422
+ {
1423
+ "type": "column",
1424
+ "value": "col1"
1425
+ },
1426
+ {
1427
+ "type": "column",
1428
+ "value": "col2"
1429
+ }
1430
+ ]
1431
+ }
1342
1432
  ]
1343
1433
  },
1344
1434
  "tableConstraints": {
@@ -1381,19 +1471,19 @@
1381
1471
  "checks": [],
1382
1472
  "pk": true
1383
1473
  },
1384
- "quantity": {
1474
+ "total_value": {
1385
1475
  "checks": [
1386
1476
  {
1387
- "name": "max_quantity",
1388
- "expression": "`quantity` < 10000"
1477
+ "name": "products_chk_2",
1478
+ "expression": "`total_value` > 0"
1389
1479
  }
1390
1480
  ]
1391
1481
  },
1392
- "total_value": {
1482
+ "quantity": {
1393
1483
  "checks": [
1394
1484
  {
1395
- "name": "products_chk_2",
1396
- "expression": "`total_value` > 0"
1485
+ "name": "max_quantity",
1486
+ "expression": "`quantity` < 10000"
1397
1487
  }
1398
1488
  ]
1399
1489
  }
@@ -1427,4 +1517,4 @@
1427
1517
  }
1428
1518
  ]
1429
1519
  }
1430
- }
1520
+ }