(connection: Connection)
| 11 | } |
| 12 | |
| 13 | export const newConnector = (connection: Connection): Connector => { |
| 14 | switch (connection.engineType) { |
| 15 | case Engine.MySQL: |
| 16 | return mysql(connection); |
| 17 | case Engine.PostgreSQL: |
| 18 | return postgres(connection); |
| 19 | case Engine.MSSQL: |
| 20 | return mssql(connection); |
| 21 | case Engine.OceanBase: |
| 22 | return mysql(connection); |
| 23 | default: |
| 24 | throw new Error("Unsupported engine type."); |
| 25 | } |
| 26 | }; |