createMSSQLDriver creates and opens a MSSQL driver connection
(ctx context.Context, host, port, database string)
| 13 | |
| 14 | // createMSSQLDriver creates and opens a MSSQL driver connection |
| 15 | func createMSSQLDriver(ctx context.Context, host, port, database string) (db.Driver, error) { |
| 16 | driver := &mssqldb.Driver{} |
| 17 | config := db.ConnectionConfig{ |
| 18 | DataSource: &storepb.DataSource{ |
| 19 | Type: storepb.DataSourceType_ADMIN, |
| 20 | Username: "sa", |
| 21 | Host: host, |
| 22 | Port: port, |
| 23 | Database: database, |
| 24 | }, |
| 25 | Password: "Test123!", |
| 26 | ConnectionContext: db.ConnectionContext{ |
| 27 | DatabaseName: database, |
| 28 | }, |
| 29 | } |
| 30 | return driver.Open(ctx, storepb.Engine_MSSQL, config) |
| 31 | } |
| 32 | |
| 33 | // executeSQL executes SQL statements, handling GO separators |
| 34 | func executeSQL(ctx context.Context, driver db.Driver, sql string) error { |
no test coverage detected