mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-23 01:25:38 -05:00
Support Save As CSV/JSON/Excel/XML from Notebooks (#6627)
Updated existing serialization code so it actually supports serialization. Still needs work to replace the saveAs function when a QueryProvider doesn't support save as, but want to handle in separate PR. Removed separate MainThread/ExtHostSerializationProvider code as the DataProtocol code is the right place to put this code Plumbed support through the gridOutputComponent to use the new serialize method in the serialization provider Refactored the resultSerializer so majority of code can be shared between both implementations (for example file save dialog -> save -> show file on completion) * Update to latest SQLToolsService release
This commit is contained in:
52
src/sql/azdata.proposed.d.ts
vendored
52
src/sql/azdata.proposed.d.ts
vendored
@@ -26,4 +26,56 @@ declare module 'azdata' {
|
||||
*/
|
||||
export function registerConnectionEventListener(listener: connection.ConnectionEventListener): void;
|
||||
}
|
||||
|
||||
|
||||
export type SqlDbType = 'BigInt' | 'Binary' | 'Bit' | 'Char' | 'DateTime' | 'Decimal'
|
||||
| 'Float' | 'Image' | 'Int' | 'Money' | 'NChar' | 'NText' | 'NVarChar' | 'Real'
|
||||
| 'UniqueIdentifier' | 'SmallDateTime' | 'SmallInt' | 'SmallMoney' | 'Text' | 'Timestamp'
|
||||
| 'TinyInt' | 'VarBinary' | 'VarChar' | 'Variant' | 'Xml' | 'Udt' | 'Structured' | 'Date'
|
||||
| 'Time' | 'DateTime2' | 'DateTimeOffset';
|
||||
|
||||
export interface SimpleColumnInfo {
|
||||
name: string;
|
||||
/**
|
||||
* This is expected to match the SqlDbTypes for serialization purposes
|
||||
*/
|
||||
dataTypeName: SqlDbType;
|
||||
}
|
||||
export interface SerializeDataStartRequestParams {
|
||||
/**
|
||||
* 'csv', 'json', 'excel', 'xml'
|
||||
*/
|
||||
saveFormat: string;
|
||||
filePath: string;
|
||||
isLastBatch: boolean;
|
||||
rows: DbCellValue[][];
|
||||
columns: SimpleColumnInfo[];
|
||||
includeHeaders?: boolean;
|
||||
delimiter?: string;
|
||||
lineSeperator?: string;
|
||||
textIdentifier?: string;
|
||||
encoding?: string;
|
||||
formatted?: boolean;
|
||||
}
|
||||
|
||||
export interface SerializeDataContinueRequestParams {
|
||||
filePath: string;
|
||||
isLastBatch: boolean;
|
||||
rows: DbCellValue[][];
|
||||
}
|
||||
|
||||
export interface SerializeDataResult {
|
||||
messages: string;
|
||||
succeeded: boolean;
|
||||
}
|
||||
|
||||
export interface SerializationProvider extends DataProvider {
|
||||
startSerialization(requestParams: SerializeDataStartRequestParams): Thenable<SerializeDataResult>;
|
||||
continueSerialization(requestParams: SerializeDataContinueRequestParams): Thenable<SerializeDataResult>;
|
||||
}
|
||||
|
||||
|
||||
export namespace dataprotocol {
|
||||
export function registerSerializationProvider(provider: SerializationProvider): vscode.Disposable;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user