Mnesia判断数据库和表是否存在

2021-03-03 13:26:42 浏览数 (2)

-        lager:info("The-table-agent_cache_table-is-not-exists-in-mnesia-!!!") -    end.">1. 判断数据库是否存在 case mnesia:system_info(use_dir) of     true ->         alread_created;     _ ->         mnesia:create_schema([node()])     end. 2. 判断表是否存在 case lists:member(agent_cache_table, mnesia:system_info(tables)) of     true ->         lager:info("The table agent_cache_table is exists in mnesia !!!");     _ ->         lager:info("The table agent_cache_table is not exists in mnesia !!!")     end.

0 人点赞