@@ -12,8 +12,6 @@ import {
1212
1313export type SelectQueryError < Message extends string > = { error : true } & Message
1414
15- type AsString < T > = T extends string ? T : ''
16-
1715type RequireHintingSelectQueryError <
1816 DistantName extends string ,
1917 RelationName extends string
@@ -207,7 +205,7 @@ export type ResolveRelationship<
207205 Schema extends GenericSchema ,
208206 Relationships extends GenericRelationship [ ] ,
209207 Field extends Ast . FieldNode ,
210- CurrentTableOrView extends keyof TablesAndViews < Schema >
208+ CurrentTableOrView extends keyof TablesAndViews < Schema > & string
211209> = ResolveReverseRelationship <
212210 Schema ,
213211 Relationships ,
@@ -387,7 +385,7 @@ type FilterRelationships<R, TName, From> = R extends readonly (infer Rel)[]
387385type ResolveForwardRelationship <
388386 Schema extends GenericSchema ,
389387 Field extends Ast . FieldNode ,
390- CurrentTableOrView extends keyof TablesAndViews < Schema >
388+ CurrentTableOrView extends keyof TablesAndViews < Schema > & string
391389> = FindFieldMatchingRelationships <
392390 Schema ,
393391 TablesAndViews < Schema > [ Field [ 'name' ] ] [ 'Relationships' ] ,
@@ -432,7 +430,7 @@ type ResolveForwardRelationship<
432430 from : CurrentTableOrView
433431 type : 'found-by-join-table'
434432 }
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' ] } `>
436434
437435/**
438436 * Given a CurrentTableOrView, finds all join tables to this relation.
@@ -454,7 +452,7 @@ type ResolveForwardRelationship<
454452 */
455453export type FindJoinTableRelationship <
456454 Schema extends GenericSchema ,
457- CurrentTableOrView extends keyof TablesAndViews < Schema > ,
455+ CurrentTableOrView extends keyof TablesAndViews < Schema > & string ,
458456 FieldName extends string
459457> = {
460458 [ TableName in keyof TablesAndViews < Schema > ] : TablesAndViews < Schema > [ TableName ] [ 'Relationships' ] extends readonly ( infer Rel ) [ ]
0 commit comments