Skip to content

Support SQLite column definitions with no type - #1075

Merged
alamb merged 4 commits into
apache:mainfrom
takluyver:sqlite-untyped-cols
Jan 1, 2024
Merged

alamb merged 4 commits into
apache:mainfrom
takluyver:sqlite-untyped-cols

Conversation

@takluyver

Copy link
Copy Markdown
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

coveralls commented Dec 24, 2023 •

Copy link
Copy Markdown

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

Comment thread src/parser/mod.rs Outdated

@alamb alamb left a comment

Copy link
Copy Markdown
Contributor

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

Comment thread src/parser/mod.rs Outdated
Comment thread src/ast/data_type.rs Outdated
@takluyver

Copy link
Copy Markdown
Contributor Author

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

@alamb alamb left a comment

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
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