Skip to content

Commit

Permalink
fix: make search selects explicit (#7445)
Browse files Browse the repository at this point in the history
Now we are not returning * columns, but all tables that we join later,
will need to select columns one by one.
  • Loading branch information
sjaanus authored Jun 25, 2024
1 parent 388fe2d commit ed7f917
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions src/lib/features/feature-search/feature-search-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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;
Expand Down

0 comments on commit ed7f917

Please sign in to comment.