File tree 2 files changed +12
-1
lines changed
2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change
1
+ use std:: sync:: atomic:: Ordering ;
2
+
1
3
use crate :: { adapters:: get_cursor_position, session:: Session } ;
2
4
use anyhow:: { Result , anyhow} ;
3
5
use tower_lsp:: lsp_types:: {
@@ -91,6 +93,8 @@ pub async fn execute_command(
91
93
path,
92
94
} ) ?;
93
95
96
+ std:: sync:: atomic:: fence ( Ordering :: SeqCst ) ;
97
+
94
98
/*
95
99
* Updating all diagnostics: the changes caused by the statement execution
96
100
* might affect many files.
Original file line number Diff line number Diff line change @@ -42,7 +42,14 @@ pub async fn check_sql(params: TypecheckParams<'_>) -> Option<TypecheckDiagnosti
42
42
return None ;
43
43
}
44
44
45
- let res = params. conn . prepare ( params. sql ) . await ;
45
+ let mut conn = match params. conn . acquire ( ) . await {
46
+ Ok ( c) => c,
47
+ Err ( _) => return None ,
48
+ } ;
49
+
50
+ conn. close_on_drop ( ) ;
51
+
52
+ let res = conn. prepare ( params. sql ) . await ;
46
53
47
54
match res {
48
55
Ok ( _) => None ,
You can’t perform that action at this time.
0 commit comments