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

Add support for offset #420

Merged
merged 1 commit into from
Oct 8, 2024
Merged

Add support for offset #420

merged 1 commit into from
Oct 8, 2024

Conversation

angrykoala
Copy link
Member

Add support for OFFSET alias for SKIP:

const matchQuery = new Cypher.Return(movieNode).orderBy([movieNode.property("age")]).offset(new Cypher.Param(10));
RETURN this0
ORDER BY this0.age ASC
OFFSET $param0

Copy link

changeset-bot bot commented Oct 8, 2024

🦋 Changeset detected

Latest commit: 77d8795

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@neo4j/cypher-builder Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

sonarqubecloud bot commented Oct 8, 2024

Copy link
Contributor

@MacondoExpress MacondoExpress left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@@ -72,16 +77,19 @@ export class OrderBy extends CypherASTNode {
}

class Skip extends CypherASTNode {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another solution could be to have Offset that extends Skip and removing the flag

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thoughts? This is quite internal, and I feel that this solution is simple enough for this case

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unbiased honestly, I think we will have some cases similar in the future, where a GQL syntax will be an alias of an existing syntax, I would handle all the aliases in the same way, but we handle them just like this as well!

@angrykoala angrykoala merged commit 2db1e80 into main Oct 8, 2024
10 checks passed
@angrykoala angrykoala deleted the offset-alias branch October 8, 2024 15:58
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