Skip to content

Conversation

@egormanga
Copy link
Contributor

Description of Changes

There's been no way to use product types like this:

struct Position<T: geo::CoordNum = Coord> {
	lat: T,
	lon: T,
}

#[table(name=point)]
struct Point {
	pos: Position,
}

because SQL queries containing tuples:

SELECT * FROM point WHERE pos = (0, 0);

would fail with:
Error: Unsupported expression: (0, 0)

This PR implements tuple support for = and != operators (subject to further expansion).

API and ABI breaking changes

None.

Expected complexity level and risk

2.

Testing

  • Manual testing using custom struct columns.
  • Needs unit tests. I leave this open for contributions or as an exercise to the employees.

@egormanga
Copy link
Contributor Author

Possibly related to #2670?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants