Primary constructor that initializes all fields. Other constructors delegate to this one to avoid code duplication. Name to use when accessing this index. If null, will be generated from column names. Explicit canonical name override for this index, if any. The columns that make up thi
(
string? accessorName,
string? canonicalName,
ImmutableArray<ColumnRef> columns,
string? tableName,
TableIndexType type
)
| 354 | /// <param name="tableName">The name of the table this index belongs to, if any.</param> |
| 355 | /// <param name="type">The type of index (currently only B-tree is supported).</param> |
| 356 | private TableIndex( |
| 357 | string? accessorName, |
| 358 | string? canonicalName, |
| 359 | ImmutableArray<ColumnRef> columns, |
| 360 | string? tableName, |
| 361 | TableIndexType type |
| 362 | ) |
| 363 | { |
| 364 | Columns = new(columns); |
| 365 | Table = tableName; |
| 366 | var columnNames = string.Join("_", columns.Select(c => c.Name)); |
| 367 | AccessorName = accessorName ?? columnNames; |
| 368 | CanonicalName = canonicalName; |
| 369 | Type = type; |
| 370 | StandardNameSuffix = $"_{columnNames}_idx_{Type.ToString().ToLower()}"; |
| 371 | } |
| 372 | |
| 373 | /// <summary> |
| 374 | /// Creates a B-tree index on a single column with auto-generated name. |
nothing calls this directly
no test coverage detected