Erlang/OTP Forums

Author Message

<  Erlang questions mailing list  ~  Diskbased Mnesia Nodes

icimjs at loop.com
Posted: Tue Jun 15, 1999 7:41 am Reply with quote
Guest
Hi,

what is the shortest instruction for implementing a diskbased mnesia table?

TIA,

Elan
====================================
Get your copy of FaxForward
http://www.commercebox.com/FaxForward/



Post generated using Mail2Forum (http://m2f.sourceforge.net)
ulf.wiger at etx.ericsson
Posted: Tue Jun 15, 1999 7:51 am Reply with quote
Guest
Elan wrote:
>
> Hi,
>
> what is the shortest instruction for implementing a diskbased mnesia table?
>
> TIA,
>
> Elan


mnesia:create_table(TableName, [{disc_copies, [node()]},
{attributes, [...]}]).

will create a table which resides on disk and in RAM on the current
node.


mnesia:create_table(TableName, [{disc_only_copies, [node()]},
{attributes, [...]}]).

will create a table which resides on disk only.


Typically, attributes are given with the following construct:

{attributes, record_info(fields, RecName)}


If you want the entire sequence of commands:

erl -sname foo
foo_at_hostname 1> mnesia:create_schema([node()]).
foo_at_hostname 2> mnesia:start().
foo_at_hostname 3> mnesia:create_table(...).

This will:
1. start an Erlang node with the "shortname" foo_at_<hostname>
2. create a mnesia schema under <CWD>/Mnesia.foo_at_<hostname>/
3. start mnesia
4. create a table as above

/Uffe
--
Ulf Wiger, Chief Designer AXD 301 <ulf.wiger_at_etx.ericsson.se>
Ericsson Telecom AB tfn: +46 8 719 81 95
Varuv

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum