@dbml/connector 3.9.3 → 3.9.4

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.
@@ -97,6 +97,27 @@
97
97
  "note": {
98
98
  "value": ""
99
99
  }
100
+ },
101
+ {
102
+ "name": "table_same_fk",
103
+ "schemaName": "public",
104
+ "note": {
105
+ "value": ""
106
+ }
107
+ },
108
+ {
109
+ "name": "table_same_fk_1",
110
+ "schemaName": "public",
111
+ "note": {
112
+ "value": ""
113
+ }
114
+ },
115
+ {
116
+ "name": "table_same_fk_2",
117
+ "schemaName": "public",
118
+ "note": {
119
+ "value": ""
120
+ }
100
121
  }
101
122
  ],
102
123
  "fields": {
@@ -1270,6 +1291,77 @@
1270
1291
  "value": ""
1271
1292
  }
1272
1293
  }
1294
+ ],
1295
+ "public.table_same_fk": [
1296
+ {
1297
+ "name": "id",
1298
+ "type": {
1299
+ "type_name": "int4",
1300
+ "schemaName": null
1301
+ },
1302
+ "dbdefault": null,
1303
+ "not_null": true,
1304
+ "increment": true,
1305
+ "note": {
1306
+ "value": ""
1307
+ }
1308
+ }
1309
+ ],
1310
+ "public.table_same_fk_1": [
1311
+ {
1312
+ "name": "id",
1313
+ "type": {
1314
+ "type_name": "int4",
1315
+ "schemaName": null
1316
+ },
1317
+ "dbdefault": null,
1318
+ "not_null": true,
1319
+ "increment": true,
1320
+ "note": {
1321
+ "value": ""
1322
+ }
1323
+ },
1324
+ {
1325
+ "name": "fk_id_1",
1326
+ "type": {
1327
+ "type_name": "int4",
1328
+ "schemaName": null
1329
+ },
1330
+ "dbdefault": null,
1331
+ "not_null": false,
1332
+ "increment": false,
1333
+ "note": {
1334
+ "value": ""
1335
+ }
1336
+ }
1337
+ ],
1338
+ "public.table_same_fk_2": [
1339
+ {
1340
+ "name": "id",
1341
+ "type": {
1342
+ "type_name": "int4",
1343
+ "schemaName": null
1344
+ },
1345
+ "dbdefault": null,
1346
+ "not_null": true,
1347
+ "increment": true,
1348
+ "note": {
1349
+ "value": ""
1350
+ }
1351
+ },
1352
+ {
1353
+ "name": "fk_id_2",
1354
+ "type": {
1355
+ "type_name": "int4",
1356
+ "schemaName": null
1357
+ },
1358
+ "dbdefault": null,
1359
+ "not_null": false,
1360
+ "increment": false,
1361
+ "note": {
1362
+ "value": ""
1363
+ }
1364
+ }
1273
1365
  ]
1274
1366
  },
1275
1367
  "refs": [
@@ -1366,6 +1458,54 @@
1366
1458
  ],
1367
1459
  "onDelete": "CASCADE",
1368
1460
  "onUpdate": null
1461
+ },
1462
+ {
1463
+ "name": "fk_same_name_test",
1464
+ "endpoints": [
1465
+ {
1466
+ "tableName": "table_same_fk_1",
1467
+ "schemaName": "public",
1468
+ "fieldNames": [
1469
+ "fk_id_1",
1470
+ "fk_id_2"
1471
+ ],
1472
+ "relation": "*"
1473
+ },
1474
+ {
1475
+ "tableName": "table_same_fk",
1476
+ "schemaName": "public",
1477
+ "fieldNames": [
1478
+ "id"
1479
+ ],
1480
+ "relation": "1"
1481
+ }
1482
+ ],
1483
+ "onDelete": null,
1484
+ "onUpdate": null
1485
+ },
1486
+ {
1487
+ "name": "fk_same_name_test",
1488
+ "endpoints": [
1489
+ {
1490
+ "tableName": "table_same_fk_2",
1491
+ "schemaName": "public",
1492
+ "fieldNames": [
1493
+ "fk_id_1",
1494
+ "fk_id_2"
1495
+ ],
1496
+ "relation": "*"
1497
+ },
1498
+ {
1499
+ "tableName": "table_same_fk",
1500
+ "schemaName": "public",
1501
+ "fieldNames": [
1502
+ "id"
1503
+ ],
1504
+ "relation": "1"
1505
+ }
1506
+ ],
1507
+ "onDelete": null,
1508
+ "onUpdate": null
1369
1509
  }
1370
1510
  ],
1371
1511
  "enums": [
@@ -1594,6 +1734,21 @@
1594
1734
  "pk": true
1595
1735
  }
1596
1736
  },
1737
+ "public.table_same_fk": {
1738
+ "id": {
1739
+ "pk": true
1740
+ }
1741
+ },
1742
+ "public.table_same_fk_1": {
1743
+ "id": {
1744
+ "pk": true
1745
+ }
1746
+ },
1747
+ "public.table_same_fk_2": {
1748
+ "id": {
1749
+ "pk": true
1750
+ }
1751
+ },
1597
1752
  "public.table_with_comments": {
1598
1753
  "id": {
1599
1754
  "pk": true
@@ -93,7 +93,7 @@ async function generateTablesAndFields(client, projectId, datasetId) {
93
93
  t.table_schema = c.table_schema
94
94
  and t.table_name = c.table_name
95
95
  where t.table_type = 'BASE TABLE'
96
- order by t.create_time, c.ordinal_position;
96
+ order by t.creation_time, c.ordinal_position;
97
97
  `;
98
98
  const [queryResult] = await client.query({ query });
99
99
  const tableMap = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dbml/connector",
3
- "version": "3.9.3",
3
+ "version": "3.9.4",
4
4
  "description": "This package was created to fetch the schema JSON from many kind of databases.",
5
5
  "author": "huy.phung.sw@gmail.com",
6
6
  "license": "MIT",
@@ -40,5 +40,5 @@
40
40
  "engines": {
41
41
  "node": ">=18"
42
42
  },
43
- "gitHead": "f78c1f65fcf3f7edc472fbe2038abf1fd56dccdb"
43
+ "gitHead": "7dcc73bb327aa5603e3d9b6fec2b1b2e6f3f82da"
44
44
  }
@@ -137,7 +137,7 @@ async function generateTablesAndFields(
137
137
  t.table_schema = c.table_schema
138
138
  and t.table_name = c.table_name
139
139
  where t.table_type = 'BASE TABLE'
140
- order by t.create_time, c.ordinal_position;
140
+ order by t.creation_time, c.ordinal_position;
141
141
  `;
142
142
 
143
143
  const [queryResult] = await client.query({ query });