(connectionString: string)
| 390 | } |
| 391 | |
| 392 | function normalizeMySQLConnectionString(connectionString: string): string { |
| 393 | const connectionURL = new URL(connectionString) |
| 394 | |
| 395 | const connectionLimit = connectionURL.searchParams.get('connection_limit') |
| 396 | |
| 397 | if (connectionLimit && !connectionURL.searchParams.has('connectionLimit')) { |
| 398 | connectionURL.searchParams.set('connectionLimit', connectionLimit) |
| 399 | } |
| 400 | |
| 401 | const sslAccept = connectionURL.searchParams.get('sslaccept') |
| 402 | |
| 403 | if (sslAccept && !connectionURL.searchParams.has('ssl')) { |
| 404 | connectionURL.searchParams.set('ssl', JSON.stringify(prismaSslAcceptToMySQL2Ssl(sslAccept))) |
| 405 | } |
| 406 | |
| 407 | for (const queryParameter of PRISMA_ORM_SPECIFIC_MYSQL_QUERY_PARAMETERS) { |
| 408 | connectionURL.searchParams.delete(queryParameter) |
| 409 | } |
| 410 | |
| 411 | return connectionURL.toString() |
| 412 | } |
| 413 | |
| 414 | function prismaSslAcceptToMySQL2Ssl(sslAccept: string): { rejectUnauthorized: boolean } { |
| 415 | switch (sslAccept) { |
no test coverage detected