Skip to content

Commit

Permalink
Merge pull request #26 from hasura/equality-test
Browse files Browse the repository at this point in the history
Equality and _id update
  • Loading branch information
gneeri authored Aug 22, 2024
2 parents 304565d + c74fd77 commit 55becfd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]

### Changed

- Set term as the default equality operator across scalar types
- Eliminated _id as the default uniqueness constraint

## [1.0.1]

### Changed
Expand Down
6 changes: 1 addition & 5 deletions connector/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,7 @@ func parseConfigurationToSchema(configuration *types.Configuration, state *types
Name: indexName,
Arguments: schema.CollectionInfoArguments{},
Type: indexName,
UniquenessConstraints: schema.CollectionInfoUniquenessConstraints{
indexName + "_by_id": schema.UniquenessConstraint{
UniqueColumns: []string{"_id"},
},
},
UniquenessConstraints: schema.CollectionInfoUniquenessConstraints{},
ForeignKeys: schema.CollectionInfoForeignKeys{},
})
}
Expand Down
6 changes: 2 additions & 4 deletions connector/static_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ func getComparisonOperatorDefinition(dataType string) map[string]schema.Comparis
}

// if dataType == "date" { // TODO: add back once object types are supported as comparison operators
// requiredObjectTypes["date_range_query"] = objectTypeMap["date_range_query"]
// requiredObjectTypes["date_range_query"] = objectTypeMap["date_range_query"]
// comparisonOperators["range"] = schema.NewComparisonOperatorCustom(schema.NewNamedType("date_range_query")).Encode()
// }

Expand All @@ -322,9 +322,7 @@ func getComparisonOperatorDefinition(dataType string) map[string]schema.Comparis
comparisonOperators["match_bool_prefix"] = schema.NewComparisonOperatorCustom(schema.NewNamedType(dataType)).Encode()
}

if dataType == "_id" {
comparisonOperators["term"] = schema.NewComparisonOperatorEqual().Encode()
}
comparisonOperators["term"] = schema.NewComparisonOperatorEqual().Encode()

return comparisonOperators
}
Expand Down

0 comments on commit 55becfd

Please sign in to comment.