mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-23 01:25:38 -05:00
Correctly route notebook serialization requests to SQL Tools Service. (#20874)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user