如何在 Mnesia 中定义外键
Mnesia 中是否有与此 SQL 语句等效的语句?
alter table TABLE
add foreign key (FIELD)
references TABLE2 (FIELD2)
Is there an equivalent to this SQL statement in Mnesia?
alter table TABLE
add foreign key (FIELD)
references TABLE2 (FIELD2)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不,你必须在你的记忆交易中自己做所有这些事情。 一致性是您的责任。
Mnesia 在这些功能上故意简化了一些,因此很容易看到执行查询/更新的成本。 对表二级索引的支持基本上是您获得的唯一好处。
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.
有一个由 Ulf Wiger(以前就职于 Ericcson,现在就职于 Erlang Training And Consulting Ltd)编写的库,名为 RDBMS 为您实现了很多功能。
它已经很老了所以YMMV。
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.