Skip to content

Commit

Permalink
Fix applyPhysicalFromExpression for auto-discovery (#792)
Browse files Browse the repository at this point in the history
Small regression I've found while working on auth. In auto discovery
mode, there's no index configuration, so we shall fallback to `false`
for `useCommonTable` instead of returning an error
  • Loading branch information
mieciu authored Sep 24, 2024
1 parent 2c576fd commit a546fb4
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions quesma/quesma/schema_transformer.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,13 +354,10 @@ func (s *SchemaCheckPass) applyPhysicalFromExpression(currentSchema schema.Schem

var useCommonTable bool
if len(query.Indexes) == 1 {
indexConf, ok := s.cfg[query.Indexes[0]]
if !ok {
return query, fmt.Errorf("index configuration not found for table %s", query.TableName)
if indexConf, ok := s.cfg[query.Indexes[0]]; ok {
useCommonTable = indexConf.UseCommonTable
}
useCommonTable = indexConf.UseCommonTable
} else {
// we can handle querying multiple indexes from common table only
} else { // we can handle querying multiple indexes from common table only
useCommonTable = true
}

Expand Down

0 comments on commit a546fb4

Please sign in to comment.