-
Notifications
You must be signed in to change notification settings - Fork 80
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
Unexpected behavior: #union_cypher returns String object rather than Query object #308
Comments
I'd be fine with a
Generally, I think the main reason I didn't implement a I think I'd be fine with |
I like that 👍 . Regarding a Maybe it would be best to leave a
Does this make sense? Thoughts? |
Yeah, I would be fine with what you’re proposing, though I would warn that the clause logic can get a bit complicated if you were thinking about implementing this. Another thought: |
I see what you mean about the logic being confusing. I've got an implementation of I also tried to implement an improved |
PS: I've seen you mention a few times how you have mixed feelings about |
@thefliik That's fair, though I think there might be room for a hybrid implementation. Like certain clauses should combine, but not others. Like if you have multiple |
Something that I just thought of: It's all fine to be able to understand a tool once you've figured it out, but in order to increase adoption I think it's important to make sure that things are as easy as possible (without compromising the design, of course) |
That's a great point. So as long as we're talking about "wouldn't it be great if." It'd probably be best if match clauses, by default, never re-arranged themselves, but there was an option to turn on re-arranging of some kind (something that more advanced users could discover). |
Yeah, probably https://stackoverflow.com/questions/34089692/what-does-a-comma-in-a-cypher-query-do |
While attempting to create a query involving the union of three sub-queries, I discovered that
union_cypher
expects a query object but returns a string rather than another query object. This prevents me from performing a union query on a union query. Given that all the other query methods return a query object, is there a reason for this behavior? I guess it kinda explains the name union_cypherneo4j-core/lib/neo4j-core/query.rb
Lines 376 to 386 in 00190f4
How would you feel about a PR to either create a new query method
union
that returns another query object for further chaining?Alternatively (and easier to implement),
union_cypher
could be updated so that it tests to see if its argument is already a string and, if so, simply inserts it without first callingto_cypher
on the argument.Thoughts?
The text was updated successfully, but these errors were encountered: