MCPcopy Create free account
hub / github.com/CloudOrc/SolidUI / create_client

Method create_client

solidui/datasource_plugin/base.py:52–67  ·  view source on GitHub ↗
(db_type, host, port, username, password, database, extra_params=None)

Source from the content-addressed store, hash-verified

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):

Callers 6

connectMethod · 0.80
get_databasesMethod · 0.80
get_tablesMethod · 0.80
get_table_dataMethod · 0.80
query_sqlMethod · 0.80
query_sql_by_idMethod · 0.80

Calls 2

MySQLClientClass · 0.85
connectMethod · 0.80

Tested by

no test coverage detected