Skip to content

Add support for CREATE TYPE (AS) statements #888

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

Merged
merged 4 commits into from
Jun 8, 2023

Conversation

srijs
Copy link
Contributor

@srijs srijs commented May 20, 2023

Hi,

This patch adds support for parsing CREATE TYPE <name> AS (...) (https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#_11_51_user_defined_type_definition) statements. I tried my best to align the naming here with the SQL 2016 standard.

I've already introduced an enum that could be extended later to cover other types of CREATE TYPE statements, but that is not done here yet mostly because I only require the support for composite types at the moment, and the other statement types are a bit more complex to parse.

Any feedback welcome!

@srijs srijs force-pushed the postgresql-create-type branch from 09e13b8 to e0a208c Compare May 20, 2023 14:51
@coveralls
Copy link

coveralls commented Jun 2, 2023

Pull Request Test Coverage Report for Build 5210193448

  • 48 of 56 (85.71%) changed or added relevant lines in 4 files are covered.
  • 148 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.7%) to 87.005%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/ast/ddl.rs 8 9 88.89%
src/ast/mod.rs 3 5 60.0%
src/parser.rs 23 28 82.14%
Files with Coverage Reduction New Missed Lines %
src/lib.rs 148 11.94%
Totals Coverage Status
Change from base Build 5073704019: 0.7%
Covered Lines: 14870
Relevant Lines: 17091

💛 - Coveralls

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.

Looks good to me -- thank you @srijs

@alamb
Copy link
Contributor

alamb commented Jun 8, 2023

I took the liberty of merging up from main and fixing the doc comment, and plan to merge this PR when the CI passes

@alamb alamb merged commit 2b37e4a into apache:main Jun 8, 2023
@srijs srijs deleted the postgresql-create-type branch June 8, 2023 21:51
@srijs
Copy link
Contributor Author

srijs commented Jun 8, 2023

Thank you @alamb!

@alamb
Copy link
Contributor

alamb commented Jun 9, 2023

I plan a new release in a week or two: #887

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.

3 participants