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

rel.String should be NVARCHAR #6

Closed
billgraziano opened this issue Mar 13, 2021 · 1 comment
Closed

rel.String should be NVARCHAR #6

billgraziano opened this issue Mar 13, 2021 · 1 comment

Comments

@billgraziano
Copy link

Disclaimer: I'm just reviewing the code while deciding whether to use or not. I haven't used this for real yet.

I believe a GO string (Unicode) best matches to NVARCHAR instead of VARCHAR. That will support the full Unicode set. At least that's what I've done in my code and it's worked well.

mssql/mssql.go

Lines 137 to 142 in e7d7d12

case rel.String:
typ = "VARCHAR"
m = column.Limit
if m == 0 {
m = 255
}

@Fs02
Copy link
Member

Fs02 commented Mar 14, 2021

Thank you again for this great feedback, I've created a pr to address this issue.
please take a look if you have time 😄

FYI: This column mapping is only used for migration functionality and it's also possible to explicitly define corresponding MSSQL type using the following function:

func (t *Table) Column(name string, typ ColumnType, options ...ColumnOption)

this issue gave me an idea to create extension type on this driver, to better cover all available types in MSSQL, thanks

@Fs02 Fs02 closed this as completed Mar 19, 2021
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

2 participants