Gets the index of the columns used when creating a default index.
(&self)
| 331 | |
| 332 | /// Gets the index of the columns used when creating a default index. |
| 333 | pub fn default_key(&self) -> Vec<usize> { |
| 334 | if let Some(key) = self.keys.first() { |
| 335 | if key.is_empty() { |
| 336 | (0..self.column_types.len()).collect() |
| 337 | } else { |
| 338 | key.clone() |
| 339 | } |
| 340 | } else { |
| 341 | (0..self.column_types.len()).collect() |
| 342 | } |
| 343 | } |
| 344 | |
| 345 | /// Returns all the [`SqlColumnType`]s, in order, for this relation. |
| 346 | pub fn columns(&self) -> &[SqlColumnType] { |