mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Added more saveAsCsv options (#2099)
Fixes #203 Options: lineSeperator textIdentifier encoding
This commit is contained in:
committed by
Karl Burtram
parent
3e47b27192
commit
49e20488bc
@@ -289,6 +289,21 @@ let registryProperties = {
|
|||||||
'description': localize('sql.saveAsCsv.delimiter', '[Optional] The custom delimiter to use between values when saving as CSV'),
|
'description': localize('sql.saveAsCsv.delimiter', '[Optional] The custom delimiter to use between values when saving as CSV'),
|
||||||
'default': ','
|
'default': ','
|
||||||
},
|
},
|
||||||
|
'sql.saveAsCsv.lineSeperator': {
|
||||||
|
'type': '',
|
||||||
|
'description': localize('sql.saveAsCsv.lineSeperator', '[Optional] Character(s) used for seperating rows when saving results as CSV'),
|
||||||
|
'default': null
|
||||||
|
},
|
||||||
|
'sql.saveAsCsv.textIdentifier': {
|
||||||
|
'type': 'string',
|
||||||
|
'description': localize('sql.saveAsCsv.textIdentifier', '[Optional] Character used for enclosing text fields when saving results as CSV'),
|
||||||
|
'default': '\"'
|
||||||
|
},
|
||||||
|
'sql.saveAsCsv.encoding': {
|
||||||
|
'type': 'string',
|
||||||
|
'description': localize('sql.saveAsCsv.encoding', '[Optional] File encoding used when saving results as CSV'),
|
||||||
|
'default': 'utf-8'
|
||||||
|
},
|
||||||
'sql.copyIncludeHeaders': {
|
'sql.copyIncludeHeaders': {
|
||||||
'type': 'boolean',
|
'type': 'boolean',
|
||||||
'description': localize('sql.copyIncludeHeaders', '[Optional] Configuration options for copying results from the Results View'),
|
'description': localize('sql.copyIncludeHeaders', '[Optional] Configuration options for copying results from the Results View'),
|
||||||
|
|||||||
@@ -189,6 +189,15 @@ export class ResultSerializer {
|
|||||||
if (saveConfig.delimiter !== undefined) {
|
if (saveConfig.delimiter !== undefined) {
|
||||||
saveResultsParams.delimiter = saveConfig.delimiter;
|
saveResultsParams.delimiter = saveConfig.delimiter;
|
||||||
}
|
}
|
||||||
|
if (saveConfig.lineSeperator !== undefined) {
|
||||||
|
saveResultsParams.lineSeperator = saveConfig.lineSeperator;
|
||||||
|
}
|
||||||
|
if (saveConfig.textIdentifier !== undefined) {
|
||||||
|
saveResultsParams.textIdentifier = saveConfig.textIdentifier;
|
||||||
|
}
|
||||||
|
if (saveConfig.encoding !== undefined) {
|
||||||
|
saveResultsParams.encoding = saveConfig.encoding;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return saveResultsParams;
|
return saveResultsParams;
|
||||||
@@ -207,6 +216,9 @@ export class ResultSerializer {
|
|||||||
let config = this.getConfigForCsv();
|
let config = this.getConfigForCsv();
|
||||||
config.resultFormat = SaveFormat.EXCEL;
|
config.resultFormat = SaveFormat.EXCEL;
|
||||||
config.delimiter = undefined;
|
config.delimiter = undefined;
|
||||||
|
config.lineSeperator = undefined;
|
||||||
|
config.textIdentifier = undefined;
|
||||||
|
config.encoding = undefined;
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
3
src/sql/sqlops.d.ts
vendored
3
src/sql/sqlops.d.ts
vendored
@@ -848,6 +848,9 @@ declare module 'sqlops' {
|
|||||||
columnEndIndex: number;
|
columnEndIndex: number;
|
||||||
includeHeaders?: boolean;
|
includeHeaders?: boolean;
|
||||||
delimiter?: string;
|
delimiter?: string;
|
||||||
|
lineSeperator?: string;
|
||||||
|
textIdentifier?: string;
|
||||||
|
encoding?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SaveResultRequestResult {
|
export interface SaveResultRequestResult {
|
||||||
|
|||||||
Reference in New Issue
Block a user