Custom ID generation function #6
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Research
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
slendium/ocd#6
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
During development of #1 three
IdGenerator's have been declared:None,SequenceandUniqueIdentifier.A fourth case
CustomFunctionshould be added. The custom function itself would be declared as a property on the#[IdOptions]attribute with the following signature:pure-Closure(Document):string, where theDocumentis the document to be inserted. TheDocumentshould be a read-only wrapper of the actual document being inserted.The knowledge on how to generate an ID is specific to each
Entityand should therefore be part of the ORM attributes in the same class. It should not be delegated to the application/framework.Two use-cases for custom ID functions have been encountered (so far) by me personally: