Correctly route notebook serialization requests to SQL Tools Service. (#20874)

This commit is contained in:
Cory Rivera
2022-10-19 15:37:41 -07:00
committed by GitHub
parent 14cbe09a20
commit 33c6daaea1
3 changed files with 25 additions and 2 deletions

View File

@@ -17,6 +17,10 @@ const saveAsNotSupported = localize('saveAsNotSupported', "Saving results into d
const defaultBatchSize = 500;
export interface SerializeDataParams {
/**
* The serializer to use for this request. Typically this is the ID of the connection provider used to run the query.
*/
serializationProviderId: string;
/**
* 'csv', 'json', 'excel', 'xml'
*/
@@ -115,7 +119,13 @@ export class SerializationService implements ISerializationService {
}
try {
// Create a new session with the provider and send initial data
let provider = this.providers[0].provider;
let provider = this.providers.find(provider => provider.providerId === serializationRequest.serializationProviderId)?.provider;
if (!provider) {
return <azdata.SerializeDataResult>{
messages: localize('missingSerializationProviderError', "Could not find a serialization provider with the specified ID '{0}'", serializationRequest.serializationProviderId),
succeeded: false
};
}
let index = 0;
let startRequestParams = this.createStartRequest(serializationRequest, index);
index = index + startRequestParams.rows.length;