@supabase/postgrest-js 1.17.1 → 1.17.3
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/dist/cjs/select-query-parser/parser.d.ts +17 -35
- package/dist/cjs/select-query-parser/parser.d.ts.map +1 -1
- package/dist/cjs/select-query-parser/result.d.ts +7 -7
- package/dist/cjs/select-query-parser/result.d.ts.map +1 -1
- package/dist/cjs/select-query-parser/utils.d.ts +43 -42
- package/dist/cjs/select-query-parser/utils.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/select-query-parser/parser.ts +58 -54
- package/src/select-query-parser/result.ts +63 -39
- package/src/select-query-parser/utils.ts +197 -178
- package/src/version.ts +1 -1
|
@@ -38,27 +38,24 @@ type ResolveRelationships<
|
|
|
38
38
|
Relationships extends GenericRelationship[],
|
|
39
39
|
Nodes extends Ast.FieldNode[]
|
|
40
40
|
> = UnionToArray<{
|
|
41
|
-
[K in keyof Nodes]:
|
|
42
|
-
Schema,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
foreignKeyName: any
|
|
51
|
-
match: any
|
|
52
|
-
}
|
|
53
|
-
from: any
|
|
54
|
-
}
|
|
55
|
-
? {
|
|
56
|
-
referencedTable: Relation['relation']['referencedRelation']
|
|
57
|
-
fkName: Relation['relation']['foreignKeyName']
|
|
58
|
-
from: Relation['from']
|
|
59
|
-
match: Relation['relation']['match']
|
|
60
|
-
fieldName: GetFieldNodeResultName<Nodes[K]>
|
|
41
|
+
[K in keyof Nodes]: Nodes[K] extends Ast.FieldNode
|
|
42
|
+
? ResolveRelationship<Schema, Relationships, Nodes[K], RelationName> extends infer Relation
|
|
43
|
+
? Relation extends {
|
|
44
|
+
relation: {
|
|
45
|
+
referencedRelation: string
|
|
46
|
+
foreignKeyName: string
|
|
47
|
+
match: string
|
|
48
|
+
}
|
|
49
|
+
from: string
|
|
61
50
|
}
|
|
51
|
+
? {
|
|
52
|
+
referencedTable: Relation['relation']['referencedRelation']
|
|
53
|
+
fkName: Relation['relation']['foreignKeyName']
|
|
54
|
+
from: Relation['from']
|
|
55
|
+
match: Relation['relation']['match']
|
|
56
|
+
fieldName: GetFieldNodeResultName<Nodes[K]>
|
|
57
|
+
}
|
|
58
|
+
: Relation
|
|
62
59
|
: never
|
|
63
60
|
: never
|
|
64
61
|
}>[0]
|
|
@@ -69,10 +66,12 @@ type ResolveRelationships<
|
|
|
69
66
|
type IsDoubleReference<T, U> = T extends {
|
|
70
67
|
referencedTable: infer RT
|
|
71
68
|
fieldName: infer FN
|
|
72
|
-
match: infer M
|
|
69
|
+
match: infer M
|
|
73
70
|
}
|
|
74
|
-
?
|
|
75
|
-
?
|
|
71
|
+
? M extends 'col' | 'refrel'
|
|
72
|
+
? U extends { referencedTable: RT; fieldName: FN; match: M }
|
|
73
|
+
? true
|
|
74
|
+
: false
|
|
76
75
|
: false
|
|
77
76
|
: false
|
|
78
77
|
|
|
@@ -97,21 +96,25 @@ export type CheckDuplicateEmbededReference<
|
|
|
97
96
|
RelationName extends string,
|
|
98
97
|
Relationships extends GenericRelationship[],
|
|
99
98
|
Nodes extends Ast.Node[]
|
|
100
|
-
> = FilterRelationNodes<Nodes> extends infer RelationsNodes
|
|
101
|
-
?
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
?
|
|
109
|
-
?
|
|
110
|
-
?
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
99
|
+
> = FilterRelationNodes<Nodes> extends infer RelationsNodes
|
|
100
|
+
? RelationsNodes extends Ast.FieldNode[]
|
|
101
|
+
? ResolveRelationships<
|
|
102
|
+
Schema,
|
|
103
|
+
RelationName,
|
|
104
|
+
Relationships,
|
|
105
|
+
RelationsNodes
|
|
106
|
+
> extends infer ResolvedRels
|
|
107
|
+
? ResolvedRels extends unknown[]
|
|
108
|
+
? FindDuplicates<ResolvedRels> extends infer Duplicates
|
|
109
|
+
? Duplicates extends never
|
|
110
|
+
? false
|
|
111
|
+
: Duplicates extends { fieldName: infer FieldName }
|
|
112
|
+
? FieldName extends string
|
|
113
|
+
? {
|
|
114
|
+
[K in FieldName]: SelectQueryError<`table "${RelationName}" specified more than once use hinting for desambiguation`>
|
|
115
|
+
}
|
|
116
|
+
: false
|
|
117
|
+
: false
|
|
115
118
|
: false
|
|
116
119
|
: false
|
|
117
120
|
: false
|
|
@@ -155,33 +158,38 @@ type CheckRelationshipError<
|
|
|
155
158
|
: // If the relation is a reverse relation with no hint (matching by name)
|
|
156
159
|
FoundRelation extends {
|
|
157
160
|
relation: {
|
|
158
|
-
referencedRelation: infer RelatedRelationName
|
|
161
|
+
referencedRelation: infer RelatedRelationName
|
|
159
162
|
name: string
|
|
160
163
|
}
|
|
161
164
|
direction: 'reverse'
|
|
162
165
|
}
|
|
163
|
-
?
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
166
|
+
? RelatedRelationName extends string
|
|
167
|
+
? // We check if there is possible confusion with other relations with this table
|
|
168
|
+
HasMultipleFKeysToFRel<RelatedRelationName, Relationships> extends true
|
|
169
|
+
? // If there is, postgrest will fail at runtime, and require desambiguation via hinting
|
|
170
|
+
SelectQueryError<`Could not embed because more than one relationship was found for '${RelatedRelationName}' and '${CurrentTableOrView}' you need to hint the column with ${RelatedRelationName}!<columnName> ?`>
|
|
171
|
+
: FoundRelation
|
|
172
|
+
: never
|
|
168
173
|
: // Same check for forward relationships, but we must gather the relationships from the found relation
|
|
169
174
|
FoundRelation extends {
|
|
170
175
|
relation: {
|
|
171
|
-
referencedRelation: infer RelatedRelationName
|
|
176
|
+
referencedRelation: infer RelatedRelationName
|
|
172
177
|
name: string
|
|
173
178
|
}
|
|
174
179
|
direction: 'forward'
|
|
175
|
-
from: infer From
|
|
180
|
+
from: infer From
|
|
176
181
|
}
|
|
177
|
-
?
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
182
|
+
? RelatedRelationName extends string
|
|
183
|
+
? From extends keyof TablesAndViews<Schema> & string
|
|
184
|
+
? HasMultipleFKeysToFRel<
|
|
185
|
+
RelatedRelationName,
|
|
186
|
+
TablesAndViews<Schema>[From]['Relationships']
|
|
187
|
+
> extends true
|
|
188
|
+
? SelectQueryError<`Could not embed because more than one relationship was found for '${From}' and '${RelatedRelationName}' you need to hint the column with ${From}!<columnName> ?`>
|
|
189
|
+
: FoundRelation
|
|
190
|
+
: never
|
|
191
|
+
: never
|
|
183
192
|
: FoundRelation
|
|
184
|
-
|
|
185
193
|
/**
|
|
186
194
|
* Resolves relationships for embedded resources and retrieves the referenced Table
|
|
187
195
|
*/
|
|
@@ -217,26 +225,28 @@ type ResolveReverseRelationship<
|
|
|
217
225
|
> = FindFieldMatchingRelationships<Schema, Relationships, Field> extends infer FoundRelation
|
|
218
226
|
? FoundRelation extends never
|
|
219
227
|
? false
|
|
220
|
-
: FoundRelation extends { referencedRelation: infer RelatedRelationName
|
|
221
|
-
? RelatedRelationName extends
|
|
222
|
-
?
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
228
|
+
: FoundRelation extends { referencedRelation: infer RelatedRelationName }
|
|
229
|
+
? RelatedRelationName extends string
|
|
230
|
+
? RelatedRelationName extends keyof TablesAndViews<Schema>
|
|
231
|
+
? // If the relation was found via hinting we just return it without any more checks
|
|
232
|
+
FoundRelation extends { hint: string }
|
|
233
|
+
? {
|
|
234
|
+
referencedTable: TablesAndViews<Schema>[RelatedRelationName]
|
|
235
|
+
relation: FoundRelation
|
|
236
|
+
direction: 'reverse'
|
|
237
|
+
from: CurrentTableOrView
|
|
238
|
+
}
|
|
239
|
+
: // If the relation was found via implicit relation naming, we must ensure there is no conflicting matches
|
|
240
|
+
HasMultipleFKeysToFRel<RelatedRelationName, Relationships> extends true
|
|
241
|
+
? SelectQueryError<`Could not embed because more than one relationship was found for '${RelatedRelationName}' and '${CurrentTableOrView}' you need to hint the column with ${RelatedRelationName}!<columnName> ?`>
|
|
242
|
+
: {
|
|
243
|
+
referencedTable: TablesAndViews<Schema>[RelatedRelationName]
|
|
244
|
+
relation: FoundRelation
|
|
245
|
+
direction: 'reverse'
|
|
246
|
+
from: CurrentTableOrView
|
|
247
|
+
}
|
|
248
|
+
: SelectQueryError<`Relation '${RelatedRelationName}' not found in schema.`>
|
|
249
|
+
: false
|
|
240
250
|
: false
|
|
241
251
|
: false
|
|
242
252
|
|
|
@@ -244,17 +254,19 @@ export type FindMatchingTableRelationships<
|
|
|
244
254
|
Schema extends GenericSchema,
|
|
245
255
|
Relationships extends GenericRelationship[],
|
|
246
256
|
value extends string
|
|
247
|
-
> = Relationships extends [infer R, ...infer Rest
|
|
248
|
-
?
|
|
249
|
-
?
|
|
250
|
-
?
|
|
251
|
-
? R
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
257
|
+
> = Relationships extends [infer R, ...infer Rest]
|
|
258
|
+
? Rest extends GenericRelationship[]
|
|
259
|
+
? R extends { referencedRelation: infer ReferencedRelation }
|
|
260
|
+
? ReferencedRelation extends keyof Schema['Tables']
|
|
261
|
+
? R extends { foreignKeyName: value }
|
|
262
|
+
? R & { match: 'fkname' }
|
|
263
|
+
: R extends { referencedRelation: value }
|
|
264
|
+
? R & { match: 'refrel' }
|
|
265
|
+
: R extends { columns: [value] }
|
|
266
|
+
? R & { match: 'col' }
|
|
267
|
+
: FindMatchingTableRelationships<Schema, Rest, value>
|
|
256
268
|
: FindMatchingTableRelationships<Schema, Rest, value>
|
|
257
|
-
:
|
|
269
|
+
: false
|
|
258
270
|
: false
|
|
259
271
|
: false
|
|
260
272
|
|
|
@@ -262,17 +274,19 @@ export type FindMatchingViewRelationships<
|
|
|
262
274
|
Schema extends GenericSchema,
|
|
263
275
|
Relationships extends GenericRelationship[],
|
|
264
276
|
value extends string
|
|
265
|
-
> = Relationships extends [infer R, ...infer Rest
|
|
266
|
-
?
|
|
267
|
-
?
|
|
268
|
-
?
|
|
269
|
-
? R
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
277
|
+
> = Relationships extends [infer R, ...infer Rest]
|
|
278
|
+
? Rest extends GenericRelationship[]
|
|
279
|
+
? R extends { referencedRelation: infer ReferencedRelation }
|
|
280
|
+
? ReferencedRelation extends keyof Schema['Views']
|
|
281
|
+
? R extends { foreignKeyName: value }
|
|
282
|
+
? R & { match: 'fkname' }
|
|
283
|
+
: R extends { referencedRelation: value }
|
|
284
|
+
? R & { match: 'refrel' }
|
|
285
|
+
: R extends { columns: [value] }
|
|
286
|
+
? R & { match: 'col' }
|
|
287
|
+
: FindMatchingViewRelationships<Schema, Rest, value>
|
|
274
288
|
: FindMatchingViewRelationships<Schema, Rest, value>
|
|
275
|
-
:
|
|
289
|
+
: false
|
|
276
290
|
: false
|
|
277
291
|
: false
|
|
278
292
|
|
|
@@ -281,36 +295,39 @@ export type FindMatchingHintTableRelationships<
|
|
|
281
295
|
Relationships extends GenericRelationship[],
|
|
282
296
|
hint extends string,
|
|
283
297
|
name extends string
|
|
284
|
-
> = Relationships extends [infer R, ...infer Rest
|
|
285
|
-
?
|
|
286
|
-
?
|
|
287
|
-
?
|
|
288
|
-
? R
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
298
|
+
> = Relationships extends [infer R, ...infer Rest]
|
|
299
|
+
? Rest extends GenericRelationship[]
|
|
300
|
+
? R extends { referencedRelation: infer ReferencedRelation }
|
|
301
|
+
? ReferencedRelation extends name
|
|
302
|
+
? R extends { foreignKeyName: hint }
|
|
303
|
+
? R & { match: 'fkname' }
|
|
304
|
+
: R extends { referencedRelation: hint }
|
|
305
|
+
? R & { match: 'refrel' }
|
|
306
|
+
: R extends { columns: [hint] }
|
|
307
|
+
? R & { match: 'col' }
|
|
308
|
+
: FindMatchingHintTableRelationships<Schema, Rest, hint, name>
|
|
293
309
|
: FindMatchingHintTableRelationships<Schema, Rest, hint, name>
|
|
294
|
-
:
|
|
310
|
+
: false
|
|
295
311
|
: false
|
|
296
312
|
: false
|
|
297
|
-
|
|
298
313
|
export type FindMatchingHintViewRelationships<
|
|
299
314
|
Schema extends GenericSchema,
|
|
300
315
|
Relationships extends GenericRelationship[],
|
|
301
316
|
hint extends string,
|
|
302
317
|
name extends string
|
|
303
|
-
> = Relationships extends [infer R, ...infer Rest
|
|
304
|
-
?
|
|
305
|
-
?
|
|
306
|
-
?
|
|
307
|
-
? R
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
318
|
+
> = Relationships extends [infer R, ...infer Rest]
|
|
319
|
+
? Rest extends GenericRelationship[]
|
|
320
|
+
? R extends { referencedRelation: infer ReferencedRelation }
|
|
321
|
+
? ReferencedRelation extends name
|
|
322
|
+
? R extends { foreignKeyName: hint }
|
|
323
|
+
? R & { match: 'fkname' }
|
|
324
|
+
: R extends { referencedRelation: hint }
|
|
325
|
+
? R & { match: 'refrel' }
|
|
326
|
+
: R extends { columns: [hint] }
|
|
327
|
+
? R & { match: 'col' }
|
|
328
|
+
: FindMatchingHintViewRelationships<Schema, Rest, hint, name>
|
|
312
329
|
: FindMatchingHintViewRelationships<Schema, Rest, hint, name>
|
|
313
|
-
:
|
|
330
|
+
: false
|
|
314
331
|
: false
|
|
315
332
|
: false
|
|
316
333
|
|
|
@@ -337,8 +354,10 @@ type TableForwardRelationships<
|
|
|
337
354
|
> = TName extends keyof TablesAndViews<Schema>
|
|
338
355
|
? UnionToArray<
|
|
339
356
|
RecursivelyFindRelationships<Schema, TName, keyof TablesAndViews<Schema>>
|
|
340
|
-
> extends infer R
|
|
341
|
-
? R
|
|
357
|
+
> extends infer R
|
|
358
|
+
? R extends (GenericRelationship & { from: keyof TablesAndViews<Schema> })[]
|
|
359
|
+
? R
|
|
360
|
+
: []
|
|
342
361
|
: []
|
|
343
362
|
: []
|
|
344
363
|
|
|
@@ -362,8 +381,7 @@ type FilterRelationships<R, TName, From> = R extends readonly (infer Rel)[]
|
|
|
362
381
|
: never
|
|
363
382
|
: never
|
|
364
383
|
|
|
365
|
-
|
|
366
|
-
type ResolveForwardRelationship<
|
|
384
|
+
export type ResolveForwardRelationship<
|
|
367
385
|
Schema extends GenericSchema,
|
|
368
386
|
Field extends Ast.FieldNode,
|
|
369
387
|
CurrentTableOrView extends keyof TablesAndViews<Schema> & string
|
|
@@ -371,46 +389,46 @@ type ResolveForwardRelationship<
|
|
|
371
389
|
Schema,
|
|
372
390
|
TablesAndViews<Schema>[Field['name']]['Relationships'],
|
|
373
391
|
Ast.FieldNode & { name: CurrentTableOrView; hint: Field['hint'] }
|
|
374
|
-
> extends infer FoundByName
|
|
375
|
-
?
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
}
|
|
392
|
+
> extends infer FoundByName
|
|
393
|
+
? FoundByName extends GenericRelationship
|
|
394
|
+
? {
|
|
395
|
+
referencedTable: TablesAndViews<Schema>[Field['name']]
|
|
396
|
+
relation: FoundByName
|
|
397
|
+
direction: 'forward'
|
|
398
|
+
from: Field['name']
|
|
399
|
+
type: 'found-by-name'
|
|
400
|
+
}
|
|
401
|
+
: FindFieldMatchingRelationships<
|
|
402
|
+
Schema,
|
|
403
|
+
TableForwardRelationships<Schema, CurrentTableOrView>,
|
|
404
|
+
Field
|
|
405
|
+
> extends infer FoundByMatch
|
|
406
|
+
? FoundByMatch extends GenericRelationship & {
|
|
407
|
+
from: keyof TablesAndViews<Schema>
|
|
408
|
+
}
|
|
409
|
+
? {
|
|
410
|
+
referencedTable: TablesAndViews<Schema>[FoundByMatch['from']]
|
|
411
|
+
relation: FoundByMatch
|
|
412
|
+
direction: 'forward'
|
|
413
|
+
from: CurrentTableOrView
|
|
414
|
+
type: 'found-by-match'
|
|
415
|
+
}
|
|
416
|
+
: FindJoinTableRelationship<
|
|
417
|
+
Schema,
|
|
418
|
+
CurrentTableOrView,
|
|
419
|
+
Field['name']
|
|
420
|
+
> extends infer FoundByJoinTable
|
|
421
|
+
? FoundByJoinTable extends GenericRelationship
|
|
422
|
+
? {
|
|
423
|
+
referencedTable: TablesAndViews<Schema>[FoundByJoinTable['referencedRelation']]
|
|
424
|
+
relation: FoundByJoinTable & { match: 'refrel' }
|
|
425
|
+
direction: 'forward'
|
|
426
|
+
from: CurrentTableOrView
|
|
427
|
+
type: 'found-by-join-table'
|
|
428
|
+
}
|
|
429
|
+
: SelectQueryError<`could not find the relation between ${CurrentTableOrView} and ${Field['name']}`>
|
|
430
|
+
: SelectQueryError<`could not find the relation between ${CurrentTableOrView} and ${Field['name']}`>
|
|
431
|
+
: SelectQueryError<`could not find the relation between ${CurrentTableOrView} and ${Field['name']}`>
|
|
414
432
|
: SelectQueryError<`could not find the relation between ${CurrentTableOrView} and ${Field['name']}`>
|
|
415
433
|
|
|
416
434
|
/**
|
|
@@ -431,7 +449,7 @@ type ResolveForwardRelationship<
|
|
|
431
449
|
* referencedColumns: ["id"]
|
|
432
450
|
* }
|
|
433
451
|
*/
|
|
434
|
-
|
|
452
|
+
type ResolveJoinTableRelationship<
|
|
435
453
|
Schema extends GenericSchema,
|
|
436
454
|
CurrentTableOrView extends keyof TablesAndViews<Schema> & string,
|
|
437
455
|
FieldName extends string
|
|
@@ -447,6 +465,15 @@ export type FindJoinTableRelationship<
|
|
|
447
465
|
: never
|
|
448
466
|
}[keyof TablesAndViews<Schema>]
|
|
449
467
|
|
|
468
|
+
export type FindJoinTableRelationship<
|
|
469
|
+
Schema extends GenericSchema,
|
|
470
|
+
CurrentTableOrView extends keyof TablesAndViews<Schema> & string,
|
|
471
|
+
FieldName extends string
|
|
472
|
+
> = ResolveJoinTableRelationship<Schema, CurrentTableOrView, FieldName> extends infer Result
|
|
473
|
+
? [Result] extends [never]
|
|
474
|
+
? false
|
|
475
|
+
: Result
|
|
476
|
+
: never
|
|
450
477
|
/**
|
|
451
478
|
* Finds a matching relationship based on the FieldNode's name and optional hint.
|
|
452
479
|
*/
|
|
@@ -454,43 +481,35 @@ export type FindFieldMatchingRelationships<
|
|
|
454
481
|
Schema extends GenericSchema,
|
|
455
482
|
Relationships extends GenericRelationship[],
|
|
456
483
|
Field extends Ast.FieldNode
|
|
457
|
-
> = Field extends { hint:
|
|
484
|
+
> = Field extends { hint: string }
|
|
458
485
|
? FindMatchingHintTableRelationships<
|
|
459
486
|
Schema,
|
|
460
487
|
Relationships,
|
|
461
|
-
|
|
488
|
+
Field['hint'],
|
|
462
489
|
Field['name']
|
|
463
|
-
> extends
|
|
464
|
-
?
|
|
490
|
+
> extends GenericRelationship
|
|
491
|
+
? FindMatchingHintTableRelationships<Schema, Relationships, Field['hint'], Field['name']> & {
|
|
465
492
|
branch: 'found-in-table-via-hint'
|
|
466
493
|
hint: Field['hint']
|
|
467
494
|
}
|
|
468
495
|
: FindMatchingHintViewRelationships<
|
|
469
496
|
Schema,
|
|
470
497
|
Relationships,
|
|
471
|
-
|
|
498
|
+
Field['hint'],
|
|
472
499
|
Field['name']
|
|
473
|
-
> extends
|
|
474
|
-
?
|
|
500
|
+
> extends GenericRelationship
|
|
501
|
+
? FindMatchingHintViewRelationships<Schema, Relationships, Field['hint'], Field['name']> & {
|
|
475
502
|
branch: 'found-in-view-via-hint'
|
|
476
503
|
hint: Field['hint']
|
|
477
504
|
}
|
|
478
505
|
: SelectQueryError<'Failed to find matching relation via hint'>
|
|
479
|
-
: FindMatchingTableRelationships<
|
|
480
|
-
|
|
481
|
-
Relationships,
|
|
482
|
-
Field['name']
|
|
483
|
-
> extends infer TableRelationViaName extends GenericRelationship
|
|
484
|
-
? TableRelationViaName & {
|
|
506
|
+
: FindMatchingTableRelationships<Schema, Relationships, Field['name']> extends GenericRelationship
|
|
507
|
+
? FindMatchingTableRelationships<Schema, Relationships, Field['name']> & {
|
|
485
508
|
branch: 'found-in-table-via-name'
|
|
486
509
|
name: Field['name']
|
|
487
510
|
}
|
|
488
|
-
: FindMatchingViewRelationships<
|
|
489
|
-
|
|
490
|
-
Relationships,
|
|
491
|
-
Field['name']
|
|
492
|
-
> extends infer ViewRelationViaName extends GenericRelationship
|
|
493
|
-
? ViewRelationViaName & {
|
|
511
|
+
: FindMatchingViewRelationships<Schema, Relationships, Field['name']> extends GenericRelationship
|
|
512
|
+
? FindMatchingViewRelationships<Schema, Relationships, Field['name']> & {
|
|
494
513
|
branch: 'found-in-view-via-name'
|
|
495
514
|
name: Field['name']
|
|
496
515
|
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '1.17.
|
|
1
|
+
export const version = '1.17.3'
|