Add Sqlserver database support#51
Conversation
|
Thanks for that! Will take a look soon, probably next week! |
fraenky8
left a comment
There was a problem hiding this comment.
Mainly some naming and vendor changes.
Did you try your changes? Does it work? Since I don't have any experience working with SQLServer I have to trust you on this one.
| // Sqlserver implements the Database interface with help of GeneralDatabase. | ||
| type Sqlserver struct { |
There was a problem hiding this comment.
Lets use consistently SQLServer as name. (ref https://github.com/golang/go/wiki/CodeReviewComments#initialisms)
| } | ||
|
|
||
| // DSN creates the DSN String to connect to this database. | ||
| func (ss *Sqlserver) DSN() string { |
There was a problem hiding this comment.
Lets add a unit test for that? I see the other database implementation have one, just for the sake of consistency?
| if ss.Settings.User != "" { | ||
| user = ss.Settings.User | ||
| } | ||
| return fmt.Sprintf("server=%s;port=%s;user=%s;database=%s;password=%s", |
There was a problem hiding this comment.
Is there a way to connect via a socket to SQLServer? I see MySQL and PG have this option. Can you check and add it here as well?
| // columns of a specific table for a given database. | ||
| func (ss *Sqlserver) PrepareGetColumnsOfTableStmt() (err error) { | ||
|
|
||
| ss.GetColumnsOfTableStmt, err = ss.Preparex(` |
There was a problem hiding this comment.
Just to be double sure, since I don't have any experience with SQLServer - this statement is the same as for PG except the placeholder format?
| @@ -14,7 +14,11 @@ require ( | |||
|
|
|||
There was a problem hiding this comment.
Can you run go mod tidy and go mod vendor to include the vendor changes?
Add SQL Server database support
vendor/ folder is not included in this patch.