mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-16 01:25:41 -05:00
Adding decoding of multipart identifiers, default schema workaround (#295)
This change adds a couple things _Multipart Identifier Decoding_ The ability to decode a multipart identifier (with or without escaping) has been added to the SqlScriptFormatter utility class. This code is utilized to split a table name provided to the edit/initialize request into schema and table name. _Default Schema Workaround_ The code that retrieves the SMO metadata objects originally used the `[]` operator to access the objects. Due to a bug(?) in SMO, this results in problems when loading tables without a default schema (in our case if you're logged in as SA). Using the metadata object constructors gets around this issue, we are explicitly using them. * Adding decoding of multipart identifiers Adding code fix for default schema issue * Adding some more localizable strings for errors when loading metadata * Adding localization files... again? * Changes as per pull request comments
This commit is contained in:
@@ -16,9 +16,13 @@ namespace Microsoft.SqlTools.ServiceLayer.EditData
|
||||
/// Generates a edit-ready metadata object
|
||||
/// </summary>
|
||||
/// <param name="connection">Connection to use for getting metadata</param>
|
||||
/// <param name="objectName">Name of the object to return metadata for</param>
|
||||
/// <param name="objectNamedParts">
|
||||
/// The multipart name for the object split and unwrapped. At most two components can be
|
||||
/// provided (schema, table/view name). At minimum table/view name can be provided, and
|
||||
/// default schema will be used for schema name.
|
||||
/// </param>
|
||||
/// <param name="objectType">Type of the object to return metadata for</param>
|
||||
/// <returns>Metadata about the object requested</returns>
|
||||
EditTableMetadata GetObjectMetadata(DbConnection connection, string objectName, string objectType);
|
||||
EditTableMetadata GetObjectMetadata(DbConnection connection, string[] objectNamedParts, string objectType);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user