File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
exts/ext-database/src/main/kotlin/cc/unitmesh/database/provider Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -28,11 +28,15 @@ class SqlRunService : RunService {
28
28
isFromToolAction : Boolean
29
29
): String? {
30
30
val sql = runReadAction { PsiManager .getInstance(project).findFile(virtualFile) } as ? SqlFile
31
- ? : return null
31
+ ? : return " <DevInsError> SQL: cannot find PSI file "
32
32
33
- if (sql.fileType !is SqlFileType ) return null
33
+ if (sql.fileType !is SqlFileType ) return " <DevInsError> SQL: not a SQL file "
34
34
val content = runReadAction { sql.text }
35
- return DatabaseSchemaAssistant .executeSqlQuery(project, content)
35
+ try {
36
+ return DatabaseSchemaAssistant .executeSqlQuery(project, content)
37
+ } catch (e: Exception ) {
38
+ return " <DevInsError> SQL: ${e.message} "
39
+ }
36
40
}
37
41
38
42
override fun runConfigurationClass (project : Project ): Class <out RunProfile >? =
You can’t perform that action at this time.
0 commit comments