Returns the [ColumnAttribute] of constraints as an enum variant. NOTE: This represent the higher possible representation of a constraints, so for example `IDENTITY` imply that is `INDEXED, UNIQUE`
(&self)
| 125 | /// NOTE: This represent the higher possible representation of a constraints, so for example |
| 126 | /// `IDENTITY` imply that is `INDEXED, UNIQUE` |
| 127 | pub fn kind(&self) -> AttributeKind { |
| 128 | match *self { |
| 129 | x if x == Self::UNSET => AttributeKind::UNSET, |
| 130 | x if x == Self::INDEXED => AttributeKind::INDEXED, |
| 131 | x if x == Self::UNIQUE => AttributeKind::UNIQUE, |
| 132 | x if x == Self::AUTO_INC => AttributeKind::AUTO_INC, |
| 133 | x if x == Self::IDENTITY => AttributeKind::IDENTITY, |
| 134 | x if x == Self::PRIMARY_KEY => AttributeKind::PRIMARY_KEY, |
| 135 | x if x == Self::PRIMARY_KEY_AUTO => AttributeKind::PRIMARY_KEY_AUTO, |
| 136 | x if x == Self::PRIMARY_KEY_IDENTITY => AttributeKind::PRIMARY_KEY_IDENTITY, |
| 137 | x => unreachable!("Unexpected value {x:?}"), |
| 138 | } |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | /// Represents constraints for a database table. May apply to multiple columns. |
no outgoing calls
no test coverage detected