Skip to content

Conversation

@stepancheg
Copy link
Contributor

There's <drop behavior> definition in the grammar, so corresponding enum seems appropriate:

pub enum DropBehavior {
    Restrict,
    Cascade,
}

vs

pub enum ReferentialAction {
    Restrict,
    Cascade,
    SetNull,
    NoAction,
    SetDefault,
}

Context: ALTER TABLE DROP COLUMN sqlparser does not support RESTRICT. I wanted to add it, but adding ReferentialAction there too might be misleading, so here I introduce an enum.

Copy link
Contributor

@iffyio iffyio left a comment

Choose a reason for hiding this comment

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

Thanks @stepancheg! This improvement sounds reasonable to me!
cc @alamb

@iffyio iffyio changed the title enum DropBehavior Replace ReferentialAction enum in DROP statements Jan 8, 2025
@iffyio iffyio merged commit 397bceb into apache:main Jan 8, 2025
9 checks passed
ayman-sigma pushed a commit to sigmacomputing/sqlparser-rs that referenced this pull request Apr 10, 2025
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