Skip to content

Allow parsing any permutation of create sequence options #1102

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

Open
PartiallyUntyped opened this issue Jan 20, 2024 · 3 comments
Open

Allow parsing any permutation of create sequence options #1102

PartiallyUntyped opened this issue Jan 20, 2024 · 3 comments

Comments

@PartiallyUntyped
Copy link
Contributor

PartiallyUntyped commented Jan 20, 2024

Hi, many thanks for the project!

I would like to be able to parse the create sequence options in any particular order instead of just what postgreslq/duckdb support. Afaik oracle for example allows any permutation of the options.

If this is something that you'd be willing accept, I would be happy to implement the necessary changes to allow any permutation and hide it behind something like a dialect flag.

@PartiallyUntyped PartiallyUntyped changed the title Allow parsing sequence options with any order Allow parsing any permutation of create sequence options Jan 20, 2024
@alamb
Copy link
Contributor

alamb commented Jan 23, 2024

I would like to be able to parse the create sequence options in any particular order instead of just what postgreslq/duckdb support. Afaik oracle for example allows any permutation of the options.

If this is something that you'd be willing accept, I would be happy to implement the necessary changes to allow any permutation and hide it behind something like a dialect flag.

Sounds like a good feature to me -- thank you 🙏

Given the description of the issue I don't think we need to hide this behind a dialect flag FWIW, though you could do so if you prefer

@PartiallyUntyped
Copy link
Contributor Author

PartiallyUntyped commented Jan 23, 2024

My concern is that it would create false positives, and potentially allow bad code compilation, eg parsing bad postgresql code and then compiling that back in the wrong order.

I am thinking that this should be controlled on a per dialect basis, and each dialect can control the ordering of acceptable fields.

@alamb
Copy link
Contributor

alamb commented Jan 24, 2024

My concern is that it would create false positives, and potentially allow bad code compilation, eg parsing bad postgresql code and then compiling that back in the wrong order.

That is a reasonable concern, though I think there are examples in the crate where that already happens

I don't have a strong preference

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

No branches or pull requests

2 participants