(db_type, host, port, username, password, database, extra_params=None)
| 50 | |
| 51 | @staticmethod |
| 52 | def create_client(db_type, host, port, username, password, database, extra_params=None) -> BaseJdbcClient: |
| 53 | if extra_params is None: |
| 54 | extra_params = {} |
| 55 | if db_type == 'mysql': |
| 56 | conn = MySQLdb.connect( |
| 57 | host=host, |
| 58 | port=port, |
| 59 | user=username, |
| 60 | passwd=password, |
| 61 | db=database, |
| 62 | **extra_params |
| 63 | ) |
| 64 | |
| 65 | return MySQLClient(conn) |
| 66 | else: |
| 67 | raise ValueError("Unsupported database type") |
| 68 | |
| 69 | @staticmethod |
| 70 | def run_query(client, sql: str): |
no test coverage detected