(c: PoolConfig)
| 41 | | PostgresConfig; |
| 42 | |
| 43 | export async function getPool(c: PoolConfig): Promise<Pool> { |
| 44 | switch (c.driver) { |
| 45 | case 'mysql': |
| 46 | return createMySQLPool(c); |
| 47 | case 'mssql': |
| 48 | return createMSSQLPool(c); |
| 49 | case 'postgres': |
| 50 | return createPostgresPool(c); |
| 51 | case 'sqlite': |
| 52 | return createSqLitePool(c); |
| 53 | default: |
| 54 | throw Error('invalid driver key'); |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | // BaseConfig describes driver configuration options common between all implementations. |
| 59 | // Driver-specific options are included in extensions that inherit this. |
no test coverage detected