Reputation: 1453
Is there an equivalent to this SQL statement in Mnesia?
alter table TABLE
add foreign key (FIELD)
references TABLE2 (FIELD2)
Upvotes: 4
Views: 724
Reputation: 6274
There is a library written by Ulf Wiger (formerly of Ericcson, now at Erlang Training And Consulting Ltd) called RDBMS which implements a lot of this for you.
It is quite old so YMMV.
Upvotes: 4
Reputation: 9486
No, you have to do all these things yourself in your mnesia transactions. Consistency is your responsibility.
Mnesia is somewhat intentionally simplistic in these features, so it is easy to see the costs in performing queries/updates. The support for secondary indexes on tables is basically the only sugar you get.
Upvotes: 7