Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check attributes for consistency amongst key definitions #38

Closed
AndyDentFree opened this issue Jul 20, 2015 · 3 comments
Closed

Check attributes for consistency amongst key definitions #38

AndyDentFree opened this issue Jul 20, 2015 · 3 comments

Comments

@AndyDentFree
Copy link
Contributor

Because we're specifying the primary key using the attribute [PrimaryKey] [ObjectId]we need a check to make sure this is not specified on more than one field in a given class. This has to be a runtime check. Update 2016-02-19 with more Fody knowledge, now realise we can easily do this in Fody

Alternatively, we could redesign the feature to specify the primary key with key name as parameter and make it a class-level attribute. That would take care of the problem of specifying more than one but then add a different check to ensure the field name was valid and that the field wasn't tagged with the [Ignore]

@AndyDentFree AndyDentFree added this to the Phase 2 milestone Jul 20, 2015
@AndyDentFree
Copy link
Contributor Author

https://github.com/realm/realm-wiki/wiki/Bindings says we should specify single or, possibly, multiple properties to act as a primary key so it seems multiple field specification is explicitly required - the problem then is one of ordering of fields to provide the composite key.

@bmunkholm
Copy link
Contributor

multiple keys are not yet supported. But it doesn't harm to consider if the
API that get's made could support it.

On Sun, Aug 16, 2015 at 11:53 AM, Andy Dent notifications@github.com
wrote:

https://github.com/realm/realm-wiki/wiki/Bindings says we should specify
single or, possibly, multiple properties to act as a primary key
so it
seems multiple field specification is explicitly required - the problem
then is one of ordering of fields to provide the composite key.


Reply to this email directly or view it on GitHub
#38 (comment).

@AndyDentFree AndyDentFree added P2 and removed P2 labels Aug 26, 2015
@timanglade timanglade removed this from the Phase 2 milestone Dec 8, 2015
@AndyDentFree
Copy link
Contributor Author

Note that PrimaryKey was renamed ObjectId (we're at least floating with that in the dotnet betas and will see how users react, other products haven't changed).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants