Skip to content

Commit 71e830f

Browse files
Merge pull request #2033 from rabbitmq/rabbitmq-cli-330
Schema information in mnesia for cli command (cherry picked from commit a657280)
1 parent e4960d3 commit 71e830f

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/rabbit_mnesia.erl

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@
4040
ensure_mnesia_dir/0,
4141

4242
on_node_up/1,
43-
on_node_down/1
43+
on_node_down/1,
44+
45+
%% Helpers for diagnostics commands
46+
schema_info/1
4447
]).
4548

4649
%% Used internally in rpc calls
@@ -711,6 +714,18 @@ running_disc_nodes() ->
711714
ordsets:to_list(ordsets:intersection(ordsets:from_list(DiscNodes),
712715
ordsets:from_list(RunningNodes))).
713716

717+
%%--------------------------------------------------------------------
718+
%% Helpers for diagnostics commands
719+
%%--------------------------------------------------------------------
720+
721+
schema_info(Items) ->
722+
Tables = mnesia:system_info(tables),
723+
[info(Table, Items) || Table <- Tables].
724+
725+
info(Table, Items) ->
726+
All = [{name, Table} | mnesia:table_info(Table, all)],
727+
[{Item, proplists:get_value(Item, All)} || Item <- Items].
728+
714729
%%--------------------------------------------------------------------
715730
%% Internal helpers
716731
%%--------------------------------------------------------------------

0 commit comments

Comments
 (0)