Skip to content

006: Drop support for string IDs

Status

Draft

Context

Supporting string IDs has made the source code more complex because it:

  • We have to handle each case str, and int independently.
  • The signature of the functions is more complex.
  • str ids don't have the auto-increment feature.

On the other hand, string IDs are useful when the identifying property of an entity is a string. This gives two benefits:

  • You can repo.get by that element.
  • You can't have two elements with the same attribute.

Proposals

We can try to simplify the ID signature to int only while giving the users tools so that they don't loose the benefits of the str IDs.

  • We already added an optional argument to repo.get so that you can get by another attribute. This way it would be easy to spot what attributes would need their own index.
  • We'll need to support uniqueness of entities based on an attribute other than id_. (We need to refine this idea.)

Decision

Consequences


Last update: 2022-08-12