|
|
| Author |
Message |
|
| ulf.wiger at etxb.ericsso |
Posted: Wed Jan 13, 1999 2:18 pm |
|
|
|
Guest
|
I've contributed a data dictionary to mnesia (see
http://www.erlang.org/user.html)
The dictionary provides:
- type checks
- boundary checks
- verification triggers
- referential integrity
- a select-type access method
- compound attributes
- a type conversion utility (strings to specified types)
- a data import tool which performs integrity checks
...and some other things.
One thing I've noticed when playing with it is that it is not well
documented in mnesia how to perform a series of schema operations within
one schema transaction.
This is obviously something that I wanted to do, since I add user
properties to a table in order to support integrity checks.
Here's how I've done it:
create_table(Tab, MnesiaProps, UserProps) ->
F = fun() ->
mnesia_schema:do_create_table(Tab, MnesiaProps),
rdbms:do_add_properties(UserProps)
end,
mnesia_schema:schema_transaction(F).
Also note that I've patched mnesia_schema.erl in order to support adding
multiple user properties within one transaction. The patch is included
in the rdbms-1.0 package.
/Uffe
--
Ulf Wiger, Chief Designer AXD 301 <ulf.wiger_at_etxb.ericsson.se>
Ericsson Telecom AB tfn: +46 8 719 81 95
Varuv |
|
|
| Back to top |
|
| dgud at erix.ericsson.se |
Posted: Wed Jan 13, 1999 2:42 pm |
|
|
|
Guest
|
Hi Ulf
You want to create a table with some initial user_properties in one
atomic transaction. The simplest way (unfortunately this is
undocumented) to do this is:
mnesia:create_table(foo, [{user_properties, Props}]).
The patch of mnesia_schema is unnecessary.
When it comes to nested schema transactions, you said
"..it is not well documented in mnesia how to perform a series of
schema operations within one schema transaction". This is true and
the simple reason for not documenting that is that nested schema
transactions is not a part of the public API. We do not want to
encourage our customers to use our internal functions.
Regards
Dan, H |
|
|
| Back to top |
|
|
|
All times are GMT
|
|
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
|
|
|