FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Corrected self-join example by trueqbit · Pull Request #1327 · fnc12/sqlite_orm · GitHub

Corrected self-join example - #1327

Merged
trueqbit merged 1 commit into
devfrom
correct-self-join-example
Jun 22, 2024
Merged

Corrected self-join example#1327
trueqbit merged 1 commit into
devfrom
correct-self-join-example

Conversation

Copy link
Copy Markdown
Collaborator

No description provided.

trueqbit requested a review from fnc12 June 22, 2024 17:14
Comment thread examples/self_join.cpp

Copy link
Copy Markdown
Contributor

Why doesn't this code need c(" ") if it is needed at the end:

columns(alias_column<als>(&Employee::firstName) || " " || alias_column<als>(&Employee::lastName)

it is needed here:

 &Employee::firstName || c(" ") || &Employee::lastName),

Copy link
Copy Markdown
Collaborator Author

Why doesn't this code need c(" ") if it is needed at the end:

columns(alias_column<als>(&Employee::firstName) || " " || alias_column<als>(&Employee::lastName)

it is needed here:

 &Employee::firstName || c(" ") || &Employee::lastName),

Because alias_column() returns alias_column_t<>, for which operator|| is overloaded.
Unfortunately we cannot overload C++ builtin types.

trueqbit merged commit 64342a0 into dev Jun 22, 2024
trueqbit deleted the correct-self-join-example branch June 22, 2024 21:04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

3 participants


Back | FazBrowse Home | New Git URL