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

parse SQLite pragma statement #969

Merged
merged 4 commits into from
Oct 23, 2023
Merged

parse SQLite pragma statement #969

merged 4 commits into from
Oct 23, 2023

Conversation

marhoily
Copy link
Contributor

@marhoily marhoily commented Sep 17, 2023

Adds support for SQLite PRAGMA statement:

PRAGMA cache_size = 10

According to the docs this is not all the possible syntax variations. If someone reviews my changes, I could add more before merging.

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 for the contribution @marhoily -- ideally this PR would have one more test, but otherwise it looks great.

Thanks again

@@ -24,6 +24,51 @@ use sqlparser::ast::*;
use sqlparser::dialect::{GenericDialect, SQLiteDialect};
use sqlparser::tokenizer::Token;

#[test]
fn pragma_no_value() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please also add a test for the [schema-name '.'] pragma-name variant as well?

like PRAGMA foo.cache_size = 5?

@alamb
Copy link
Contributor

alamb commented Sep 20, 2023

According to the docs this is not all the possible syntax variations. If someone reviews my changes, I could add more before merging.

I think it is ok to start with basic syntax support and then we an add more support as follow on PRs, incrementally. This is the model we have used over time to build up the library of sql parsing capability this library supports

@alamb
Copy link
Contributor

alamb commented Oct 5, 2023

I took the liberty of merging this PR up from main and running cargo fmt on it to get a clean CI run

@alamb alamb merged commit 8b2a248 into apache:main Oct 23, 2023
10 checks passed
serprex pushed a commit to serprex/sqlparser-rs that referenced this pull request Nov 6, 2023
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.

2 participants