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

feat: Add WITH OFFSET Alias #528

Merged
merged 2 commits into from Jun 29, 2022
Merged

Conversation

sivchari
Copy link
Contributor

I add With Offset alias.

@coveralls
Copy link

coveralls commented Jun 25, 2022

Pull Request Test Coverage Report for Build 2563712058

  • 23 of 25 (92.0%) changed or added relevant lines in 3 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.005%) to 89.787%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/parser.rs 4 6 66.67%
Files with Coverage Reduction New Missed Lines %
src/ast/query.rs 1 86.61%
Totals Coverage Status
Change from base Build 2535757386: 0.005%
Covered Lines: 8791
Relevant Lines: 9791

💛 - Coveralls

Copy link
Collaborator

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thank you @sivchari -- can you point me at what systems use this syntax ? I tried to find it in the mysql manual but I couldn't quite figure it out

@sivchari
Copy link
Contributor Author

from_item:
    {
      table_name [ as_alias ] [ FOR SYSTEM_TIME AS OF timestamp_expression ]
      | { join_operation | ( join_operation ) }
      | ( query_expr ) [ as_alias ]
      | field_path
      | unnest_operator
      | cte_name [ as_alias ]
    }

unnest_operator:
    {
      [UNNEST](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#unnest)( array_expression )
      | UNNEST( array_path )
      | array_path
    }
    [ as_alias ]
    [ WITH OFFSET [ as_alias ] ]

https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#unnest_operator

I forgot to support WITH OFFSET Alias in #493 , so I added it.

@alamb alamb merged commit 6876853 into sqlparser-rs:main Jun 29, 2022
@alamb
Copy link
Collaborator

alamb commented Jun 29, 2022

Thanks @sivchari and @Dandandan

mobuchowski pushed a commit to mobuchowski/sqlparser-rs that referenced this pull request Aug 3, 2022
* feat: Add WITH OFFSET Alias

* update: fix with_offset_alias type
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.

None yet

4 participants