(value: String)
| 171 | type Error = SqlServerError; |
| 172 | |
| 173 | fn try_from(value: String) -> Result<Self, Self::Error> { |
| 174 | match value.as_str() { |
| 175 | "PRIMARY KEY" => Ok(Self::PrimaryKey), |
| 176 | "UNIQUE" => Ok(Self::Unique), |
| 177 | name => Err(SqlServerError::InvalidData { |
| 178 | column_name: "constraint_type".into(), |
| 179 | error: format!("Unknown constraint type: {name}"), |
| 180 | }), |
| 181 | } |
| 182 | } |
| 183 | } |
| 184 | |
| 185 | impl RustType<proto_sql_server_table_constraint::ConstraintType> for SqlServerTableConstraintType { |