Skip to content
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

Uniform syntax for column pointer expressions through table references #1244

Merged
merged 5 commits into from
Nov 12, 2023

Conversation

trueqbit
Copy link
Collaborator

@trueqbit trueqbit commented Nov 11, 2023

Since the advent of a new syntax for alias columns in the form of

constexpr auto z_alias = "z"_alias.for_<Object>();
select(z_alias->*&Object::id);

and the upcoming CTE feature that uses the same notation:

constexpr auto xaxis = "xaxis"_cte;
select(xaxis->*x);

it would be very convenient and again a huge improvement to the legibility of SQL statement expressions if column pointers can be formed using the same syntax.

struct Object { int64 id; };
struct Derived : Object {};
constexpr auto derived = c<Derived>();
select(derived->*&Derived::id);

Additionally, this PR contains the following improvements:

  • A lot more expressions are now available for column pointers (e.g. storage.count(column<Derived>(&Derived::id)) works)
  • A myriad more unit tests for column pointers
  • More unit tests for alias column pointers

It must be clarified how a "table reference" can be created. Currently available:

// 1.
constexpr auto derived = c<Derived>();
// 2.
constexpr auto derived = column<Derived>();

@trueqbit trueqbit requested a review from fnc12 November 11, 2023 22:28
@trueqbit trueqbit merged commit 2e1916b into fnc12:dev Nov 12, 2023
1 check passed
@fnc12
Copy link
Owner

fnc12 commented Nov 12, 2023

thanks @trueqbit

@trueqbit trueqbit deleted the feature/uniform_column_pointer branch December 24, 2023 13:21
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