@balena/abstract-sql-compiler 10.2.4 → 10.2.5-build-tests-ts-c00e9270589111b882d4894fc437dd8b0343ecce-1

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.
@@ -1,3 +1,15 @@
1
+ - commits:
2
+ - subject: "Tests: convert test/odata/test to typescript"
3
+ hash: c00e9270589111b882d4894fc437dd8b0343ecce
4
+ body: ""
5
+ footer:
6
+ Change-type: patch
7
+ change-type: patch
8
+ author: Pagan Gazzard
9
+ nested: []
10
+ version: 10.2.5
11
+ title: ""
12
+ date: 2025-04-06T22:37:16.638Z
1
13
  - commits:
2
14
  - subject: Update dev dependencies
3
15
  hash: 703263fa73aff2253d1a931a5946a027d20c9ff6
@@ -9,7 +21,7 @@
9
21
  nested: []
10
22
  version: 10.2.4
11
23
  title: ""
12
- date: 2025-04-04T13:13:39.664Z
24
+ date: 2025-04-04T14:00:21.240Z
13
25
  - commits:
14
26
  - subject: "Tests: convert test/abstract-sql/case-when-else.js to typescript"
15
27
  hash: 0edb21cc4ee30ead2a6eeb290623f3a0adc7a0fe
package/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file
4
4
  automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY!
5
5
  This project adheres to [Semantic Versioning](http://semver.org/).
6
6
 
7
+ ## 10.2.5 - 2025-04-06
8
+
9
+ * Tests: convert test/odata/test to typescript [Pagan Gazzard]
10
+
7
11
  ## 10.2.4 - 2025-04-04
8
12
 
9
13
  * Update dev dependencies [Pagan Gazzard]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@balena/abstract-sql-compiler",
3
- "version": "10.2.4",
3
+ "version": "10.2.5-build-tests-ts-c00e9270589111b882d4894fc437dd8b0343ecce-1",
4
4
  "description": "A translator for abstract sql into sql.",
5
5
  "type": "commonjs",
6
6
  "main": "out/AbstractSQLCompiler.js",
@@ -64,6 +64,6 @@
64
64
  "npm": ">=10.7.0"
65
65
  },
66
66
  "versionist": {
67
- "publishedAt": "2025-04-04T13:13:40.067Z"
67
+ "publishedAt": "2025-04-06T22:37:17.012Z"
68
68
  }
69
69
  }
@@ -18,9 +18,9 @@ const websqlAgg = mysqlAgg;
18
18
  (field) => field === '"pilot"."licence"',
19
19
  ).join(', ');
20
20
  const testFunc = (aggFunc, fields) => (result, sqlEquals) => {
21
- it('should select from pilot.*, aggregated licence', () =>
22
- sqlEquals(
23
- result.query,
21
+ it('should select from pilot.*, aggregated licence', () => {
22
+ sqlEquals?.(
23
+ result,
24
24
  `\
25
25
  SELECT (
26
26
  SELECT ${aggFunc('"pilot.licence".*')} AS "licence"
@@ -31,16 +31,17 @@ SELECT (
31
31
  ) AS "pilot.licence"
32
32
  ) AS "licence", ${remainingPilotFields}
33
33
  FROM "pilot"`,
34
- ));
34
+ );
35
+ });
35
36
  };
36
37
  const url = '/pilot?$expand=licence';
37
38
  const urlCount = '/pilot?$expand=licence/$count';
38
39
  test.postgres(url, testFunc(postgresAgg, aliasLicenceFields.join(', ')));
39
40
  test.postgres(urlCount, testFunc(postgresAgg, 'COUNT(*) AS "$count"'));
