@@ -12,8 +12,6 @@ import {
12
12
13
13
export type SelectQueryError < Message extends string > = { error : true } & Message
14
14
15
- type AsString < T > = T extends string ? T : ''
16
-
17
15
type RequireHintingSelectQueryError <
18
16
DistantName extends string ,
19
17
RelationName extends string
@@ -207,7 +205,7 @@ export type ResolveRelationship<
207
205
Schema extends GenericSchema ,
208
206
Relationships extends GenericRelationship [ ] ,
209
207
Field extends Ast . FieldNode ,
210
- CurrentTableOrView extends keyof TablesAndViews < Schema >
208
+ CurrentTableOrView extends keyof TablesAndViews < Schema > & string
211
209
> = ResolveReverseRelationship <
212
210
Schema ,
213
211
Relationships ,
@@ -387,7 +385,7 @@ type FilterRelationships<R, TName, From> = R extends readonly (infer Rel)[]
387
385
type ResolveForwardRelationship <
388
386
Schema extends GenericSchema ,
389
387
Field extends Ast . FieldNode ,
390
- CurrentTableOrView extends keyof TablesAndViews < Schema >
388
+ CurrentTableOrView extends keyof TablesAndViews < Schema > & string
391
389
> = FindFieldMatchingRelationships <
392
390
Schema ,
393
391
TablesAndViews < Schema > [ Field [ 'name' ] ] [ 'Relationships' ] ,
@@ -432,7 +430,7 @@ type ResolveForwardRelationship<
432
430
from : CurrentTableOrView
433
431
type : 'found-by-join-table'
434
432
}
435
- : SelectQueryError < `could not find the relation between ${AsString < CurrentTableOrView > } and ${Field [ 'name' ] } `>
433
+ : SelectQueryError < `could not find the relation between ${CurrentTableOrView } and ${Field [ 'name' ] } `>
436
434
437
435
/**
438
436
* Given a CurrentTableOrView, finds all join tables to this relation.
@@ -454,7 +452,7 @@ type ResolveForwardRelationship<
454
452
*/
455
453
export type FindJoinTableRelationship <
456
454
Schema extends GenericSchema ,
457
- CurrentTableOrView extends keyof TablesAndViews < Schema > ,
455
+ CurrentTableOrView extends keyof TablesAndViews < Schema > & string ,
458
456
FieldName extends string
459
457
> = {
460
458
[ TableName in keyof TablesAndViews < Schema > ] : TablesAndViews < Schema > [ TableName ] [ 'Relationships' ] extends readonly ( infer Rel ) [ ]
0 commit comments