graphprotocol / graphprotocol/graph-node
Introduce uniquness constraints for entity fields
Nessuno ha ancora preso questa issue.
- Lingua principale
- Rust
- Stelle
- 3.2k
- Fork
- 1.1k
- Merge medio
- 4g 1h
- PR unite (30g)
- 1
Descrizione
It would be useful to be able to provide uniqueness constraints for entity fields, importantly
- each constraint should be able to cover more than one field
- it should be possible to define more than one such constraint per entity
This constraint should be enforced at the database level, helping the mapping author from making mistakes, and also would clarify the semantics of the data model to third parties looking at the entity definition.
It is not possible to capture both of these properties by simply picking a suitable id field, take the following example.
I have a Profile entity that holds both a handle: String! and an account: Bytes!.
I may want to model the fact that both must be unique independently. In this case, using the entity ID = account||handle does not work, it is too loose, it allows two profiles which have the same handle value, but distinct account.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
L’issue non indica file di implementazione né test. Inizia tracciando come vengono definiti e persistiti i campi e gli identificatori delle entità, quindi progetta il supporto per più vincoli di unicità a livello di database, inclusi i vincoli che si estendono su più campi; il lavoro è completato quando sono rappresentati e applicati sia i vincoli indipendenti sia quelli composti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- rust
- Ambito
- database
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100