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

fix (MSSQLDriver) : Set size of nvarchar/varchar/varbinary columns. Filter sysname columns from list. #197

Merged
merged 1 commit into from
Apr 14, 2020

Conversation

jafin
Copy link
Contributor

@jafin jafin commented Apr 14, 2020

Improve MSSQL Column support.

  • Set the size of nvarchar/varchar/varbinary columns.
  • Filter out sysname columns.

Apologies my first GO contribution. Feel free to feedback improve the PR.

Copy link
Owner

@k1LoW k1LoW left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jafin Thank you for your Nice commit !!
I think I've learned a lot !

@@ -456,10 +458,27 @@ func convertTableType(t string) string {
}
}

func convertColmunType(t string, maxLength int) string {
func convertColumnType(t string, maxLength int) string {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops!! Thank you !!

return fmt.Sprintf("varchar(%d)", maxLength)
var len string = strconv.Itoa(maxLength)
if maxLength == -1 {
len = "MAX"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

len = "MAX"
}
return fmt.Sprintf("varchar(%s)", len)
case "nvarchar":
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got it

@k1LoW k1LoW merged commit e32e575 into k1LoW:master Apr 14, 2020
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

Successfully merging this pull request may close these issues.

2 participants