File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,6 +6,11 @@ Features
66* Allow styling prompts with HTML-like tags.
77
88
9+ Bug Fixes
10+ ---------
11+ * Gracefully fail on background completion-refresh connection issues.
12+
13+
914Documentation
1015---------
1116* Document the ` \g ` special command to send a query.
Original file line number Diff line number Diff line change 11import threading
22from typing import Callable
33
4+ import pymysql
5+
46from mycli .packages .special .main import COMMANDS
57from mycli .packages .sqlresult import SQLResult
68from mycli .sqlcompleter import SQLCompleter
@@ -58,22 +60,25 @@ def _bg_refresh(
5860
5961 # Create a new sqlexecute method to populate the completions.
6062 e = sqlexecute
61- executor = SQLExecute (
62- e .dbname ,
63- e .user ,
64- e .password ,
65- e .host ,
66- e .port ,
67- e .socket ,
68- e .character_set ,
69- e .local_infile ,
70- e .ssl ,
71- e .ssh_user ,
72- e .ssh_host ,
73- e .ssh_port ,
74- e .ssh_password ,
75- e .ssh_key_filename ,
76- )
63+ try :
64+ executor = SQLExecute (
65+ e .dbname ,
66+ e .user ,
67+ e .password ,
68+ e .host ,
69+ e .port ,
70+ e .socket ,
71+ e .character_set ,
72+ e .local_infile ,
73+ e .ssl ,
74+ e .ssh_user ,
75+ e .ssh_host ,
76+ e .ssh_port ,
77+ e .ssh_password ,
78+ e .ssh_key_filename ,
79+ )
80+ except pymysql .err .OperationalError :
81+ return
7782
7883 # If callbacks is a single function then push it into a list.
7984 if callable (callbacks ):
You can’t perform that action at this time.
0 commit comments