question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Compound primary keys

See original GitHub issue

Realm should also support composite primary keys. Reusing the @PrimaryKey annotation should be relatively simple.

public class CompositeKeyObj extends RealmObject {

  @PrimaryKey
  private int compositePartOne;

  @PrimaryKey
  private int compositePartTwo;
}

Primary keys are currently implemented in the binding. This should be implemented at the core level: https://github.com/realm/realm-core/issues/831

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:58
  • Comments:50 (7 by maintainers)

github_iconTop GitHub Comments

14reactions
CsabaMiomnicommented, Feb 16, 2018

+1 million

9reactions
wuwu2000commented, Apr 22, 2016

+1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Composite Key in SQL - GeeksforGeeks
Now a composite key is also a primary key, but the difference is that it is made by the combination of more than...
Read more >
How can I define a composite primary key in SQL?
A primary key consists of one or more columns (from that table). ... consists of two or more columns it is called a...
Read more >
How to Create MySQL Composite Primary Keys Simplified 101?
Each entry in a table is uniquely identified by the PRIMARY KEY constraint. Primary keys must have UNIQUE values and should not have...
Read more >
SQL COMPOSITE KEY - javatpoint
Composite key is a key which is the combination of more than one field or column of a given table. It may be...
Read more >
Composite key - Wikipedia
In database design, a composite key is a candidate key that consists of two or more attributes (table columns) that together uniquely identify...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found