From ed7f917df6b7e02cc788d227d3e6da8dc19fa8bc Mon Sep 17 00:00:00 2001 From: Jaanus Sellin Date: Tue, 25 Jun 2024 12:56:40 +0200 Subject: [PATCH] fix: make search selects explicit (#7445) Now we are not returning * columns, but all tables that we join later, will need to select columns one by one. --- .../feature-search/feature-search-store.ts | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/lib/features/feature-search/feature-search-store.ts b/src/lib/features/feature-search/feature-search-store.ts index 49e8778577..b49942bca5 100644 --- a/src/lib/features/feature-search/feature-search-store.ts +++ b/src/lib/features/feature-search/feature-search-store.ts @@ -299,7 +299,13 @@ class FeatureSearchStore implements IFeatureSearchStore { 'client_metrics_env.environment', ]); }) - .select('*') + .select([ + 'ranked_features.*', + 'total_features.total', + 'final_ranks.final_rank', + 'metrics.yes', + 'metrics.no', + ]) .from('ranked_features') .innerJoin( 'final_ranks', @@ -310,11 +316,17 @@ class FeatureSearchStore implements IFeatureSearchStore { .whereBetween('final_rank', [offset + 1, offset + limit]) .orderBy('final_rank'); if (featureLifecycleEnabled) { - finalQuery.leftJoin( - 'lifecycle', - 'ranked_features.feature_name', - 'lifecycle.stage_feature', - ); + finalQuery + .select( + 'lifecycle.latest_stage', + 'lifecycle.stage_status', + 'lifecycle.entered_stage_at', + ) + .leftJoin( + 'lifecycle', + 'ranked_features.feature_name', + 'lifecycle.stage_feature', + ); } this.queryExtraData(finalQuery); const rows = await finalQuery;