Commit 759ab21
authored
PostgreSQL: add GrantObjects::Types and Domains for GRANT ON TYPE/DOMAIN (#24)
`GRANT USAGE ON TYPE foo TO role` and `GRANT ON DOMAIN d TO role` are
valid PostgreSQL grammar but failed to parse — `parse_grant_target`
had no `TYPE` or `DOMAIN` keyword, and `GrantObjects` lacked variants
to carry them.
Add `GrantObjects::Types(Vec<ObjectName>)` and
`GrantObjects::Domains(Vec<ObjectName>)`, along with their `Display`
arms, the `Keyword::TYPE` / `Keyword::DOMAIN` arms in
`parse_grant_deny_revoke_privileges_objects`, and round-trip tests
in `parse_grant`.
Verified:
cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings
cargo test --all-features parse_grant1 parent 6bfcc10 commit 759ab21
3 files changed
Lines changed: 63 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7749 | 7749 | | |
7750 | 7750 | | |
7751 | 7751 | | |
| 7752 | + | |
| 7753 | + | |
| 7754 | + | |
| 7755 | + | |
| 7756 | + | |
| 7757 | + | |
| 7758 | + | |
| 7759 | + | |
| 7760 | + | |
| 7761 | + | |
| 7762 | + | |
| 7763 | + | |
7752 | 7764 | | |
7753 | 7765 | | |
7754 | 7766 | | |
| |||
7894 | 7906 | | |
7895 | 7907 | | |
7896 | 7908 | | |
| 7909 | + | |
| 7910 | + | |
| 7911 | + | |
| 7912 | + | |
| 7913 | + | |
| 7914 | + | |
7897 | 7915 | | |
7898 | 7916 | | |
7899 | 7917 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17908 | 17908 | | |
17909 | 17909 | | |
17910 | 17910 | | |
| 17911 | + | |
| 17912 | + | |
17911 | 17913 | | |
17912 | 17914 | | |
17913 | 17915 | | |
| |||
17920 | 17922 | | |
17921 | 17923 | | |
17922 | 17924 | | |
| 17925 | + | |
| 17926 | + | |
17923 | 17927 | | |
17924 | 17928 | | |
17925 | 17929 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9878 | 9878 | | |
9879 | 9879 | | |
9880 | 9880 | | |
| 9881 | + | |
| 9882 | + | |
| 9883 | + | |
| 9884 | + | |
| 9885 | + | |
| 9886 | + | |
| 9887 | + | |
| 9888 | + | |
| 9889 | + | |
| 9890 | + | |
| 9891 | + | |
| 9892 | + | |
| 9893 | + | |
| 9894 | + | |
| 9895 | + | |
| 9896 | + | |
| 9897 | + | |
| 9898 | + | |
| 9899 | + | |
| 9900 | + | |
| 9901 | + | |
| 9902 | + | |
| 9903 | + | |
| 9904 | + | |
| 9905 | + | |
| 9906 | + | |
| 9907 | + | |
| 9908 | + | |
| 9909 | + | |
| 9910 | + | |
| 9911 | + | |
| 9912 | + | |
| 9913 | + | |
| 9914 | + | |
| 9915 | + | |
| 9916 | + | |
| 9917 | + | |
| 9918 | + | |
| 9919 | + | |
| 9920 | + | |
| 9921 | + | |
9881 | 9922 | | |
9882 | 9923 | | |
9883 | 9924 | | |
| |||
0 commit comments