Coverage for mindsdb / integrations / handlers / mysql_handler / connection_args.py: 100%

4 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2026-01-21 00:36 +0000

1from collections import OrderedDict 

2 

3from mindsdb.integrations.libs.const import HANDLER_CONNECTION_ARG_TYPE as ARG_TYPE 

4 

5 

6connection_args = OrderedDict( 

7 url={ 

8 "type": ARG_TYPE.STR, 

9 "description": "The URI-Like connection string to the MySQL server. If provided, it will override the other connection arguments.", 

10 "required": False, 

11 "label": "URL", 

12 }, 

13 user={ 

14 "type": ARG_TYPE.STR, 

15 "description": "The user name used to authenticate with the MySQL server.", 

16 "required": True, 

17 "label": "User", 

18 }, 

19 password={ 

20 "type": ARG_TYPE.PWD, 

21 "description": "The password to authenticate the user with the MySQL server.", 

22 "required": True, 

23 "label": "Password", 

24 "secret": True, 

25 }, 

26 database={ 

27 "type": ARG_TYPE.STR, 

28 "description": "The database name to use when connecting with the MySQL server.", 

29 "required": True, 

30 "label": "Database", 

31 }, 

32 host={ 

33 "type": ARG_TYPE.STR, 

34 "description": "The host name or IP address of the MySQL server. NOTE: use '127.0.0.1' instead of 'localhost' to connect to local server.", 

35 "required": True, 

36 "label": "Host", 

37 }, 

38 port={ 

39 "type": ARG_TYPE.INT, 

40 "description": "The TCP/IP port of the MySQL server. Must be an integer.", 

41 "required": True, 

42 "label": "Port", 

43 }, 

44 ssl={ 

45 "type": ARG_TYPE.BOOL, 

46 "description": "Set it to True to enable ssl.", 

47 "required": False, 

48 "label": "ssl", 

49 }, 

50 ssl_ca={ 

51 "type": ARG_TYPE.PATH, 

52 "description": "Path or URL of the Certificate Authority (CA) certificate file", 

53 "required": False, 

54 "label": "ssl_ca", 

55 }, 

56 ssl_cert={ 

57 "type": ARG_TYPE.PATH, 

58 "description": "Path name or URL of the server public key certificate file", 

59 "required": False, 

60 "label": "ssl_cert", 

61 }, 

62 ssl_key={ 

63 "type": ARG_TYPE.PATH, 

64 "description": "The path name or URL of the server private key file", 

65 "required": False, 

66 "label": "ssl_key", 

67 }, 

68) 

69 

70connection_args_example = OrderedDict( 

71 host="127.0.0.1", port=3306, user="root", password="password", database="database" 

72)