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

Functions id and elementId don't accept Expression #939

Open
zakjan opened this issue Mar 4, 2024 · 3 comments
Open

Functions id and elementId don't accept Expression #939

zakjan opened this issue Mar 4, 2024 · 3 comments
Assignees

Comments

@zakjan
Copy link

zakjan commented Mar 4, 2024

Functions id and elementId are currently defined as accepting either Node or Relationship. This can't be used by Cypher statements which have other types.

I suppose accepting Expression could be the best fit. There is a similar pattern with function keys, accepts Node, Relationship or Expression.

@michael-simons
Copy link
Collaborator

Hello again, @zakjan

Yep, you're right, I was annoyed by that not too long back as well.

Will add this.

@zakjan
Copy link
Author

zakjan commented Mar 5, 2024

I've tried to start making a PR but found out this seems to be a general issue across more functions. For example, startNode, endNode.

Would you agree that all functions should be able to accept Expression in general? It seems that the only benefit of having more specific function overloads is only implicit calling .getRequiredSymbolicName() inside.

Is there a usecase for unnamed Node/Relationship? Would it make sense to extend it from Expression, to assume that it's always named? There are random names generated if manual name is not provided.

@michael-simons
Copy link
Collaborator

michael-simons commented Mar 5, 2024

Nodes and relationships on themselves are entities, and not expressions, their name is. So that's why I designed it that way.
But you're right, worth thinking about it.

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

No branches or pull requests

2 participants