@@ -65,6 +65,84 @@ function normalizeQueryBuildError(error: unknown): FMODataErrorType {
6565 return new BuilderInvariantError ( "QueryBuilder.execute" , String ( error ) ) ;
6666}
6767
68+ type QueryBuilderHasSelect <
69+ // biome-ignore lint/suspicious/noExplicitAny: Accepts any FMTable configuration
70+ Occ extends FMTable < any , any > ,
71+ Selected ,
72+ > = Selected extends Record < string , Column < any , any , any > > // biome-ignore lint/suspicious/noExplicitAny: Generic constraint accepting any Column configuration
73+ ? true
74+ : Selected extends keyof InferSchemaOutputFromFMTable < Occ >
75+ ? false
76+ : true ;
77+
78+ type BaseQueryBuilderReturn <
79+ // biome-ignore lint/suspicious/noExplicitAny: Accepts any FMTable configuration
80+ Occ extends FMTable < any , any > ,
81+ Selected extends
82+ | keyof InferSchemaOutputFromFMTable < Occ >
83+ // biome-ignore lint/suspicious/noExplicitAny: Generic constraint accepting any Column configuration
84+ | Record < string , Column < any , any , ExtractTableName < Occ > > > ,
85+ SingleMode extends "exact" | "maybe" | false ,
86+ IsCount extends boolean ,
87+ Expands extends ExpandedRelations ,
88+ IncludeCount extends boolean ,
89+ SystemCols extends SystemColumnsOption | undefined ,
90+ > = QueryReturnType <
91+ InferSchemaOutputFromFMTable < Occ > ,
92+ Selected ,
93+ SingleMode ,
94+ IsCount ,
95+ Expands ,
96+ IncludeCount ,
97+ SystemCols
98+ > ;
99+
100+ type ExecutableQueryBuilderReturn <
101+ // biome-ignore lint/suspicious/noExplicitAny: Accepts any FMTable configuration
102+ Occ extends FMTable < any , any > ,
103+ Selected extends
104+ | keyof InferSchemaOutputFromFMTable < Occ >
105+ // biome-ignore lint/suspicious/noExplicitAny: Generic constraint accepting any Column configuration
106+ | Record < string , Column < any , any , ExtractTableName < Occ > > > ,
107+ SingleMode extends "exact" | "maybe" | false ,
108+ IsCount extends boolean ,
109+ Expands extends ExpandedRelations ,
110+ IncludeCount extends boolean ,
111+ SystemCols extends SystemColumnsOption | undefined ,
112+ > =
113+ | ConditionallyWithODataAnnotations <
114+ ConditionallyWithSpecialColumns <
115+ BaseQueryBuilderReturn < Occ , Selected , SingleMode , IsCount , Expands , IncludeCount , SystemCols > ,
116+ true ,
117+ QueryBuilderHasSelect < Occ , Selected >
118+ > ,
119+ true
120+ >
121+ | ConditionallyWithODataAnnotations <
122+ ConditionallyWithSpecialColumns <
123+ BaseQueryBuilderReturn < Occ , Selected , SingleMode , IsCount , Expands , IncludeCount , SystemCols > ,
124+ true ,
125+ QueryBuilderHasSelect < Occ , Selected >
126+ > ,
127+ false
128+ >
129+ | ConditionallyWithODataAnnotations <
130+ ConditionallyWithSpecialColumns <
131+ BaseQueryBuilderReturn < Occ , Selected , SingleMode , IsCount , Expands , IncludeCount , SystemCols > ,
132+ false ,
133+ QueryBuilderHasSelect < Occ , Selected >
134+ > ,
135+ true
136+ >
137+ | ConditionallyWithODataAnnotations <
138+ ConditionallyWithSpecialColumns <
139+ BaseQueryBuilderReturn < Occ , Selected , SingleMode , IsCount , Expands , IncludeCount , SystemCols > ,
140+ false ,
141+ QueryBuilderHasSelect < Occ , Selected >
142+ > ,
143+ false
144+ > ;
145+
68146export class QueryBuilder <
69147 // biome-ignore lint/suspicious/noExplicitAny: Accepts any FMTable configuration
70148 Occ extends FMTable < any , any > ,
@@ -81,15 +159,7 @@ export class QueryBuilder<
81159 SystemCols extends SystemColumnsOption | undefined = undefined ,
82160> implements
83161 ExecutableBuilder <
84- QueryReturnType <
85- InferSchemaOutputFromFMTable < Occ > ,
86- Selected ,
87- SingleMode ,
88- IsCount ,
89- Expands ,
90- IncludeCount ,
91- SystemCols
92- >
162+ ExecutableQueryBuilderReturn < Occ , Selected , SingleMode , IsCount , Expands , IncludeCount , SystemCols >
93163 >
94164{
95165 private readState = createInitialQueryReadBuilderState < InferSchemaOutputFromFMTable < Occ > > ( ) ;
0 commit comments