@@ -553,37 +553,6 @@ local function build_index_parts_tree(indexes)
553
553
return roots
554
554
end
555
555
556
- --- Build `connection_indexes` table (part of `index_cache`) to use in the
557
- --- @{get_index_name} function.
558
- ---
559
- --- @tparam table indexes map from collection names to indexes meta-information
560
- --- as defined in the @{new} function; the function uses it to validate index
561
- --- names provided in connections (which are inside collections), validate
562
- --- connection types ('1:1' or '1:N') against index uniqueness if the `unique`
563
- --- flag provided for corresponding index and to check that destination parts
564
- --- of connections form a prefix of parts of the `connection.index_name` index
565
- ---
566
- --- @tparam table collections map from collection names to collections as
567
- --- defined in the @{accessor_general.new} function decription; the function
568
- --- uses it to extract index names from connections and create the resulting
569
- --- mapping
570
- ---
571
- --- @treturn table `connection_indexes`
572
- local function build_connection_indexes (indexes , collections )
573
- assert (type (indexes ) == ' table' , ' indexes must be a table, got ' ..
574
- type (indexes ))
575
- assert (type (collections ) == ' table' , ' collections must be a table, got ' ..
576
- type (collections ))
577
- local connection_indexes = {}
578
- for _ , collection in pairs (collections ) do
579
- for _ , c in ipairs (collection .connections ) do
580
- if connection_indexes [c .destination_collection ] == nil then
581
- connection_indexes [c .destination_collection ] = {}
582
- end
583
- local index_name = c .index_name
584
- assert (type (index_name ) == ' string' ,
585
- ' index_name must be a string, got ' .. type (index_name ))
586
- -- @todo add commentary and fix style
587
556
local function set_connection_index (c , c_name , c_type , collection_name ,
588
557
indexes , connection_indexes )
589
558
assert (type (c .index_name ) == ' string' ,
0 commit comments