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 SQLite column definitions with no type #1075

Merged
merged 4 commits into from
Jan 1, 2024

Conversation

takluyver
Copy link
Contributor

SQLite allows columns with no type information:

CREATE TABLE t1 (a, b AS (a * 2), c NOT NULL)

As far as I know, other SQL databases all expect a data type for each column. So for now I've allowed this only for the SQLite dialect. Should the generic dialect also support it? The docs suggest that it's 'permissive', but I wasn't sure if this would be stretching the point too far. 🙂

Closes #743

@coveralls
Copy link

coveralls commented Dec 24, 2023

Pull Request Test Coverage Report for Build 7378944390

Warning: This coverage report may be inaccurate.

We've detected an issue with your CI configuration that might affect the accuracy of this pull request's coverage report.
To ensure accuracy in future PRs, please see these guidelines.
A quick fix for this PR: rebase it; your next report should be accurate.

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 87.82%

Totals Coverage Status
Change from base Build 7303175792: 0.1%
Covered Lines: 18652
Relevant Lines: 21239

💛 - Coveralls

src/parser/mod.rs Outdated Show resolved Hide resolved
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.

Thank you @takluyver -- this is looking good to me. I think @tobyhede has a good style suggestion and it would be really helpful to improve the doc comments before we merged

Should the generic dialect also support it? The docs suggest that it's 'permissive', but I wasn't sure if this would be stretching the point too far.

I don't have a strong opinion. We can maybe start with SQLite only and then expand coverage for generic dialect if people want it

src/parser/mod.rs Outdated Show resolved Hide resolved
src/ast/data_type.rs Outdated Show resolved Hide resolved
@takluyver
Copy link
Contributor Author

Thanks both! I've renamed the helper message and tried to document this feature better.

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.

LGTM -- thank you very much @takluyver (and happy new year 🎉 )

@alamb alamb merged commit a430d1a into apache:main Jan 1, 2024
10 checks passed
@takluyver
Copy link
Contributor Author

Thanks! Happy new year to you 🎆

@takluyver takluyver deleted the sqlite-untyped-cols branch January 1, 2024 17:57
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.

SQLite dialect doesn't support typeless columns
4 participants