@@ -37,7 +37,7 @@ export interface SqlParameterQueryOptions {
3737 inputParameters : InputParameter [ ] ;
3838 expandedInputParameter : InputParameter | undefined ;
3939 bucketParameters : string [ ] ;
40- id : string ;
40+ queryId : string ;
4141 tools : SqlTools ;
4242 errors ?: SqlRuleError [ ] ;
4343}
@@ -178,7 +178,7 @@ export class SqlParameterQuery {
178178 inputParameters : filter . inputParameters ,
179179 expandedInputParameter : expandedParams [ 0 ] ,
180180 bucketParameters,
181- id : queryId ,
181+ queryId,
182182 tools,
183183 errors
184184 } ) ;
@@ -263,7 +263,14 @@ export class SqlParameterQuery {
263263 */
264264 readonly bucketParameters : string [ ] ;
265265
266- readonly id : string ;
266+ /**
267+ * Unique identifier for this query within a bucket definition.
268+ *
269+ * Typically auto-generated based on query order.
270+ *
271+ * This is used when persisting lookup values.
272+ */
273+ readonly queryId : string ;
267274 readonly tools : SqlTools ;
268275
269276 readonly errors : SqlRuleError [ ] ;
@@ -280,7 +287,7 @@ export class SqlParameterQuery {
280287 this . inputParameters = options . inputParameters ;
281288 this . expandedInputParameter = options . expandedInputParameter ;
282289 this . bucketParameters = options . bucketParameters ;
283- this . id = options . id ;
290+ this . queryId = options . queryId ;
284291 this . tools = options . tools ;
285292 this . errors = options . errors ?? [ ] ;
286293 }
@@ -300,7 +307,7 @@ export class SqlParameterQuery {
300307 const filterParameters = this . filter . filterRow ( tables ) ;
301308 let result : EvaluatedParametersResult [ ] = [ ] ;
302309 for ( let filterParamSet of filterParameters ) {
303- let lookup : SqliteJsonValue [ ] = [ this . descriptorName , this . id ] ;
310+ let lookup : SqliteJsonValue [ ] = [ this . descriptorName , this . queryId ] ;
304311 lookup . push (
305312 ...this . inputParameters . map ( ( param ) => {
306313 return normalizeParameterValue ( param . filteredRowToLookupValue ( filterParamSet ) ) ;
@@ -374,7 +381,7 @@ export class SqlParameterQuery {
374381 */
375382 getLookups ( parameters : RequestParameters ) : ParameterLookup [ ] {
376383 if ( ! this . expandedInputParameter ) {
377- let lookup : SqliteJsonValue [ ] = [ this . descriptorName , this . id ] ;
384+ let lookup : SqliteJsonValue [ ] = [ this . descriptorName , this . queryId ] ;
378385
379386 let valid = true ;
380387 lookup . push (
@@ -412,7 +419,7 @@ export class SqlParameterQuery {
412419
413420 return values
414421 . map ( ( expandedValue ) => {
415- let lookup : SqliteJsonValue [ ] = [ this . descriptorName , this . id ] ;
422+ let lookup : SqliteJsonValue [ ] = [ this . descriptorName , this . queryId ] ;
416423 let valid = true ;
417424 const normalizedExpandedValue = normalizeParameterValue ( expandedValue ) ;
418425 lookup . push (
0 commit comments