Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More useful id #11

Open
eldoy opened this issue Aug 6, 2023 · 1 comment
Open

More useful id #11

eldoy opened this issue Aug 6, 2023 · 1 comment

Comments

@eldoy
Copy link
Owner

eldoy commented Aug 6, 2023

At the moment the generated CUID id looks the same for all collections.

It could be useful to prefix id with collection name and id_ so we can check if the value is an id and which collection it belongs to:

var value = id_project_clkl5glym00005gpjgwdyhbnb
var [marker, collection, id] = value.split('_')
if (value.startsWith('id_')) {
  // is id
}

Unrelated, but worth mentioning, internally the 'id' should probably be 'project_id' everywhere so we know what kind of id we are dealing with, as a "best practice" measure?

@eldoy
Copy link
Owner Author

eldoy commented Aug 6, 2023

This means d8a validation is: 'id' must be updated or all old apps will break.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant