diff options
| author | Michael Klishin <mklishin@pivotal.io> | 2019-06-13 15:44:01 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-06-13 15:44:01 +0300 |
| commit | a65728025c4c4662101c251f6d65264522594266 (patch) | |
| tree | 5094eae22d59a6f8a2b01189f41abb392a6f0aad /src | |
| parent | b7f3fd9a8edfcb5a8c818493440363ce0cc7c790 (diff) | |
| parent | e94bdc7a916a1b3773ca0395bf4ff7f474d850db (diff) | |
| download | rabbitmq-server-git-a65728025c4c4662101c251f6d65264522594266.tar.gz | |
Merge pull request #2033 from rabbitmq/rabbitmq-cli-330
Schema information in mnesia for cli command
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_mnesia.erl | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/rabbit_mnesia.erl b/src/rabbit_mnesia.erl index 162badc33d..bd1c26f20f 100644 --- a/src/rabbit_mnesia.erl +++ b/src/rabbit_mnesia.erl @@ -45,7 +45,10 @@ %% Hooks used in `rabbit_node_monitor' on_node_up/1, - on_node_down/1 + on_node_down/1, + + %% Helpers for diagnostics commands + schema_info/1 ]). %% Used internally in rpc calls @@ -755,6 +758,18 @@ running_disc_nodes() -> ordsets:from_list(RunningNodes))). %%-------------------------------------------------------------------- +%% Helpers for diagnostics commands +%%-------------------------------------------------------------------- + +schema_info(Items) -> + Tables = mnesia:system_info(tables), + [info(Table, Items) || Table <- Tables]. + +info(Table, Items) -> + All = [{name, Table} | mnesia:table_info(Table, all)], + [{Item, proplists:get_value(Item, All)} || Item <- Items]. + +%%-------------------------------------------------------------------- %% Internal helpers %%-------------------------------------------------------------------- |
