tinybase 8.3.0-beta.0 → 8.3.0-beta.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.
- package/@types/queries/index.d.ts +141 -0
- package/@types/queries/with-schemas/index.d.ts +184 -0
- package/index.js +594 -418
- package/indexes/index.js +8 -22
- package/indexes/with-schemas/index.js +8 -22
- package/metrics/index.js +8 -22
- package/metrics/with-schemas/index.js +8 -22
- package/min/index.js +1 -1
- package/min/index.js.gz +0 -0
- package/min/indexes/index.js +1 -1
- package/min/indexes/index.js.gz +0 -0
- package/min/indexes/with-schemas/index.js +1 -1
- package/min/indexes/with-schemas/index.js.gz +0 -0
- package/min/metrics/index.js +1 -1
- package/min/metrics/index.js.gz +0 -0
- package/min/metrics/with-schemas/index.js +1 -1
- package/min/metrics/with-schemas/index.js.gz +0 -0
- package/min/omni/index.js +1 -1
- package/min/omni/index.js.gz +0 -0
- package/min/omni/with-schemas/index.js +1 -1
- package/min/omni/with-schemas/index.js.gz +0 -0
- package/min/queries/index.js +1 -1
- package/min/queries/index.js.gz +0 -0
- package/min/queries/with-schemas/index.js +1 -1
- package/min/queries/with-schemas/index.js.gz +0 -0
- package/min/relationships/index.js +1 -1
- package/min/relationships/index.js.gz +0 -0
- package/min/relationships/with-schemas/index.js +1 -1
- package/min/relationships/with-schemas/index.js.gz +0 -0
- package/min/with-schemas/index.js +1 -1
- package/min/with-schemas/index.js.gz +0 -0
- package/omni/index.js +594 -418
- package/omni/with-schemas/index.js +594 -418
- package/package.json +10 -10
- package/queries/index.js +596 -454
- package/queries/with-schemas/index.js +596 -454
- package/readme.md +14 -14
- package/relationships/index.js +8 -22
- package/relationships/with-schemas/index.js +8 -22
- package/releases.md +51 -51
- package/ui-svelte/index.js +1 -1
- package/ui-svelte/with-schemas/index.js +1 -1
- package/ui-svelte-dom/index.js +2 -2
- package/ui-svelte-dom/with-schemas/index.js +2 -2
- package/ui-svelte-inspector/index.js +2 -2
- package/ui-svelte-inspector/with-schemas/index.js +2 -2
- package/with-schemas/index.js +594 -418
|
@@ -759,6 +759,20 @@ export type GetTableCell = {
|
|
|
759
759
|
* @since v2.0.0
|
|
760
760
|
*/
|
|
761
761
|
(joinedTableId: Id, joinedCellId: Id): CellOrUndefined;
|
|
762
|
+
/**
|
|
763
|
+
* Calling this function with three parameters (where the first is `true`)
|
|
764
|
+
* will return the value of the specified Cell from a query result that has
|
|
765
|
+
* been joined in the query, for the Row being selected or filtered.
|
|
766
|
+
* @param asQuery A flag indicating that the next Id is a query Id.
|
|
767
|
+
* @param joinedQueryId The Id of the query result to fetch the value from. If
|
|
768
|
+
* the underlying query result was joined 'as' a different Id, that should
|
|
769
|
+
* instead be used.
|
|
770
|
+
* @param joinedCellId The Id of the Cell to fetch the value for.
|
|
771
|
+
* @returns A Cell value or `undefined`.
|
|
772
|
+
* @category Callback
|
|
773
|
+
* @since v8.3.0
|
|
774
|
+
*/
|
|
775
|
+
(asQuery: true, joinedQueryId: Id, joinedCellId: Id): CellOrUndefined;
|
|
762
776
|
};
|
|
763
777
|
|
|
764
778
|
/**
|
|
@@ -967,6 +981,21 @@ export type Select = {
|
|
|
967
981
|
* @since v2.0.0
|
|
968
982
|
*/
|
|
969
983
|
(joinedTableId: Id, joinedCellId: Id): SelectedAs;
|
|
984
|
+
/**
|
|
985
|
+
* Calling this function with three parameters (where the first is `true`)
|
|
986
|
+
* will indicate that the query should select the value of the specified Cell
|
|
987
|
+
* from a query result that has been joined in the query.
|
|
988
|
+
* @param asQuery A flag indicating that the next Id is a query Id.
|
|
989
|
+
* @param joinedQueryId The Id of the query result to fetch the value from. If
|
|
990
|
+
* the underlying query result was joined 'as' a different Id, that should
|
|
991
|
+
* instead be used.
|
|
992
|
+
* @param joinedCellId The Id of the Cell to fetch the value for.
|
|
993
|
+
* @returns A SelectedAs object so that the selected Cell Id can be optionally
|
|
994
|
+
* aliased.
|
|
995
|
+
* @category Definition
|
|
996
|
+
* @since v8.3.0
|
|
997
|
+
*/
|
|
998
|
+
(asQuery: true, joinedQueryId: Id, joinedCellId: Id): SelectedAs;
|
|
970
999
|
/**
|
|
971
1000
|
* Calling this function with one callback parameter will indicate that the
|
|
972
1001
|
* query should select a calculated value, based on one or more Cell values in
|
|
@@ -1228,6 +1257,20 @@ export type Join = {
|
|
|
1228
1257
|
* @since v2.0.0
|
|
1229
1258
|
*/
|
|
1230
1259
|
(joinedTableId: Id, on: Id): JoinedAs;
|
|
1260
|
+
/**
|
|
1261
|
+
* Calling this function with three parameters (where the first is `true`)
|
|
1262
|
+
* will indicate that the join to a Row in an adjacent query result is made
|
|
1263
|
+
* by finding its Id in a Cell of the query's root Table.
|
|
1264
|
+
* @param asQuery A flag indicating that the next Id is a query Id.
|
|
1265
|
+
* @param joinedQueryId The Id of the query result to join to.
|
|
1266
|
+
* @param on The Id of the Cell in the root Table that contains the joined
|
|
1267
|
+
* query result's Row Id.
|
|
1268
|
+
* @returns A JoinedAs object so that the joined Table Id can be optionally
|
|
1269
|
+
* aliased.
|
|
1270
|
+
* @category Definition
|
|
1271
|
+
* @since v8.3.0
|
|
1272
|
+
*/
|
|
1273
|
+
(asQuery: true, joinedQueryId: Id, on: Id): JoinedAs;
|
|
1231
1274
|
/**
|
|
1232
1275
|
* Calling this function with two parameters (where the second is a function)
|
|
1233
1276
|
* will indicate that the join to a Row in an adjacent Table is made by
|
|
@@ -1245,6 +1288,26 @@ export type Join = {
|
|
|
1245
1288
|
joinedTableId: Id,
|
|
1246
1289
|
on: (getCell: GetCell, rowId: Id) => Id | undefined,
|
|
1247
1290
|
): JoinedAs;
|
|
1291
|
+
/**
|
|
1292
|
+
* Calling this function with three parameters (where the first is `true` and
|
|
1293
|
+
* the third is a function) will indicate that the join to a Row in an
|
|
1294
|
+
* adjacent query result is made by calculating its Id from the Cells and the
|
|
1295
|
+
* Row Id of the query's root Table.
|
|
1296
|
+
* @param asQuery A flag indicating that the next Id is a query Id.
|
|
1297
|
+
* @param joinedQueryId The Id of the query result to join to.
|
|
1298
|
+
* @param on A callback that takes a GetCell function and the root Table's Row
|
|
1299
|
+
* Id. These can be used to programmatically calculate the joined query
|
|
1300
|
+
* result's Row Id.
|
|
1301
|
+
* @returns A JoinedAs object so that the joined Table Id can be optionally
|
|
1302
|
+
* aliased.
|
|
1303
|
+
* @category Definition
|
|
1304
|
+
* @since v8.3.0
|
|
1305
|
+
*/
|
|
1306
|
+
(
|
|
1307
|
+
asQuery: true,
|
|
1308
|
+
joinedQueryId: Id,
|
|
1309
|
+
on: (getCell: GetCell, rowId: Id) => Id | undefined,
|
|
1310
|
+
): JoinedAs;
|
|
1248
1311
|
/**
|
|
1249
1312
|
* Calling this function with three Id parameters will indicate that the join
|
|
1250
1313
|
* to a Row in distant Table is made by finding its Id in a Cell of an
|
|
@@ -1261,6 +1324,28 @@ export type Join = {
|
|
|
1261
1324
|
* @since v2.0.0
|
|
1262
1325
|
*/
|
|
1263
1326
|
(joinedTableId: Id, fromIntermediateJoinedTableId: Id, on: Id): JoinedAs;
|
|
1327
|
+
/**
|
|
1328
|
+
* Calling this function with four parameters (where the first is `true`)
|
|
1329
|
+
* will indicate that the join to a Row in a distant query result is made by
|
|
1330
|
+
* finding its Id in a Cell of an intermediately joined Table.
|
|
1331
|
+
* @param asQuery A flag indicating that the next Id is a query Id.
|
|
1332
|
+
* @param joinedQueryId The Id of the distant query result to join to.
|
|
1333
|
+
* @param fromIntermediateJoinedTableId The Id of an intermediate Table (which
|
|
1334
|
+
* should have been in turn joined to the main query table via other Join
|
|
1335
|
+
* clauses).
|
|
1336
|
+
* @param on The Id of the Cell in the intermediate Table that contains the
|
|
1337
|
+
* joined query result's Row Id.
|
|
1338
|
+
* @returns A JoinedAs object so that the joined Table Id can be optionally
|
|
1339
|
+
* aliased.
|
|
1340
|
+
* @category Definition
|
|
1341
|
+
* @since v8.3.0
|
|
1342
|
+
*/
|
|
1343
|
+
(
|
|
1344
|
+
asQuery: true,
|
|
1345
|
+
joinedQueryId: Id,
|
|
1346
|
+
fromIntermediateJoinedTableId: Id,
|
|
1347
|
+
on: Id,
|
|
1348
|
+
): JoinedAs;
|
|
1264
1349
|
/**
|
|
1265
1350
|
* Calling this function with three parameters (where the third is a function)
|
|
1266
1351
|
* will indicate that the join to a Row in distant Table is made by
|
|
@@ -1286,6 +1371,33 @@ export type Join = {
|
|
|
1286
1371
|
intermediateJoinedRowId: Id,
|
|
1287
1372
|
) => Id | undefined,
|
|
1288
1373
|
): JoinedAs;
|
|
1374
|
+
/**
|
|
1375
|
+
* Calling this function with four parameters (where the first is `true` and
|
|
1376
|
+
* the fourth is a function) will indicate that the join to a Row in a
|
|
1377
|
+
* distant query result is made by calculating its Id from the Cells and the
|
|
1378
|
+
* Row Id of an intermediately joined Table.
|
|
1379
|
+
* @param asQuery A flag indicating that the next Id is a query Id.
|
|
1380
|
+
* @param joinedQueryId The Id of the query result to join to.
|
|
1381
|
+
* @param fromIntermediateJoinedTableId The Id of an intermediate Table (which
|
|
1382
|
+
* should have been in turn joined to the main query table via other Join
|
|
1383
|
+
* clauses).
|
|
1384
|
+
* @param on A callback that takes a GetCell function and the intermediate
|
|
1385
|
+
* Table's Row Id. These can be used to programmatically calculate the joined
|
|
1386
|
+
* query result's Row Id.
|
|
1387
|
+
* @returns A JoinedAs object so that the joined Table Id can be optionally
|
|
1388
|
+
* aliased.
|
|
1389
|
+
* @category Definition
|
|
1390
|
+
* @since v8.3.0
|
|
1391
|
+
*/
|
|
1392
|
+
(
|
|
1393
|
+
asQuery: true,
|
|
1394
|
+
joinedQueryId: Id,
|
|
1395
|
+
fromIntermediateJoinedTableId: Id,
|
|
1396
|
+
on: (
|
|
1397
|
+
getIntermediateJoinedCell: GetCell,
|
|
1398
|
+
intermediateJoinedRowId: Id,
|
|
1399
|
+
) => Id | undefined,
|
|
1400
|
+
): JoinedAs;
|
|
1289
1401
|
};
|
|
1290
1402
|
|
|
1291
1403
|
/**
|
|
@@ -1492,6 +1604,21 @@ export type Where = {
|
|
|
1492
1604
|
* @since v2.0.0
|
|
1493
1605
|
*/
|
|
1494
1606
|
(joinedTableId: Id, joinedCellId: Id, equals: Cell): void;
|
|
1607
|
+
/**
|
|
1608
|
+
* Calling this function with four parameters (where the first is `true`) is
|
|
1609
|
+
* used to include only those Rows for which a specified Cell in a joined
|
|
1610
|
+
* query result has a specified value.
|
|
1611
|
+
* @param asQuery A flag indicating that the next Id is a query Id.
|
|
1612
|
+
* @param joinedQueryId The Id of the joined query result to test a value in.
|
|
1613
|
+
* If the underlying query result was joined 'as' a different Id, that should
|
|
1614
|
+
* instead be used.
|
|
1615
|
+
* @param joinedCellId The Id of the Cell in the joined query result to test.
|
|
1616
|
+
* @param equals The value that the Cell has to have for the Row to be
|
|
1617
|
+
* included in the result.
|
|
1618
|
+
* @category Definition
|
|
1619
|
+
* @since v8.3.0
|
|
1620
|
+
*/
|
|
1621
|
+
(asQuery: true, joinedQueryId: Id, joinedCellId: Id, equals: Cell): void;
|
|
1495
1622
|
/**
|
|
1496
1623
|
* Calling this function with one callback parameter is used to include only
|
|
1497
1624
|
* those Rows which meet a calculated boolean condition, based on values in
|
|
@@ -1985,6 +2112,20 @@ export interface Queries {
|
|
|
1985
2112
|
}) => void,
|
|
1986
2113
|
paramValues?: ParamValues,
|
|
1987
2114
|
): Queries;
|
|
2115
|
+
setQueryDefinition(
|
|
2116
|
+
queryId: Id,
|
|
2117
|
+
asQuery: true,
|
|
2118
|
+
rootQueryId: Id,
|
|
2119
|
+
query: (keywords: {
|
|
2120
|
+
select: Select;
|
|
2121
|
+
join: Join;
|
|
2122
|
+
where: Where;
|
|
2123
|
+
group: Group;
|
|
2124
|
+
having: Having;
|
|
2125
|
+
param: Param;
|
|
2126
|
+
}) => void,
|
|
2127
|
+
paramValues?: ParamValues,
|
|
2128
|
+
): Queries;
|
|
1988
2129
|
|
|
1989
2130
|
/**
|
|
1990
2131
|
* The delQueryDefinition method removes an existing query definition.
|
|
@@ -891,6 +891,24 @@ export type GetTableCell<
|
|
|
891
891
|
? Cell<Schema, JoinedTableId, JoinedCellId>
|
|
892
892
|
: Cell<any, any, any>)
|
|
893
893
|
| undefined;
|
|
894
|
+
/**
|
|
895
|
+
* Calling this function with three parameters (where the first is `true`)
|
|
896
|
+
* will return the value of the specified Cell from a query result that has
|
|
897
|
+
* been joined in the query, for the Row being selected or filtered.
|
|
898
|
+
* @param asQuery A flag indicating that the next Id is a query Id.
|
|
899
|
+
* @param joinedQueryId The Id of the query result to fetch the value from. If
|
|
900
|
+
* the underlying query result was joined 'as' a different Id, that should
|
|
901
|
+
* instead be used.
|
|
902
|
+
* @param joinedCellId The Id of the Cell to fetch the value for.
|
|
903
|
+
* @returns A Cell value or `undefined`.
|
|
904
|
+
* @category Callback
|
|
905
|
+
* @since v8.3.0
|
|
906
|
+
*/
|
|
907
|
+
(
|
|
908
|
+
asQuery: true,
|
|
909
|
+
joinedQueryId: Id,
|
|
910
|
+
joinedCellId: Id,
|
|
911
|
+
): Cell<any, any, any> | undefined;
|
|
894
912
|
};
|
|
895
913
|
|
|
896
914
|
/**
|
|
@@ -1107,6 +1125,21 @@ export type Select<
|
|
|
1107
1125
|
joinedTableId: JoinedTableId,
|
|
1108
1126
|
joinedCellId: JoinedCellIdOrId<Schema, JoinedTableId>,
|
|
1109
1127
|
): SelectedAs;
|
|
1128
|
+
/**
|
|
1129
|
+
* Calling this function with three parameters (where the first is `true`)
|
|
1130
|
+
* will indicate that the query should select the value of the specified Cell
|
|
1131
|
+
* from a query result that has been joined in the query.
|
|
1132
|
+
* @param asQuery A flag indicating that the next Id is a query Id.
|
|
1133
|
+
* @param joinedQueryId The Id of the query result to fetch the value from. If
|
|
1134
|
+
* the underlying query result was joined 'as' a different Id, that should
|
|
1135
|
+
* instead be used.
|
|
1136
|
+
* @param joinedCellId The Id of the Cell to fetch the value for.
|
|
1137
|
+
* @returns A SelectedAs object so that the selected Cell Id can be optionally
|
|
1138
|
+
* aliased.
|
|
1139
|
+
* @category Definition
|
|
1140
|
+
* @since v8.3.0
|
|
1141
|
+
*/
|
|
1142
|
+
(asQuery: true, joinedQueryId: Id, joinedCellId: Id): SelectedAs;
|
|
1110
1143
|
/**
|
|
1111
1144
|
* Calling this function with one callback parameter will indicate that the
|
|
1112
1145
|
* query should select a calculated value, based on one or more Cell values in
|
|
@@ -1377,6 +1410,24 @@ export type Join<
|
|
|
1377
1410
|
joinedTableId: TableIdFromSchema<Schema>,
|
|
1378
1411
|
on: CellIdFromSchema<Schema, RootTableId>,
|
|
1379
1412
|
): JoinedAs;
|
|
1413
|
+
/**
|
|
1414
|
+
* Calling this function with three parameters (where the first is `true`)
|
|
1415
|
+
* will indicate that the join to a Row in an adjacent query result is made
|
|
1416
|
+
* by finding its Id in a Cell of the query's root Table.
|
|
1417
|
+
* @param asQuery A flag indicating that the next Id is a query Id.
|
|
1418
|
+
* @param joinedQueryId The Id of the query result to join to.
|
|
1419
|
+
* @param on The Id of the Cell in the root Table that contains the joined
|
|
1420
|
+
* query result's Row Id.
|
|
1421
|
+
* @returns A JoinedAs object so that the joined Table Id can be optionally
|
|
1422
|
+
* aliased.
|
|
1423
|
+
* @category Definition
|
|
1424
|
+
* @since v8.3.0
|
|
1425
|
+
*/
|
|
1426
|
+
(
|
|
1427
|
+
asQuery: true,
|
|
1428
|
+
joinedQueryId: Id,
|
|
1429
|
+
on: CellIdFromSchema<Schema, RootTableId>,
|
|
1430
|
+
): JoinedAs;
|
|
1380
1431
|
/**
|
|
1381
1432
|
* Calling this function with two parameters (where the second is a function)
|
|
1382
1433
|
* will indicate that the join to a Row in an adjacent Table is made by
|
|
@@ -1394,6 +1445,26 @@ export type Join<
|
|
|
1394
1445
|
joinedTableId: TableIdFromSchema<Schema>,
|
|
1395
1446
|
on: (getCell: GetCell<Schema, RootTableId>, rowId: Id) => Id | undefined,
|
|
1396
1447
|
): JoinedAs;
|
|
1448
|
+
/**
|
|
1449
|
+
* Calling this function with three parameters (where the first is `true` and
|
|
1450
|
+
* the third is a function) will indicate that the join to a Row in an
|
|
1451
|
+
* adjacent query result is made by calculating its Id from the Cells and the
|
|
1452
|
+
* Row Id of the query's root Table.
|
|
1453
|
+
* @param asQuery A flag indicating that the next Id is a query Id.
|
|
1454
|
+
* @param joinedQueryId The Id of the query result to join to.
|
|
1455
|
+
* @param on A callback that takes a GetCell function and the root Table's Row
|
|
1456
|
+
* Id. These can be used to programmatically calculate the joined query
|
|
1457
|
+
* result's Row Id.
|
|
1458
|
+
* @returns A JoinedAs object so that the joined Table Id can be optionally
|
|
1459
|
+
* aliased.
|
|
1460
|
+
* @category Definition
|
|
1461
|
+
* @since v8.3.0
|
|
1462
|
+
*/
|
|
1463
|
+
(
|
|
1464
|
+
asQuery: true,
|
|
1465
|
+
joinedQueryId: Id,
|
|
1466
|
+
on: (getCell: GetCell<Schema, RootTableId>, rowId: Id) => Id | undefined,
|
|
1467
|
+
): JoinedAs;
|
|
1397
1468
|
/**
|
|
1398
1469
|
* Calling this function with three Id parameters will indicate that the join
|
|
1399
1470
|
* to a Row in distant Table is made by finding its Id in a Cell of an
|
|
@@ -1422,6 +1493,36 @@ export type Join<
|
|
|
1422
1493
|
fromIntermediateJoinedTableId: IntermediateJoinedTableId,
|
|
1423
1494
|
on: IntermediateJoinedCellId,
|
|
1424
1495
|
): JoinedAs;
|
|
1496
|
+
/**
|
|
1497
|
+
* Calling this function with four parameters (where the first is `true`)
|
|
1498
|
+
* will indicate that the join to a Row in a distant query result is made by
|
|
1499
|
+
* finding its Id in a Cell of an intermediately joined Table.
|
|
1500
|
+
* @param asQuery A flag indicating that the next Id is a query Id.
|
|
1501
|
+
* @param joinedQueryId The Id of the distant query result to join to.
|
|
1502
|
+
* @param fromIntermediateJoinedTableId The Id of an intermediate Table (which
|
|
1503
|
+
* should have been in turn joined to the main query table via other Join
|
|
1504
|
+
* clauses).
|
|
1505
|
+
* @param on The Id of the Cell in the intermediate Table that contains the
|
|
1506
|
+
* joined query result's Row Id.
|
|
1507
|
+
* @returns A JoinedAs object so that the joined Table Id can be optionally
|
|
1508
|
+
* aliased.
|
|
1509
|
+
* @category Definition
|
|
1510
|
+
* @since v8.3.0
|
|
1511
|
+
*/
|
|
1512
|
+
<
|
|
1513
|
+
IntermediateJoinedTableId extends TableIdFromSchema<Schema> | Id =
|
|
1514
|
+
| TableIdFromSchema<Schema>
|
|
1515
|
+
| Id,
|
|
1516
|
+
IntermediateJoinedCellId extends JoinedCellIdOrId<
|
|
1517
|
+
Schema,
|
|
1518
|
+
IntermediateJoinedTableId
|
|
1519
|
+
> = JoinedCellIdOrId<Schema, IntermediateJoinedTableId>,
|
|
1520
|
+
>(
|
|
1521
|
+
asQuery: true,
|
|
1522
|
+
joinedQueryId: Id,
|
|
1523
|
+
fromIntermediateJoinedTableId: IntermediateJoinedTableId,
|
|
1524
|
+
on: IntermediateJoinedCellId,
|
|
1525
|
+
): JoinedAs;
|
|
1425
1526
|
/**
|
|
1426
1527
|
* Calling this function with three parameters (where the third is a function)
|
|
1427
1528
|
* will indicate that the join to a Row in distant Table is made by
|
|
@@ -1455,6 +1556,41 @@ export type Join<
|
|
|
1455
1556
|
intermediateJoinedRowId: Id,
|
|
1456
1557
|
) => Id | undefined,
|
|
1457
1558
|
): JoinedAs;
|
|
1559
|
+
/**
|
|
1560
|
+
* Calling this function with four parameters (where the first is `true` and
|
|
1561
|
+
* the fourth is a function) will indicate that the join to a Row in a
|
|
1562
|
+
* distant query result is made by calculating its Id from the Cells and the
|
|
1563
|
+
* Row Id of an intermediately joined Table.
|
|
1564
|
+
* @param asQuery A flag indicating that the next Id is a query Id.
|
|
1565
|
+
* @param joinedQueryId The Id of the query result to join to.
|
|
1566
|
+
* @param fromIntermediateJoinedTableId The Id of an intermediate Table (which
|
|
1567
|
+
* should have been in turn joined to the main query table via other Join
|
|
1568
|
+
* clauses).
|
|
1569
|
+
* @param on A callback that takes a GetCell function and the intermediate
|
|
1570
|
+
* Table's Row Id. These can be used to programmatically calculate the joined
|
|
1571
|
+
* query result's Row Id.
|
|
1572
|
+
* @returns A JoinedAs object so that the joined Table Id can be optionally
|
|
1573
|
+
* aliased.
|
|
1574
|
+
* @category Definition
|
|
1575
|
+
* @since v8.3.0
|
|
1576
|
+
*/
|
|
1577
|
+
<
|
|
1578
|
+
IntermediateJoinedTableId extends TableIdFromSchema<Schema> | Id =
|
|
1579
|
+
| TableIdFromSchema<Schema>
|
|
1580
|
+
| Id,
|
|
1581
|
+
>(
|
|
1582
|
+
asQuery: true,
|
|
1583
|
+
joinedQueryId: Id,
|
|
1584
|
+
fromIntermediateJoinedTableId: IntermediateJoinedTableId,
|
|
1585
|
+
on: (
|
|
1586
|
+
// prettier-ignore
|
|
1587
|
+
getIntermediateJoinedCell:
|
|
1588
|
+
IntermediateJoinedTableId extends TableIdFromSchema<Schema>
|
|
1589
|
+
? GetCell<Schema, IntermediateJoinedTableId>
|
|
1590
|
+
: GetCell<NoTablesSchema, Id>,
|
|
1591
|
+
intermediateJoinedRowId: Id,
|
|
1592
|
+
) => Id | undefined,
|
|
1593
|
+
): JoinedAs;
|
|
1458
1594
|
};
|
|
1459
1595
|
|
|
1460
1596
|
/**
|
|
@@ -1680,6 +1816,26 @@ export type Where<
|
|
|
1680
1816
|
joinedCellId: JoinedCellId,
|
|
1681
1817
|
equals: JoinedCell,
|
|
1682
1818
|
): void;
|
|
1819
|
+
/**
|
|
1820
|
+
* Calling this function with four parameters (where the first is `true`) is
|
|
1821
|
+
* used to include only those Rows for which a specified Cell in a joined
|
|
1822
|
+
* query result has a specified value.
|
|
1823
|
+
* @param asQuery A flag indicating that the next Id is a query Id.
|
|
1824
|
+
* @param joinedQueryId The Id of the joined query result to test a value in.
|
|
1825
|
+
* If the underlying query result was joined 'as' a different Id, that should
|
|
1826
|
+
* instead be used.
|
|
1827
|
+
* @param joinedCellId The Id of the Cell in the joined query result to test.
|
|
1828
|
+
* @param equals The value that the Cell has to have for the Row to be
|
|
1829
|
+
* included in the result.
|
|
1830
|
+
* @category Definition
|
|
1831
|
+
* @since v8.3.0
|
|
1832
|
+
*/
|
|
1833
|
+
(
|
|
1834
|
+
asQuery: true,
|
|
1835
|
+
joinedQueryId: Id,
|
|
1836
|
+
joinedCellId: Id,
|
|
1837
|
+
equals: Cell<any, any, any>,
|
|
1838
|
+
): void;
|
|
1683
1839
|
/**
|
|
1684
1840
|
* Calling this function with one callback parameter is used to include only
|
|
1685
1841
|
* those Rows which meet a calculated boolean condition, based on values in
|
|
@@ -2114,6 +2270,20 @@ export interface Queries<in out Schemas extends OptionalSchemas> {
|
|
|
2114
2270
|
* }) => void,
|
|
2115
2271
|
* paramValues?: ParamValues,
|
|
2116
2272
|
* ): Queries;
|
|
2273
|
+
* setQueryDefinition(
|
|
2274
|
+
* queryId: Id,
|
|
2275
|
+
* asQuery: true,
|
|
2276
|
+
* rootQueryId: Id,
|
|
2277
|
+
* query: (keywords: {
|
|
2278
|
+
* select: Select;
|
|
2279
|
+
* join: Join;
|
|
2280
|
+
* where: Where;
|
|
2281
|
+
* group: Group;
|
|
2282
|
+
* having: Having;
|
|
2283
|
+
* param: Param;
|
|
2284
|
+
* }) => void,
|
|
2285
|
+
* paramValues?: ParamValues,
|
|
2286
|
+
* ): Queries;
|
|
2117
2287
|
* ```
|
|
2118
2288
|
*
|
|
2119
2289
|
* Every query definition is identified by a unique Id, and if you re-use an
|
|
@@ -2192,6 +2362,20 @@ export interface Queries<in out Schemas extends OptionalSchemas> {
|
|
|
2192
2362
|
}) => void,
|
|
2193
2363
|
paramValues?: ParamValues,
|
|
2194
2364
|
): Queries<Schemas>;
|
|
2365
|
+
setQueryDefinition(
|
|
2366
|
+
queryId: Id,
|
|
2367
|
+
asQuery: true,
|
|
2368
|
+
rootQueryId: Id,
|
|
2369
|
+
query: (keywords: {
|
|
2370
|
+
select: Select<any, any>;
|
|
2371
|
+
join: Join<any, any>;
|
|
2372
|
+
where: Where<any, any>;
|
|
2373
|
+
group: Group;
|
|
2374
|
+
having: Having;
|
|
2375
|
+
param: Param;
|
|
2376
|
+
}) => void,
|
|
2377
|
+
paramValues?: ParamValues,
|
|
2378
|
+
): Queries<Schemas>;
|
|
2195
2379
|
|
|
2196
2380
|
/**
|
|
2197
2381
|
* The delQueryDefinition method removes an existing query definition.
|