-
Notifications
You must be signed in to change notification settings - Fork 13
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
feat(minato): add primary
type for auto generated primary key
#36
Conversation
feat(mongo): `primary` work as ObjectId Signed-off-by: Hieuzest <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #36 +/- ##
=======================================
Coverage 98.04% 98.05%
=======================================
Files 23 23
Lines 4652 4670 +18
Branches 1142 1150 +8
=======================================
+ Hits 4561 4579 +18
Misses 91 91
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
packages/core/src/model.ts
Outdated
|
||
export type Type<T = any> = | ||
| T extends number ? 'integer' | 'unsigned' | 'float' | 'double' | 'decimal' | ||
: T extends string ? 'char' | 'string' | 'text' | ||
: T extends boolean ? 'boolean' | ||
: T extends Date ? 'timestamp' | 'date' | 'time' | ||
: T extends unknown[] ? 'list' | 'json' | ||
: T extends Primary ? 'primary' | 'unsigned' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why unsigned
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unsigned
refer to the original autoInc. This allows mongo users to only change type Primary
and still use old style autoInc as kind of compatibility. Also i don't have to edit definitions in tests lol.
primary
type for auto generated primary keyprimary
type for auto generated primary key
close #35