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

refactor: optimize the mapping relationship for integer data types #129

Closed
wants to merge 0 commits into from

Conversation

iTanken
Copy link
Contributor

@iTanken iTanken commented Mar 18, 2024

  • Do only one thing
  • Non breaking API changes
  • Tested

What did this pull request do?

Optimize the mapping relationship for integer data types.

Close #119, Close #128

User Case Description

gorm tag sqlserver datatype sqlserver data value ranges
I uint `gorm:"size:8"` tinyint 0 to 255
I int `gorm:"size:16"` smallint -32,768 to 32,767
I uint `gorm:"size:16"` int -2,147,483,648 to 2,147,483,647
I int `gorm:"size:32"` int -2,147,483,648 to 2,147,483,647
I uint `gorm:"size:32"` bigint -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
I int `gorm:"size:64"` bigint -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807

https://learn.microsoft.com/en-us/sql/t-sql/data-types/int-bigint-smallint-and-tinyint-transact-sql

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