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

Support optional unit (CHARACTER or OCTET) for character string types such as VARCHAR #663

Merged
merged 1 commit into from Oct 11, 2022
Merged

Support optional unit (CHARACTER or OCTET) for character string types such as VARCHAR #663

merged 1 commit into from Oct 11, 2022

Conversation

AugustoFKL
Copy link
Contributor

Add support for optional OCTETS and CHARACTERS after the precision. I haven't seen that syntax for any big dialects that I remember but, since ANSI supports it (1), I wanted to add the possible syntax.

@alamb ready for review :)

[1] : https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#character-string-type
Related to: #661

…types.

This results in complete support for ANSI CHARACTER, CHAR, CHARACTER VARYING,
CHAR VARYING, and VARCHAR.
@coveralls
Copy link

Pull Request Test Coverage Report for Build 3214905321

  • 58 of 60 (96.67%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.03%) to 85.817%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/ast/data_type.rs 19 21 90.48%
Totals Coverage Status
Change from base Build 3209998484: 0.03%
Covered Lines: 10510
Relevant Lines: 12247

💛 - 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.

Makes sense to me -- thank you @AugustoFKL

@alamb alamb changed the title Add support for unit for character string types Support optional unit (CHARACTER or OCTET) for character string types such as VARCHAR Oct 11, 2022
@alamb alamb merged commit cacdf33 into sqlparser-rs:main Oct 11, 2022
@AugustoFKL AugustoFKL mentioned this pull request Oct 14, 2022
54 tasks
@AugustoFKL AugustoFKL deleted the ansii-character-string-unit-support branch November 5, 2022 23:11
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

3 participants