Commit a57fef1
refactor(ast): add named DropBehavior constants
The pg_query DropBehavior enum currently lives as a bare `type DropBehavior uint` —
callers that compare against the wire values have to write magic numbers
(`stmt.Behavior == 2` for CASCADE). Add named constants matching pganalyze/pg_query_go's
DropBehavior enum so usage sites can read `stmt.Behavior == ast.DropBehaviorCascade`
instead, and survive a future pg_query enum reshuffle without silently miscompiling.
No behavior change — just constants. Existing code that compares to integer literals
continues to work; this is purely additive.
Follow-up to the review on #4419 (which currently uses `Behavior == 2` literal):
happy to apply the same rename in that PR's diff once it lands, or in a separate
sweep PR depending on what the maintainers prefer.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent a3b0cfd commit a57fef1
1 file changed
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
3 | 10 | | |
4 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
5 | 18 | | |
6 | 19 | | |
7 | 20 | | |
0 commit comments