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 152152 " Use the column name" ,
153153 " Use the column label\n 'Extended metadata' must be set to true in the JDBC configuration"
154154 ]
155+ },
156+ "vscode-db2i.codegen.csvColumnDelimiter" : {
157+ "type" : " string" ,
158+ "description" : " Delimiter" ,
159+ "default" : " Comma" ,
160+ "enum" : [
161+ " Comma" ,
162+ " Semicolon" ,
163+ " Tab"
164+ ]
155165 }
156166 }
157167 },
Original file line number Diff line number Diff line change 4343 " Use the column name" ,
4444 " Use the column label\n 'Extended metadata' must be set to true in the JDBC configuration"
4545 ]
46+ },
47+ "vscode-db2i.codegen.csvColumnDelimiter" : {
48+ "type" : " string" ,
49+ "description" : " Delimiter" ,
50+ "default" : " Comma" ,
51+ "enum" : [
52+ " Comma" ,
53+ " Semicolon" ,
54+ " Tab"
55+ ]
4656 }
4757 }
4858 }
Original file line number Diff line number Diff line change @@ -39,6 +39,12 @@ export interface ParsedStatementInfo extends StatementInfo {
3939 embeddedInfo : ParsedEmbeddedStatement ;
4040}
4141
42+ const DelimValue = {
43+ Comma : `,` ,
44+ Semicolon : `;` ,
45+ Tab : `\t`
46+ }
47+
4248export function setCancelButtonVisibility ( visible : boolean ) {
4349 vscode . commands . executeCommand ( `setContext` , `vscode-db2i:statementCanCancel` , visible ) ;
4450}
@@ -414,10 +420,13 @@ async function runHandler(options?: StatementInfo) {
414420 case `sql` :
415421 let content = `` ;
416422 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 ;
421430 case `json` : content = JSON . stringify ( data , null , 2 ) ; break ;
422431
423432 case `sql` :
You can’t perform that action at this time.
0 commit comments