(url: string)
| 8 | dirname: string |
| 9 | } |
| 10 | function getMSSQLConfig(url: string): mssql.config { |
| 11 | const connectionUrl = new URL(url) |
| 12 | return { |
| 13 | user: connectionUrl.username, |
| 14 | password: connectionUrl.password, |
| 15 | server: connectionUrl.hostname, |
| 16 | port: Number(connectionUrl.port), |
| 17 | database: connectionUrl.pathname.substring(1), |
| 18 | pool: { |
| 19 | max: 1, |
| 20 | }, |
| 21 | options: { |
| 22 | enableArithAbort: false, |
| 23 | trustServerCertificate: true, // change to true for local dev / self-signed certs |
| 24 | }, |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | export async function setupMSSQL(options: SetupParams, databaseName: string): Promise<void> { |
| 29 | const { connectionString } = options |
no outgoing calls
no test coverage detected