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 "DROP TYPE" support. #1461

Merged
merged 1 commit into from
Oct 9, 2024
Merged

Add "DROP TYPE" support. #1461

merged 1 commit into from
Oct 9, 2024

Conversation

caldwell
Copy link
Contributor

@caldwell caldwell commented Oct 7, 2024

See: https://www.postgresql.org/docs/current/sql-droptype.html
https://learn.microsoft.com/en-us/sql/t-sql/statements/drop-type-transact-sql?view=sql-server-ver16
https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/DROP-TYPE.html

According to the postgresql docs (above), their implementation is from ansi with only the IF EXISTS being an extension. mssql supports the IF EXISTS extension as well though it looks like Oracle doesn't.

I implemented this as a new ObjectType::Type which lets the existing Statement::Drop handle it generically.

Copy link
Contributor

@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 @caldwell

cc @iffyio

@coveralls
Copy link

Pull Request Test Coverage Report for Build 11221669025

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 34 of 40 (85.0%) changed or added relevant lines in 2 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.001%) to 89.307%

Changes Missing Coverage Covered Lines Changed/Added Lines %
tests/sqlparser_common.rs 32 38 84.21%
Files with Coverage Reduction New Missed Lines %
tests/sqlparser_common.rs 1 89.56%
Totals Coverage Status
Change from base Build 11186281805: -0.001%
Covered Lines: 30026
Relevant Lines: 33621

💛 - Coveralls

Copy link
Contributor

@iffyio iffyio left a comment

Choose a reason for hiding this comment

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

LGTM!

@alamb alamb merged commit c01e054 into apache:main Oct 9, 2024
10 checks passed
@alamb
Copy link
Contributor

alamb commented Oct 9, 2024

🚀

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.

4 participants