40
- test.mysql.skip(url, testFunc(mysqlAgg, aliasLicenceFields.join(', ')));
41
- test.mysql.skip(urlCount, testFunc(mysqlAgg, 'COUNT(*) AS "$count"'));
42
- test.websql.skip(url, testFunc(websqlAgg, aliasLicenceFields.join(', ')));
43
- test.websql.skip(urlCount, testFunc(websqlAgg, 'COUNT(*) AS "$count"'));
41
+ test.mysql.fail(url, testFunc(mysqlAgg, aliasLicenceFields.join(', ')));
42
+ test.mysql.fail(urlCount, testFunc(mysqlAgg, 'COUNT(*) AS "$count"'));
43
+ test.websql.fail(url, testFunc(websqlAgg, aliasLicenceFields.join(', ')));
44
+ test.websql.fail(urlCount, testFunc(websqlAgg, 'COUNT(*) AS "$count"'));
44
45
  })();
45
46
 
46
47
  (function () {
@@ -50,8 +51,8 @@ FROM "pilot"`,
50
51
  ).join(', ');
51
52
  const testFunc = (aggFunc) => (result, sqlEquals) => {
52
53
  it('should select from pilot.*, aggregated(pilot-can fly-plane, aggregated plane)', () => {
53
- sqlEquals(
54
- result.query,
54
+ sqlEquals?.(
55
+ result,
55
56
  `\
56
57
  SELECT (
57
58
  SELECT ${aggFunc('"pilot.pilot-can fly-plane".*')} AS "can_fly__plane"
@@ -78,8 +79,8 @@ FROM "pilot"`,
78
79
  '/pilot?$expand=can_fly__plane($expand=plane)',
79
80
  ]) {
80
81
  test.postgres(url, testFunc(postgresAgg));
81
- test.mysql.skip(url, testFunc(mysqlAgg));
82
- test.websql.skip(url, testFunc(websqlAgg));
82
+ test.mysql.fail(url, testFunc(mysqlAgg));
83
+ test.websql.fail(url, testFunc(websqlAgg));
83
84
  }
84
85
  })();
85
86
 
@@ -94,8 +95,8 @@ FROM "pilot"`,
94
95
  ).join(', ');
95
96
  const testFunc = (aggFunc) => (result, sqlEquals) => {
96
97
  it('should select from pilot.*, aggregated(pilot-can fly-plane, aggregated plane), aggregated licence', () => {
97
- sqlEquals(
98
- result.query,
98
+ sqlEquals?.(
99
+ result,
99
100
  `\
100
101
  SELECT (
101
102
  SELECT ${aggFunc('"pilot.pilot-can fly-plane".*')} AS "can_fly__plane"
@@ -129,16 +130,16 @@ FROM "pilot"`,
129
130
  '/pilot?$expand=can_fly__plane($expand=plane),licence',
130
131
  ]) {
131
132
  test.postgres(url, testFunc(postgresAgg));
132
- test.mysql.skip(url, testFunc(mysqlAgg));
133
- test.websql.skip(url, testFunc(websqlAgg));
133
+ test.mysql.fail(url, testFunc(mysqlAgg));
134
+ test.websql.fail(url, testFunc(websqlAgg));
134
135
  }
135
136
  })();
136
137
 
137
138
  (function () {
138
139
  const testFunc = (aggFunc) => (result, sqlEquals) => {
139
140
  it('should select from pilot.*, aggregated(pilot-can fly-plane, aggregated plane), aggregated licence', () => {
140
- sqlEquals(
141
- result.query,
141
+ sqlEquals?.(
142
+ result,
142
143
  `\
143
144
  SELECT (
144
145
  SELECT ${aggFunc('"pilot.licence".*')} AS "licence"
@@ -154,8 +155,8 @@ FROM "pilot"`,
154
155
  };
155
156
  const url = '/pilot?$select=licence&$expand=licence';
156
157
  test.postgres(url, testFunc(postgresAgg));
157
- test.mysql.skip(url, testFunc(mysqlAgg));
158
- test.websql.skip(url, testFunc(websqlAgg));
158
+ test.mysql.fail(url, testFunc(mysqlAgg));
159
+ test.websql.fail(url, testFunc(websqlAgg));
159
160
  })();
160
161
 
161
162
  (function () {
@@ -165,8 +166,8 @@ FROM "pilot"`,
165
166
  ).join(', ');
166
167
  const testFunc = (aggFunc) => (result, sqlEquals) => {
167
168
  it('should select from pilot.*, aggregated(pilot-can fly-plane, aggregated plane)', () => {
168
- sqlEquals(
169
- result.query,
169
+ sqlEquals?.(
170
+ result,
170
171
  `\
171
172
  SELECT (
172
173
  SELECT ${aggFunc('"pilot.pilot-can fly-plane".*')} AS "can_fly__plane"
@@ -193,8 +194,8 @@ FROM "pilot"`,
193
194
  '/pilot?$select=id&$expand=can_fly__plane($expand=plane)',
194
195
  ]) {
195
196
  test.postgres(url, testFunc(postgresAgg));
196
- test.mysql.skip(url, testFunc(mysqlAgg));
197
- test.websql.skip(url, testFunc(websqlAgg));
197
+ test.mysql.fail(url, testFunc(mysqlAgg));
198
+ test.websql.fail(url, testFunc(websqlAgg));
198
199
  }
199
200
  })();
200
201
 
@@ -205,8 +206,8 @@ FROM "pilot"`,
205
206
  ).join(', ');
206
207
  const testFunc = (aggFunc) => (result, sqlEquals) => {
207
208
  it('should select from pilot.*, aggregated(pilot-can fly-plane, aggregated plane), aggregated licence', () => {
208
- sqlEquals(
209
- result.query,
209
+ sqlEquals?.(
210
+ result,
210
211
  `\
211
212
  SELECT (
212
213
  SELECT ${aggFunc('"pilot.pilot-can fly-plane".*')} AS "can_fly__plane"
@@ -240,16 +241,16 @@ FROM "pilot"`,
240
241
  '/pilot?$select=id,licence&$expand=can_fly__plane($expand=plane),licence',
241
242
  ]) {
242
243
  test.postgres(url, testFunc(postgresAgg));
243
- test.mysql.skip(url, testFunc(mysqlAgg));
244
- test.websql.skip(url, testFunc(websqlAgg));
244
+ test.mysql.fail(url, testFunc(mysqlAgg));
245
+ test.websql.fail(url, testFunc(websqlAgg));
245
246
  }
246
247
  })();
247
248
 
248
249
  (function () {
249
250
  const testFunc = (aggFunc) => (result, sqlEquals) => {
250
251
  it('should select from pilot.*, aggregated(pilot-can fly-plane, aggregated plane)', () => {
251
- sqlEquals(
252
- result.query,
252
+ sqlEquals?.(
253
+ result,
253
254
  `\
254
255
  SELECT (
255
256
  SELECT ${aggFunc('"pilot.pilot-can fly-plane".*')} AS "can_fly__plane"
@@ -265,8 +266,8 @@ FROM "pilot"`,
265
266
  };
266
267
  const url = '/pilot?$expand=can_fly__plane($select=id)';
267
268
  test.postgres(url, testFunc(postgresAgg));
268
- test.mysql.skip(url, testFunc(mysqlAgg));
269
- test.websql.skip(url, testFunc(websqlAgg));
269
+ test.mysql.fail(url, testFunc(mysqlAgg));
270
+ test.websql.fail(url, testFunc(websqlAgg));
270
271
  })();
271
272
 
272
273
  (function () {
@@ -276,8 +277,8 @@ FROM "pilot"`,
276
277
  ).join(', ');
277
278
  const testFunc = (aggFunc, fields) => (result, sqlEquals) => {
278
279
  it('should select from pilot.*, aggregated licence', () => {
279
- sqlEquals(
280
- result.query,
280
+ sqlEquals?.(
281
+ result,
281
282
  `\
282
283
  SELECT (
283
284
  SELECT ${aggFunc('"pilot.licence".*')} AS "licence"
@@ -306,25 +307,25 @@ FROM "pilot"`,
306
307
  [['Bind', 0]],
307
308
  testFunc(postgresAgg, 'COUNT(*) AS "$count"'),
308
309
  );
309
- test.mysql.skip(
310
+ test.mysql.fail(
310
311
  url,
311
312
  'GET',
312
313
  [['Bind', 0]],
313
314
  testFunc(mysqlAgg, aliasLicenceFields.join(', ')),
314
315
  );
315
- test.mysql.skip(
316
+ test.mysql.fail(
316
317
  urlCount,
317
318
  'GET',
318
319
  [['Bind', 0]],
319
320
  testFunc(mysqlAgg, 'COUNT(*) AS "$count"'),
320
321
  );
321
- test.websql.skip(
322
+ test.websql.fail(
322
323
  url,
323
324
  'GET',
324
325
  [['Bind', 0]],
325
326
  testFunc(websqlAgg, aliasLicenceFields.join(', ')),
326
327
  );
327
- test.websql.skip(
328
+ test.websql.fail(
328
329
  urlCount,
329
330
  'GET',
330
331
  [['Bind', 0]],
@@ -339,8 +340,8 @@ FROM "pilot"`,
339
340
  ).join(', ');
340
341
  const testFunc = (aggFunc) => (result, sqlEquals) => {
341
342
  it('should select from pilot.*, aggregated licence', () => {
342
- sqlEquals(
343
- result.query,
343
+ sqlEquals?.(
344
+ result,
344
345
  `\
345
346
  SELECT (
346
347
  SELECT ${aggFunc('"pilot.licence".*')} AS "licence"
@@ -358,8 +359,8 @@ FROM "pilot"`,
358
359
  };
359
360
  const url = '/pilot?$expand=licence($filter=is_of__pilot/id eq 1)';
360
361
  test.postgres(url, 'GET', [['Bind', 0]], testFunc(postgresAgg));
361
- test.mysql.skip(url, 'GET', [['Bind', 0]], testFunc(mysqlAgg));
362
- test.websql.skip(url, 'GET', [['Bind', 0]], testFunc(websqlAgg));
362
+ test.mysql.fail(url, 'GET', [['Bind', 0]], testFunc(mysqlAgg));
363
+ test.websql.fail(url, 'GET', [['Bind', 0]], testFunc(websqlAgg));
363
364
  })();
364
365
 
365
366
  (function () {
@@ -369,8 +370,8 @@ FROM "pilot"`,
369
370
  ).join(', ');
370
371
  const testFunc = (aggFunc) => (result, sqlEquals) => {
371
372
  it('should select from pilot.*, aggregated licence', () => {
372
- sqlEquals(
373
- result.query,
373
+ sqlEquals?.(
374
+ result,
374
375
  `\
375
376
  SELECT (
376
377
  SELECT ${aggFunc('"pilot.licence".*')} AS "licence"
@@ -387,8 +388,8 @@ FROM "pilot"`,
387
388
  };
388
389
  const url = '/pilot?$expand=licence($orderby=id)';
389
390
  test.postgres(url, testFunc(postgresAgg));
390
- test.mysql.skip(url, testFunc(mysqlAgg));
391
- test.websql.skip(url, testFunc(websqlAgg));
391
+ test.mysql.fail(url, testFunc(mysqlAgg));
392
+ test.websql.fail(url, testFunc(websqlAgg));
392
393
  })();
393
394
 
394
395
  (function () {
@@ -398,8 +399,8 @@ FROM "pilot"`,
398
399
  ).join(', ');
399
400
  const testFunc = (aggFunc) => (result, sqlEquals) => {
400
401
  it('should select from pilot.*, aggregated count(*) licence and ignore orderby', () => {
401
- sqlEquals(
402
- result.query,
402
+ sqlEquals?.(
403
+ result,
403
404
  `\
404
405
  SELECT (
405
406
  SELECT ${aggFunc('"pilot.licence".*')} AS "licence"
@@ -415,8 +416,8 @@ FROM "pilot"`,
415
416
  };
416
417
  const urlCount = '/pilot?$expand=licence/$count($orderby=id)';
417
418
  test.postgres(urlCount, testFunc(postgresAgg));
418
- test.mysql.skip(urlCount, testFunc(mysqlAgg));
419
- test.websql.skip(urlCount, testFunc(websqlAgg));
419
+ test.mysql.fail(urlCount, testFunc(mysqlAgg));
420
+ test.websql.fail(urlCount, testFunc(websqlAgg));
420
421
  })();
421
422
 
422
423
  (function () {
@@ -426,8 +427,8 @@ FROM "pilot"`,
426
427
  ).join(', ');
427
428
  const testFunc = (aggFunc) => (result, sqlEquals) => {
428
429
  it('should select from pilot.*, aggregated licence', () => {
429
- sqlEquals(
430
- result.query,
430
+ sqlEquals?.(
431
+ result,
431
432
  `\
432
433
  SELECT (
433
434
  SELECT ${aggFunc('"pilot.licence".*')} AS "licence"
@@ -444,8 +445,8 @@ FROM "pilot"`,
444
445
  };
445
446
  const url = '/pilot?$expand=licence($top=10)';
446
447
  test.postgres(url, 'GET', [['Bind', 0]], testFunc(postgresAgg));
447
- test.mysql.skip(url, 'GET', [['Bind', 0]], testFunc(mysqlAgg));
448
- test.websql.skip(url, 'GET', [['Bind', 0]], testFunc(websqlAgg));
448
+ test.mysql.fail(url, 'GET', [['Bind', 0]], testFunc(mysqlAgg));
449
+ test.websql.fail(url, 'GET', [['Bind', 0]], testFunc(websqlAgg));
449
450
  })();
450
451
 
451
452
  (function () {
@@ -455,8 +456,8 @@ FROM "pilot"`,
455
456
  ).join(', ');
456
457
  const testFunc = (aggFunc) => (result, sqlEquals) => {
457
458
  it('should select from pilot.*, aggregated count(*) licence and ignore top', () => {
458
- sqlEquals(
459
- result.query,
459
+ sqlEquals?.(
460
+ result,
460
461
  `\
461
462
  SELECT (
462
463
  SELECT ${aggFunc('"pilot.licence".*')} AS "licence"
@@ -472,8 +473,8 @@ FROM "pilot"`,
472
473
  };
473
474
  const urlCount = '/pilot?$expand=licence/$count($top=10)';
474
475
  test.postgres(urlCount, testFunc(postgresAgg));
475
- test.mysql.skip(urlCount, testFunc(mysqlAgg));
476
- test.websql.skip(urlCount, testFunc(websqlAgg));
476
+ test.mysql.fail(urlCount, testFunc(mysqlAgg));
477
+ test.websql.fail(urlCount, testFunc(websqlAgg));
477
478
  })();
478
479
 
479
480
  (function () {
@@ -483,8 +484,8 @@ FROM "pilot"`,
483
484
  ).join(', ');
484
485
  const testFunc = (aggFunc) => (result, sqlEquals) => {
485
486
  it('should select from pilot.*, aggregated licence', () => {
486
- sqlEquals(
487
- result.query,
487
+ sqlEquals?.(
488
+ result,
488
489
  `\
489
490
  SELECT (
490
491
  SELECT ${aggFunc('"pilot.licence".*')} AS "licence"
@@ -501,8 +502,8 @@ FROM "pilot"`,
501
502
  };
502
503
  const url = '/pilot?$expand=licence($skip=10)';
503
504
  test.postgres(url, 'GET', [['Bind', 0]], testFunc(postgresAgg));
504
- test.mysql.skip(url, 'GET', [['Bind', 0]], testFunc(mysqlAgg));
505
- test.websql.skip(url, 'GET', [['Bind', 0]], testFunc(websqlAgg));
505
+ test.mysql.fail(url, 'GET', [['Bind', 0]], testFunc(mysqlAgg));
506
+ test.websql.fail(url, 'GET', [['Bind', 0]], testFunc(websqlAgg));
506
507
  })();
507
508
 
508
509
  (function () {
@@ -512,8 +513,8 @@ FROM "pilot"`,
512
513
  ).join(', ');
513
514
  const testFunc = (aggFunc) => (result, sqlEquals) => {
514
515
  it('should select from pilot.*, aggregated count(*) licence and ignore skip', () => {
515
- sqlEquals(
516
- result.query,
516
+ sqlEquals?.(
517
+ result,
517
518
  `\
518
519
  SELECT (
519
520
  SELECT ${aggFunc('"pilot.licence".*')} AS "licence"
@@ -529,15 +530,15 @@ FROM "pilot"`,
529
530
  };
530
531
  const urlCount = '/pilot?$expand=licence/$count($skip=10)';
531
532
  test.postgres(urlCount, testFunc(postgresAgg));
532
- test.mysql.skip(urlCount, testFunc(mysqlAgg));
533
- test.websql.skip(urlCount, testFunc(websqlAgg));
533
+ test.mysql.fail(urlCount, testFunc(mysqlAgg));
534
+ test.websql.fail(urlCount, testFunc(websqlAgg));
534
535
  })();
535
536
 
536
537
  (function () {
537
538
  const testFunc = (aggFunc) => (result, sqlEquals) => {
538
539
  it('should select from pilot.*, aggregated(pilot-can fly-plane, aggregated plane)', () => {
539
- sqlEquals(
540
- result.query,
540
+ sqlEquals?.(
541
+ result,
541
542
  `\
542
543
  SELECT (
543
544
  SELECT ${aggFunc('"pilot.pilot-can fly-plane".*')} AS "can_fly__plane"
@@ -553,15 +554,15 @@ FROM "pilot"`,
553
554
  };
554
555
  const url = '/pilot?$expand=can_fly__plane($select=plane)';
555
556
  test.postgres(url, testFunc(postgresAgg));
556
- test.mysql.skip(url, testFunc(mysqlAgg));
557
- test.websql.skip(url, testFunc(websqlAgg));
557
+ test.mysql.fail(url, testFunc(mysqlAgg));
558
+ test.websql.fail(url, testFunc(websqlAgg));
558
559
  })();
559
560
 
560
561
  (function () {
561
562
  const testFunc = (aggFunc) => (result, sqlEquals) => {
562
563
  it('should select from pilot.*, aggregated count(*) pilot-can fly-plane and ignore select', () => {
563
- sqlEquals(
564
- result.query,
564
+ sqlEquals?.(
565
+ result,
565
566
  `\
566
567
  SELECT (
567
568
  SELECT ${aggFunc('"pilot.pilot-can fly-plane".*')} AS "can_fly__plane"
@@ -577,8 +578,8 @@ FROM "pilot"`,
577
578
  };
578
579
  const urlCount = '/pilot?$expand=can_fly__plane/$count($select=plane)';
579
580
  test.postgres(urlCount, testFunc(postgresAgg));
580
- test.mysql.skip(urlCount, testFunc(mysqlAgg));
581
- test.websql.skip(urlCount, testFunc(websqlAgg));
581
+ test.mysql.fail(urlCount, testFunc(mysqlAgg));
582
+ test.websql.fail(urlCount, testFunc(websqlAgg));
582
583
  })();
583
584
 
584
585
  (function () {
@@ -589,8 +590,8 @@ FROM "pilot"`,
589
590
  ).join(', ');
590
591
  const testFunc = (aggFunc) => (result, sqlEquals) => {
591
592
  it('should select from pilot.*, aggregated pilot', () => {
592
- sqlEquals(
593
- result.query,
593
+ sqlEquals?.(
594
+ result,
594
595
  `\
595
596
  SELECT (
596
597
  SELECT ${aggFunc('"pilot.trained-pilot".*')} AS "trained__pilot"
@@ -606,6 +607,6 @@ FROM "pilot"`,
606
607
  };
607
608
  const url = '/pilot?$expand=trained__pilot';
608
609
  test.postgres(url, testFunc(postgresAgg));
609
- test.mysql.skip(url, testFunc(mysqlAgg));
610
- test.websql.skip(url, testFunc(websqlAgg));
610
+ test.mysql.fail(url, testFunc(mysqlAgg));
611
+ test.websql.fail(url, testFunc(websqlAgg));
611
612
  })();