Skip to content

Commit

Permalink
Fix field encoding for Hydrolix (#806)
Browse files Browse the repository at this point in the history
So because Hydrolix is case-sensitive, our encoding algorithm has
produced an incorrect query - Quesma ended up throwing `Field not found
in the database` error.
  • Loading branch information
mieciu authored Sep 26, 2024
1 parent 102e951 commit 769a100
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions quesma/quesma/schema_transformer.go
Original file line number Diff line number Diff line change
Expand Up @@ -649,12 +649,8 @@ func (s *SchemaCheckPass) applyFieldEncoding(indexSchema schema.Schema, query *m
var err error

visitor.OverrideVisitColumnRef = func(b *model.BaseExprVisitor, e model.ColumnRef) interface{} {
if _, ok := indexSchema.ResolveField(e.ColumnName); ok {
// TODO util.FieldToColumnEncoder is a shortcut here
// we should use the schema to get the internal name
// however for now it's part of schema.registry not schema.Schema
// so we don't have direct access to it
return model.NewColumnRef(util.FieldToColumnEncoder(e.ColumnName))
if resolvedField, ok := indexSchema.ResolveField(e.ColumnName); ok {
return model.NewColumnRef(resolvedField.InternalPropertyName.AsString())
} else {
return e
}
Expand Down

0 comments on commit 769a100

Please sign in to comment.