mnesia_registry(3erl)

πŸ“¦
version 25.3.2.8 Β· 4 versions
, in ubuntu noble

✨ NAME ✨

mnesia_registry β€” dump support for registries in erl_interface. This is the Erlang module definition page for mnesia_registry, and yes bestie, we're making it make sense.


πŸ’– DESCRIPTION πŸ’–

Okay so lowkey this module is usually part of the erl_interface application, but rn it's currently part of the Mnesia application. It's mainly intended for internal use within OTP, but it has two functions exported for public use β€” those are the main characters, and we're covering both.

On C-nodes, erl_interface has support for registry tables. These tables reside in RAM on the C-node, but they can also be dumped into Mnesia tables. By default, dumping registry tables through erl_interface causes a corresponding Mnesia table to be created with mnesia_registry:create_table/1, if necessary. No cap, that's the default behavior.

Tables created with these functions can be administered as all other Mnesia tables. They can be included in backups, replicas can be added, and so on. They're normal Mnesia tables owned by the user of the corresponding erl_interface registries. Periodt.

πŸ”₯ EXPORTS πŸ”₯

create_table(Tab) -> ok | exit(Reason)

create_table(Tab) -> ok | exit(Reason)

This is a wrapper function for mnesia:create_table/2. It creates a table (if there is no existing table) with an appropriate set of attributes. The table only resides on the local node, and its storage type is the same as the schema table on the local node, that is, {ram_copies,[node()]} or {disc_copies,[node()]}.

This function is used by erl_interface to create the Mnesia table if it does not already exist. Slay.

create_table(Tab, TabDef) -> ok | exit(Reason)

create_table(Tab, TabDef) -> ok | exit(Reason)

This is another wrapper function for mnesia:create_table/2, and it creates a table (if there is no existing table) with an appropriate set of attributes. The attributes and TabDef are forwarded to mnesia:create_table/2. For example, if the table is to reside as disc_only_copies on all nodes, a call looks as follows:

TabDef = [{{disc_only_copies, node()|nodes()}}],
mnesia_registry:create_table(my_reg, TabDef)

Obsessed with a clean little TableDef moment.

🌈 SEE ALSO 🌈


πŸ’– Sign-off bestie: Ericsson AB β€’ mnesia 4.21.4.2 β€’ mnesia_registry(3erl) β€” that's the footer, and that's the whole page. 🫢

πŸ“¦ where this page comes from