Assigns functional dependencies.
(
mut self,
functional_dependencies: FunctionalDependencies,
)
| 268 | |
| 269 | /// Assigns functional dependencies. |
| 270 | pub fn with_functional_dependencies( |
| 271 | mut self, |
| 272 | functional_dependencies: FunctionalDependencies, |
| 273 | ) -> Result<Self> { |
| 274 | if functional_dependencies.is_valid(self.inner.fields.len()) { |
| 275 | self.functional_dependencies = functional_dependencies; |
| 276 | Ok(self) |
| 277 | } else { |
| 278 | _plan_err!( |
| 279 | "Invalid functional dependency: {:?}", |
| 280 | functional_dependencies |
| 281 | ) |
| 282 | } |
| 283 | } |
| 284 | |
| 285 | /// Create a new schema that contains the fields from this schema followed by the fields |
| 286 | /// from the supplied schema. An error will be returned if there are duplicate field names. |