mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-28 01:25:44 -05:00
Important bug fixes for edit/commit (extended property check) (#294)
* Ensures that metadata is "extended" before creating a new row edit object * Adds the commit handler to edit data service initialization calls * Unit tests for the associated changes
This commit is contained in:
@@ -82,6 +82,7 @@ namespace Microsoft.SqlTools.ServiceLayer.EditData
|
||||
serviceHost.SetRequestHandler(EditRevertRowRequest.Type, HandleRevertRowRequest);
|
||||
serviceHost.SetRequestHandler(EditSubsetRequest.Type, HandleSubsetRequest);
|
||||
serviceHost.SetRequestHandler(EditUpdateCellRequest.Type, HandleUpdateCellRequest);
|
||||
serviceHost.SetRequestHandler(EditCommitRequest.Type, HandleCommitRequest);
|
||||
}
|
||||
|
||||
#region Request Handlers
|
||||
|
||||
@@ -440,6 +440,7 @@ namespace Microsoft.SqlTools.ServiceLayer.EditData
|
||||
NextRowId = associatedResultSet.RowCount;
|
||||
EditCache = new ConcurrentDictionary<long, RowEditBase>();
|
||||
IsInitialized = true;
|
||||
objectMetadata.Extend(associatedResultSet.Columns);
|
||||
|
||||
// Step 4) Return our success
|
||||
await successHandler();
|
||||
|
||||
@@ -38,6 +38,11 @@ namespace Microsoft.SqlTools.ServiceLayer.EditData.UpdateManagement
|
||||
/// <param name="associatedMetadata">Metadata provider for the object to edit</param>
|
||||
protected RowEditBase(long rowId, ResultSet associatedResultSet, EditTableMetadata associatedMetadata)
|
||||
{
|
||||
if (!associatedMetadata.HasExtendedProperties)
|
||||
{
|
||||
throw new ArgumentException(SR.EditDataMetadataNotExtended);
|
||||
}
|
||||
|
||||
RowId = rowId;
|
||||
AssociatedResultSet = associatedResultSet;
|
||||
AssociatedObjectMetadata = associatedMetadata;
|
||||
|
||||
@@ -421,6 +421,14 @@ namespace Microsoft.SqlTools.ServiceLayer
|
||||
}
|
||||
}
|
||||
|
||||
public static string EditDataMetadataNotExtended
|
||||
{
|
||||
get
|
||||
{
|
||||
return Keys.GetString(Keys.EditDataMetadataNotExtended);
|
||||
}
|
||||
}
|
||||
|
||||
public static string EditDataFilteringNegativeLimit
|
||||
{
|
||||
get
|
||||
@@ -1117,6 +1125,9 @@ namespace Microsoft.SqlTools.ServiceLayer
|
||||
public const string EditDataSessionAlreadyInitializing = "EditDataSessionAlreadyInitializing";
|
||||
|
||||
|
||||
public const string EditDataMetadataNotExtended = "EditDataMetadataNotExtended";
|
||||
|
||||
|
||||
public const string EditDataFilteringNegativeLimit = "EditDataFilteringNegativeLimit";
|
||||
|
||||
|
||||
|
||||
@@ -378,6 +378,10 @@
|
||||
<value>Edit session has already been initialized or is in the process of initializing</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
<data name="EditDataMetadataNotExtended" xml:space="preserve">
|
||||
<value>Table metadata does not have extended properties</value>
|
||||
<comment></comment>
|
||||
</data>
|
||||
<data name="EditDataFilteringNegativeLimit" xml:space="preserve">
|
||||
<value>Result limit cannot be negative</value>
|
||||
<comment></comment>
|
||||
|
||||
@@ -178,6 +178,8 @@ EditDataSessionAlreadyInitialized = Edit session has already been initialized
|
||||
|
||||
EditDataSessionAlreadyInitializing = Edit session has already been initialized or is in the process of initializing
|
||||
|
||||
EditDataMetadataNotExtended = Table metadata does not have extended properties
|
||||
|
||||
EditDataFilteringNegativeLimit = Result limit cannot be negative
|
||||
|
||||
EditDataUnsupportedObjectType(string typeName) = Database object {0} cannot be used for editing.
|
||||
|
||||
@@ -601,6 +601,11 @@
|
||||
<target state="new">NULL</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
<trans-unit id="EditDataMetadataNotExtended">
|
||||
<source>Table metadata does not have extended properties</source>
|
||||
<target state="new">Table metadata does not have extended properties</target>
|
||||
<note></note>
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
||||
Reference in New Issue
Block a user