File tree 2 files changed +18
-4
lines changed
2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change 98
98
"default" : false ,
99
99
"description" : " (Unstable) Use embedded language server for intelligent completion and hover information."
100
100
},
101
+ "SQLNotebook.outputJSON" : {
102
+ "type" : " boolean" ,
103
+ "default" : false ,
104
+ "description" : " Output JSON in addition to markdown. Other extensions may use this output type to render an interactive table."
105
+ },
101
106
"SQLNotebook.queryTimeout" : {
102
107
"type" : " number" ,
103
108
"default" : 30000 ,
Original file line number Diff line number Diff line change @@ -92,10 +92,13 @@ export class SQLNotebookController {
92
92
93
93
writeSuccess (
94
94
execution ,
95
- result . map ( ( item ) => [
96
- text ( resultToMarkdownTable ( item ) , 'text/markdown' ) ,
97
- json ( item ) ,
98
- ] )
95
+ result . map ( ( item ) => {
96
+ const outputs = [ text ( resultToMarkdownTable ( item ) , 'text/markdown' ) ] ;
97
+ if ( outputJsonMimeType ( ) ) {
98
+ outputs . push ( json ( item ) ) ;
99
+ }
100
+ return outputs ;
101
+ } )
99
102
) ;
100
103
}
101
104
}
@@ -118,3 +121,9 @@ function writeSuccess(
118
121
) ;
119
122
execution . end ( true , Date . now ( ) ) ;
120
123
}
124
+
125
+ function outputJsonMimeType ( ) : boolean {
126
+ return (
127
+ vscode . workspace . getConfiguration ( 'SQLNotebook' ) . get ( 'outputJSON' ) ?? false
128
+ ) ;
129
+ }
You can’t perform that action at this time.
0 commit comments