mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Add comment for serialization provider api (#18718)
* promote serialization provider api * Revert "promote serialization provider api" This reverts commit df9bec3e58ff78dc611886ccda34381f365ef73e. * update * make dataType a string
This commit is contained in:
86
src/sql/azdata.proposed.d.ts
vendored
86
src/sql/azdata.proposed.d.ts
vendored
@@ -130,53 +130,123 @@ declare module 'azdata' {
|
|||||||
export const onDidCloseNotebookDocument: vscode.Event<NotebookDocument>;
|
export const onDidCloseNotebookDocument: vscode.Event<NotebookDocument>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SqlDbType = 'BigInt' | 'Binary' | 'Bit' | 'Char' | 'DateTime' | 'Decimal'
|
/**
|
||||||
| 'Float' | 'Image' | 'Int' | 'Money' | 'NChar' | 'NText' | 'NVarChar' | 'Real'
|
* The column information of a data set.
|
||||||
| 'UniqueIdentifier' | 'SmallDateTime' | 'SmallInt' | 'SmallMoney' | 'Text' | 'Timestamp'
|
*/
|
||||||
| 'TinyInt' | 'VarBinary' | 'VarChar' | 'Variant' | 'Xml' | 'Udt' | 'Structured' | 'Date'
|
|
||||||
| 'Time' | 'DateTime2' | 'DateTimeOffset';
|
|
||||||
|
|
||||||
export interface SimpleColumnInfo {
|
export interface SimpleColumnInfo {
|
||||||
|
/**
|
||||||
|
* The column name.
|
||||||
|
*/
|
||||||
name: string;
|
name: string;
|
||||||
/**
|
/**
|
||||||
* This is expected to match the SqlDbTypes for serialization purposes
|
* The data type of the column.
|
||||||
*/
|
*/
|
||||||
dataTypeName: SqlDbType;
|
dataTypeName: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The parameters for start data serialization request.
|
||||||
|
*/
|
||||||
export interface SerializeDataStartRequestParams {
|
export interface SerializeDataStartRequestParams {
|
||||||
/**
|
/**
|
||||||
* 'csv', 'json', 'excel', 'xml'
|
* 'csv', 'json', 'excel', 'xml'
|
||||||
*/
|
*/
|
||||||
saveFormat: string;
|
saveFormat: string;
|
||||||
|
/**
|
||||||
|
* The path of the target file.
|
||||||
|
*/
|
||||||
filePath: string;
|
filePath: string;
|
||||||
|
/**
|
||||||
|
* Whether the request is the last batch of the data set to be serialized.
|
||||||
|
*/
|
||||||
isLastBatch: boolean;
|
isLastBatch: boolean;
|
||||||
|
/**
|
||||||
|
* Data to be serialized.
|
||||||
|
*/
|
||||||
rows: DbCellValue[][];
|
rows: DbCellValue[][];
|
||||||
|
/**
|
||||||
|
* The columns of the data set.
|
||||||
|
*/
|
||||||
columns: SimpleColumnInfo[];
|
columns: SimpleColumnInfo[];
|
||||||
|
/**
|
||||||
|
* Whether to include column headers to the target file.
|
||||||
|
*/
|
||||||
includeHeaders?: boolean;
|
includeHeaders?: boolean;
|
||||||
|
/**
|
||||||
|
* The delimiter to seperate the cells.
|
||||||
|
*/
|
||||||
delimiter?: string;
|
delimiter?: string;
|
||||||
|
/**
|
||||||
|
* The line seperator.
|
||||||
|
*/
|
||||||
lineSeperator?: string;
|
lineSeperator?: string;
|
||||||
|
/**
|
||||||
|
* Character used for enclosing text fields when saving results as CSV.
|
||||||
|
*/
|
||||||
textIdentifier?: string;
|
textIdentifier?: string;
|
||||||
|
/**
|
||||||
|
* File encoding used when saving results as CSV.
|
||||||
|
*/
|
||||||
encoding?: string;
|
encoding?: string;
|
||||||
|
/**
|
||||||
|
* When true, XML output will be formatted when saving results as XML.
|
||||||
|
*/
|
||||||
formatted?: boolean;
|
formatted?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The parameters for continue data serialization request.
|
||||||
|
*/
|
||||||
export interface SerializeDataContinueRequestParams {
|
export interface SerializeDataContinueRequestParams {
|
||||||
|
/**
|
||||||
|
* The path of the target file.
|
||||||
|
*/
|
||||||
filePath: string;
|
filePath: string;
|
||||||
|
/**
|
||||||
|
* Whether the request is the last batch.
|
||||||
|
*/
|
||||||
isLastBatch: boolean;
|
isLastBatch: boolean;
|
||||||
|
/**
|
||||||
|
* Data to be serialized.
|
||||||
|
*/
|
||||||
rows: DbCellValue[][];
|
rows: DbCellValue[][];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The result of data serialization data request.
|
||||||
|
*/
|
||||||
export interface SerializeDataResult {
|
export interface SerializeDataResult {
|
||||||
|
/**
|
||||||
|
* The output message.
|
||||||
|
*/
|
||||||
messages?: string;
|
messages?: string;
|
||||||
|
/**
|
||||||
|
* Whether the serialization is succeeded.
|
||||||
|
*/
|
||||||
succeeded: boolean;
|
succeeded: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The serialization provider.
|
||||||
|
*/
|
||||||
export interface SerializationProvider extends DataProvider {
|
export interface SerializationProvider extends DataProvider {
|
||||||
|
/**
|
||||||
|
* Start the data serialization.
|
||||||
|
* @param requestParams the request parameters.
|
||||||
|
*/
|
||||||
startSerialization(requestParams: SerializeDataStartRequestParams): Thenable<SerializeDataResult>;
|
startSerialization(requestParams: SerializeDataStartRequestParams): Thenable<SerializeDataResult>;
|
||||||
|
/**
|
||||||
|
* Continue the data serialization.
|
||||||
|
* @param requestParams the request parameters.
|
||||||
|
*/
|
||||||
continueSerialization(requestParams: SerializeDataContinueRequestParams): Thenable<SerializeDataResult>;
|
continueSerialization(requestParams: SerializeDataContinueRequestParams): Thenable<SerializeDataResult>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export namespace dataprotocol {
|
export namespace dataprotocol {
|
||||||
|
/**
|
||||||
|
* Registers a SerializationProvider.
|
||||||
|
* @param provider The data serialization provider.
|
||||||
|
*/
|
||||||
export function registerSerializationProvider(provider: SerializationProvider): vscode.Disposable;
|
export function registerSerializationProvider(provider: SerializationProvider): vscode.Disposable;
|
||||||
export function registerSqlAssessmentServicesProvider(provider: SqlAssessmentServicesProvider): vscode.Disposable;
|
export function registerSqlAssessmentServicesProvider(provider: SqlAssessmentServicesProvider): vscode.Disposable;
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user