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

stop the use of dialect_of and referring to specific dialects in parser #1430

Open
samuelcolvin opened this issue Sep 14, 2024 · 1 comment

Comments

@samuelcolvin
Copy link
Contributor

TL;DR; — I want to stop Parser from referring to specific dialects, and instead consult the dialect about specific behaviour.

In particular, use of dialect_of and custom dialect behaviour in Parser should be removed

Abstract reasons to do this:

  • it's very esoteric in Rust, I've never seen another library use this approach, It's like reading (bad) python, in Rust
  • it's poor separation of concerns — the Parser should concentrate on parsing SQL, and defer to the dialect about how to behave in some scenarios, rather than holding information about how mysql differs from Snowflake etc.

Concrete reasons to do this:

  • I want to use "from first" syntax (FROM first in SELECT statements #1400) with otherwise postgres syntax — currently dialects can't opt into certain behaviour because the parser is checking for a specific dialect, not for a given behaviour

I've already discussed this with @alamb, I'll try to do this in multiple PRs, to make it easier to review.

@iffyio
Copy link
Contributor

iffyio commented Sep 15, 2024

Linking for context related discussion #1340

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