File tree Expand file tree Collapse file tree 3 files changed +33
-4
lines changed Expand file tree Collapse file tree 3 files changed +33
-4
lines changed Original file line number Diff line number Diff line change 152
152
" Use the column name" ,
153
153
" Use the column label\n 'Extended metadata' must be set to true in the JDBC configuration"
154
154
]
155
+ },
156
+ "vscode-db2i.codegen.csvColumnDelimiter" : {
157
+ "type" : " string" ,
158
+ "description" : " Delimiter" ,
159
+ "default" : " Comma" ,
160
+ "enum" : [
161
+ " Comma" ,
162
+ " Semicolon" ,
163
+ " Tab"
164
+ ]
155
165
}
156
166
}
157
167
},
Original file line number Diff line number Diff line change 43
43
" Use the column name" ,
44
44
" Use the column label\n 'Extended metadata' must be set to true in the JDBC configuration"
45
45
]
46
+ },
47
+ "vscode-db2i.codegen.csvColumnDelimiter" : {
48
+ "type" : " string" ,
49
+ "description" : " Delimiter" ,
50
+ "default" : " Comma" ,
51
+ "enum" : [
52
+ " Comma" ,
53
+ " Semicolon" ,
54
+ " Tab"
55
+ ]
46
56
}
47
57
}
48
58
}
Original file line number Diff line number Diff line change @@ -39,6 +39,12 @@ export interface ParsedStatementInfo extends StatementInfo {
39
39
embeddedInfo : ParsedEmbeddedStatement ;
40
40
}
41
41
42
+ const DelimValue = {
43
+ Comma : `,` ,
44
+ Semicolon : `;` ,
45
+ Tab : `\t`
46
+ }
47
+
42
48
export function setCancelButtonVisibility ( visible : boolean ) {
43
49
vscode . commands . executeCommand ( `setContext` , `vscode-db2i:statementCanCancel` , visible ) ;
44
50
}
@@ -414,10 +420,13 @@ async function runHandler(options?: StatementInfo) {
414
420
case `sql` :
415
421
let content = `` ;
416
422
switch ( statementDetail . qualifier ) {
417
- case `csv` : content = csv . stringify ( data , {
418
- header : true ,
419
- quoted_string : true ,
420
- } ) ; break ;
423
+ case `csv` :
424
+ content = csv . stringify ( data , {
425
+ header : true ,
426
+ quoted_string : true ,
427
+ delimiter : DelimValue [ Configuration . get < string > ( `codegen.csvColumnDelimiter` ) || `Comma` ]
428
+ } ) ;
429
+ break ;
421
430
case `json` : content = JSON . stringify ( data , null , 2 ) ; break ;
422
431
423
432
case `sql` :
You can’t perform that action at this time.
0 commit comments