@@ -38,6 +38,7 @@ import {
3838 CliConfigListener ,
3939 DistributionConfigListener ,
4040 isCanary ,
41+ isNewQueryRunExperienceEnabled ,
4142 isVariantAnalysisLiveResultsEnabled ,
4243 joinOrderWarningThreshold ,
4344 MAX_QUERIES ,
@@ -138,6 +139,7 @@ import { VariantAnalysisResultsManager } from "./remote-queries/variant-analysis
138139import { initializeDbModule } from "./databases/db-module" ;
139140import { ExtensionApp } from "./common/vscode/vscode-app" ;
140141import { RepositoriesFilterSortStateWithIds } from "./pure/variant-analysis-filter-sort" ;
142+ import { AppMode } from "./common/app" ;
141143
142144/**
143145 * extension.ts
@@ -623,9 +625,15 @@ async function activateWithInstalledDistribution(
623625
624626 void extLogger . log ( "Initializing variant analysis manager." ) ;
625627
626- const app = new ExtensionApp ( ctx ) ;
627- const dbModule = await initializeDbModule ( app ) ;
628- ctx . subscriptions . push ( dbModule ) ;
628+ // We only want to initialize the new db panel when the newQueryRunExperience is enabled
629+ let dbModule ;
630+ if ( isCanary ( ) && isNewQueryRunExperienceEnabled ( ) ) {
631+ const app = new ExtensionApp ( ctx ) ;
632+ if ( app . mode === AppMode . Development ) {
633+ dbModule = await initializeDbModule ( app ) ;
634+ ctx . subscriptions . push ( dbModule ) ;
635+ }
636+ }
629637
630638 const variantAnalysisStorageDir = join (
631639 ctx . globalStorageUri . fsPath ,
@@ -636,12 +644,13 @@ async function activateWithInstalledDistribution(
636644 cliServer ,
637645 extLogger ,
638646 ) ;
647+
639648 const variantAnalysisManager = new VariantAnalysisManager (
640649 ctx ,
641650 cliServer ,
642651 variantAnalysisStorageDir ,
643652 variantAnalysisResultsManager ,
644- dbModule . dbManager ,
653+ dbModule ? dbModule . dbManager : undefined , // the dbModule is only needed when the newQueryRunExperience is enabled
645654 ) ;
646655 ctx . subscriptions . push ( variantAnalysisManager ) ;
647656 ctx . subscriptions . push ( variantAnalysisResultsManager ) ;
0 commit comments