Helper to create a BTree index for a field
| 324 | |
| 325 | // Helper to create a BTree index for a field |
| 326 | RawIndexDefV9 V9Builder::createBTreeIndex(const std::string& table_name, |
| 327 | const std::string& field_name, |
| 328 | uint16_t field_idx) const { |
| 329 | RawIndexAlgorithmBTreeData btree_data; |
| 330 | btree_data.columns = {field_idx}; |
| 331 | |
| 332 | RawIndexAlgorithm algorithm; |
| 333 | algorithm.set<0>(btree_data); // Set BTree variant |
| 334 | |
| 335 | RawIndexDefV9 index_def; |
| 336 | index_def.name = table_name + "_" + field_name + "_idx_btree"; |
| 337 | index_def.accessor_name = field_name; |
| 338 | index_def.algorithm = algorithm; |
| 339 | |
| 340 | return index_def; |
| 341 | } |
| 342 | |
| 343 | // Helper to create a unique constraint for a field |
| 344 | RawConstraintDefV9 V9Builder::createUniqueConstraint(const std::string& table_name, |
nothing calls this directly
no outgoing calls
no test coverage detected