@@ -54,24 +54,21 @@ export const tmpDirDisposal = {
5454 * output and results.
5555 */
5656export class QueryEvaluatonInfo {
57- private static nextQueryId = 0 ;
58-
5957 readonly compiledQueryPath : string ;
6058 readonly dilPath : string ;
6159 readonly csvPath : string ;
6260 readonly resultsPaths : ResultsPaths ;
6361 readonly dataset : Uri ; // guarantee the existence of a well-defined dataset dir at this point
64- readonly queryID : number ;
6562
6663 constructor (
64+ public readonly queryID : number ,
6765 public readonly program : messages . QlProgram ,
6866 public readonly dbItem : DatabaseItem ,
6967 public readonly queryDbscheme : string , // the dbscheme file the query expects, based on library path resolution
7068 public readonly quickEvalPosition ?: messages . Position ,
7169 public readonly metadata ?: QueryMetadata ,
72- public readonly templates ?: messages . TemplateDefinitions ,
70+ public readonly templates ?: messages . TemplateDefinitions
7371 ) {
74- this . queryID = QueryEvaluatonInfo . nextQueryId ++ ;
7572 this . compiledQueryPath = path . join ( tmpDir . name , `compiledQuery${ this . queryID } .qlo` ) ;
7673 this . dilPath = path . join ( tmpDir . name , `results${ this . queryID } .dil` ) ;
7774 this . csvPath = path . join ( tmpDir . name , `results${ this . queryID } .csv` ) ;
@@ -617,7 +614,7 @@ export async function compileAndRunQueryAgainstDatabase(
617614 }
618615 }
619616
620- const query = new QueryEvaluatonInfo ( qlProgram , db , packConfig . dbscheme , initialInfo . quickEvalPosition , metadata , templates ) ;
617+ const query = new QueryEvaluatonInfo ( initialInfo . id , qlProgram , db , packConfig . dbscheme , initialInfo . quickEvalPosition , metadata , templates ) ;
621618
622619 const upgradeDir = await tmp . dir ( { dir : upgradesTmpDir . name , unsafeCleanup : true } ) ;
623620 try {
@@ -688,6 +685,7 @@ export async function compileAndRunQueryAgainstDatabase(
688685 }
689686}
690687
688+ let queryId = 0 ;
691689export async function createInitialQueryInfo (
692690 selectedQueryUri : Uri | undefined ,
693691 databaseInfo : DatabaseInfo ,
@@ -701,9 +699,10 @@ export async function createInitialQueryInfo(
701699 isQuickEval,
702700 isQuickQuery : isQuickQueryPath ( queryPath ) ,
703701 databaseInfo,
702+ id : queryId ++ ,
704703 start : new Date ( ) ,
705704 ... ( isQuickEval ? {
706- queryText : quickEvalText ,
705+ queryText : quickEvalText ! , // if this query is quick eval, it must have quick eval text
707706 quickEvalPosition : quickEvalPosition
708707 } : {
709708 queryText : await fs . readFile ( queryPath , 'utf8' )
0 commit comments