outcaste-io / issues

File issues here across all public Outcaste Repositories
Apache License 2.0
6 stars 0 forks source link

Composite (compound) ID fields - unique / primary #16

Open jdgamble555 opened 2 years ago

jdgamble555 commented 2 years ago

There are 1000 links in the DGraph forum for this, but basically:

type Bar @unique(user, date) {
  user: String!
  date: String!
}

We need this SQL equivalent: ALTER TABLE `Bar` ADD UNIQUE `unique_index`(`user`, `date`);

We need unique values based on two fields at the same time. There are 1000 use cases for this, but it is a necessity in any mature database. There are only work arounds in CERTAIN situations.

J

manishrjain commented 2 years ago

Yeah, I've been thinking about this. This would be possible in Outserv.