Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: implement parameters for ORDER BY#5377

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
bnason wants to merge1 commit intosurrealdb:main
base:main
Choose a base branch
Loading
frombnason:feature-3007-order-by-parameters

Conversation

bnason
Copy link

What is the motivation?

To be able to dynamically change the sort column and direction.

What does this change do?

Currently, parameters are not allowed in theORDER BY clause and throw an error. This allows for queries like the following:

LET $order_by = "name";LET $order_direction = "desc";LET $start = 0;LET $limit = 10;SELECT * FROM user ORDER BY $order_by $order_direction START $start LIMIT $limit;

What is your testing strategy?

None as of yet. Would like reviewer feedback.

Is this related to any issues?

Does this change need documentation?

  • TODO

Have you read the Contributing Guidelines?

Currently, parameters are not allowed in the `ORDER BY` clause and throw anerror. This allows for queries like the following:```LET $order_by = "name";LET $order_direction = "desc";LET $start = 0;LET $limit = 10;SELECT * FROM user ORDER BY $order_by $order_direction START $start LIMIT $limit;```
@bnason
Copy link
Author

Unfortunately I accidentally developed this on a month old commit and there have been changes which result in conflicts. I'm not sure of the best way to resolve them. If someone could help out, that would be great.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@tobiemhtobiemhAwaiting requested review from tobiemhtobiemh will be requested when the pull request is marked ready for reviewtobiemh is a code owner

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Bug: ORDER BY should accept idiom paths and variables
1 participant
@bnason

[8]ページ先頭

©2009-2025 Movatter.jp