Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Erlang macro for automatically creating local mnesia tables for a record.
% Damn record_info compilation
-define(create_table(RecordName),(fun() ->
try
mnesia:table_info(type, RecordName)
catch
exit:_ ->
mnesia:create_table(RecordName, [{attributes, record_info(fields, RecordName)},
{type, ordered_set},
{disc_copies, [node()]}])
end
end)()).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.