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

Distinguish between INT and INTEGER types #525

Merged
merged 3 commits into from Jun 21, 2022

Conversation

frolovdev
Copy link
Contributor

@frolovdev frolovdev commented Jun 18, 2022

@alamb (you said that I can ping you :d)

Closes #398

@@ -35,7 +35,7 @@ fn parse_create_table_with_defaults() {
activebool boolean DEFAULT true NOT NULL,
create_date date DEFAULT now()::text NOT NULL,
last_update timestamp without time zone DEFAULT now() NOT NULL,
active integer NOT NULL
active int NOT NULL
Copy link
Contributor Author

@frolovdev frolovdev Jun 18, 2022

Choose a reason for hiding this comment

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

🎶 I change the test to cover both variants of ints (lean testing)

@coveralls
Copy link

coveralls commented Jun 18, 2022

Pull Request Test Coverage Report for Build 2535650811

  • 6 of 11 (54.55%) changed or added relevant lines in 3 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.03%) to 89.782%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/ast/data_type.rs 2 4 50.0%
src/parser.rs 3 6 50.0%
Files with Coverage Reduction New Missed Lines %
src/parser.rs 1 83.38%
Totals Coverage Status
Change from base Build 2498127031: -0.03%
Covered Lines: 8769
Relevant Lines: 9767

💛 - Coveralls

@alamb alamb changed the title Support integer Distinguish between INT and INTEGER types Jun 21, 2022
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 @frolovdev -- other than the docstring this looks great.

👍

src/ast/data_type.rs Outdated Show resolved Hide resolved
let optional_precision = self.parse_optional_precision();
if self.parse_keyword(Keyword::UNSIGNED) {
Ok(DataType::UnsignedInt(optional_precision?))
} else {
Ok(DataType::Int(optional_precision?))
}
}
Keyword::INTEGER => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
@frolovdev
Copy link
Contributor Author

Thank you @frolovdev -- other than the docstring this looks great.

👍

Applied

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

alamb commented Jun 21, 2022

Thanks again @frolovdev !

mobuchowski pushed a commit to mobuchowski/sqlparser-rs that referenced this pull request Aug 3, 2022
* support integer

* fmt

* Update src/ast/data_type.rs

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
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.

distinguishing between Int and Integer
3 participants