为什么Realm不支持自动递增主键? [英] Why Realm don't support auto increment primary key?
问题描述
是否有一些利弊来实现该功能?
Is there some pros or cons to not implement that feature?
我知道一些解决方案存在,并且已经在路线图上,但是这个决定背后有我们没有被授予的任何优势吗?
I know some solutions exist and that it's on there road maps but are there any advantages behind that decision that we are not award of?
推荐答案
In a discussion on Github (see realm/realm-cocoa#2591) the Realm team said there are no plans for support any auto increment field, even if there's a few lines of code a developer can use for implementing this feature as you said.
在讨论中来自Realm成员:
From a Realm member in the discussion:
我们决定不支持此功能,因为通过多个进程同时访问将无法支持它.
We decided that we're not going to support this feature, because we would be unable to support it with simultaneous access from multiple processes.
就这样.
这篇关于为什么Realm不支持自动递增主键?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!