Skip to content

Implemented value tuple literal in SQL #2843

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

egormanga
Copy link

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
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.

1 participant