View Source erldns_storage_mnesia (erldns v4.2.0)
Summary
Functions
Should backup the tables in the schema. https://github.com/SiftLogic/erl-dns/issues/3
Create the schema for mnesia, get the configuration from the config. Function sends 'ok' if schema is created, or if it already exists.
Delete a mnesia record, have to do things different for zones since we specified {record_name, zone} in the table creation.
delete the entire table.
Clear all objects from given table in mnesia DB.
Wrapper for foldl.
Insert into specified table. zone_cache calls this by {name, #zone{}}
Lists the contents of the given table.
Select based on key value.
Select using ETS match spec converted to Mnesia's match_object pattern
Delete all zone records or zone records typed based on the match spec. The match spec is given as an ETS match spec, thus it needs to be converted to a record match spec for Mnesia.
Functions
Should backup the tables in the schema. https://github.com/SiftLogic/erl-dns/issues/3
-spec backup_tables() -> ok | {error, Reason :: term()}.
-spec create(atom()) -> ok.
Create the schema for mnesia, get the configuration from the config. Function sends 'ok' if schema is created, or if it already exists.
Delete a mnesia record, have to do things different for zones since we specified {record_name, zone} in the table creation.
delete the entire table.
Clear all objects from given table in mnesia DB.
Wrapper for foldl.
Insert into specified table. zone_cache calls this by {name, #zone{}}
-spec list_table(atom()) -> [] | [#zone{name :: dns:dname(), version :: binary(), authority :: [dns:rr()], record_count :: non_neg_integer(), records :: [dns:rr()] | trimmed, records_by_name :: #{binary() => [dns:rr()]} | trimmed, records_by_type :: term(), keysets :: [erldns:keyset()]}] | [#authorities{owner_name :: term(), ttl :: term(), class :: term(), name_server :: term(), email_addr :: term(), serial_num :: term(), refresh :: term(), retry :: term(), expiry :: term(), nxdomain :: term()}] | [tuple()] | {error, doesnt_exist}.
Lists the contents of the given table.
Select based on key value.
Select using ETS match spec converted to Mnesia's match_object pattern
Delete all zone records or zone records typed based on the match spec. The match spec is given as an ETS match spec, thus it needs to be converted to a record match spec for Mnesia.