-
Notifications
You must be signed in to change notification settings - Fork 19
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
ID field #46
Comments
1: I think this issue must to be opened into Gotu lib 2: Awesome ideia! what do you think about we have an "uuid" type too? const { field, id, UUID } = require('@herbs/herbs') // gotu
const Customer =
entity('Customer', {
id: id(UUID), <---- uuid id definition
SSN: id(Number),
name: field(String),
isVIP() {
...
}
}) |
Its a better way to improve the metadata about entities. |
you can already use const { field, id, UUID } = require('@herbs/herbs') // gotu
const Customer =
entity('Customer', {
id: id(String, , { default: () => new UUID() }), <---- uuid id definition
}) |
I agree with @dalssoft, we already have this possibility with default. |
this issue make match with this feature herbsjs/herbs2knex#23 |
One more thing. the code below should have the same behavior: const Customer =
entity('Customer', {
id: id(Number), <---- id definition
...
}) And const Customer =
entity('Customer', {
id: field(Number, isID: true), <---- id definition
...
}) So |
I agree with you @dalssoft! |
Adding ID field option on metadata. herbsjs#46
# [1.1.0](v1.0.0...v1.1.0) (2021-12-12) ### Features * **field:** add id field type ([d896b54](d896b54)), closes [#46](#46)
🎉 This issue has been resolved in version 1.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
In order to improve metadata about which fields represent the IDs of an entity it would be possible to declare as field like:
for composite IDs (ex: id + SSN):
metadata:
This would help in:
The text was updated successfully, but these errors were encountered: