Share via


DatabaseSchemaProvider Class

Provides a base class for a suite of factory objects and factory methods. These objects and methods are used to instantiate service objects that are related to schema and script modeling that, together, represent the core object of database projects in Visual Studio.

Inheritance Hierarchy

System.Object
  Microsoft.Data.Schema.DatabaseSchemaProvider
    Microsoft.Data.Schema.Sql.SqlDatabaseSchemaProvider

Namespace:  Microsoft.Data.Schema
Assembly:  Microsoft.Data.Schema (in Microsoft.Data.Schema.dll)

Syntax

'Declaration
Public MustInherit Class DatabaseSchemaProvider _
    Implements IExtension
public abstract class DatabaseSchemaProvider : IExtension
public ref class DatabaseSchemaProvider abstract : IExtension
[<AbstractClass>]
type DatabaseSchemaProvider =  
    class
        interface IExtension
    end
public abstract class DatabaseSchemaProvider implements IExtension

The DatabaseSchemaProvider type exposes the following members.

Constructors

  Name Description
Protected method DatabaseSchemaProvider Initializes a new instance of the DatabaseSchemaProvider class by using the provided constructor types.

Top

Properties

  Name Description
Public property ExtensionManager Gets the ExtensionManager for the current database project in Visual Studio Team System 2008 Database Edition.
Public property FamilyName Gets the name of a group of providers. For example, the family name of the SQL Server family of database providers is "sql".
Public property ModelSchema Gets the ModelSchema object for this provider.
Public property UserInteractionServices When implemented in a derived class, gets the UserInteractionServices object for this provider.

Top

Methods

  Name Description
Public method Equals Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodStatic member GetCompatibleDatabaseSchemaProviderType Returns the Type that represents the type of provider that is appropriate for the version of the database pointed to by the provided connection string, and for the provided family name.
Public methodStatic member GetCompatibleDatabaseSchemaProviderTypes Returns a list of provider types that are compatible with this provider.
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetSchemaUpgradeXslt When implemented in a derived class, returns XSLT to convert a schema model of the provided version to match the current schema model.
Public method GetService<TService> Returns an instantiated service object that is registered with this provider and identified by the provided Type.
Public method GetServiceConstructor<TServiceConstructor> Returns a constructor for the service that is identified by the provided Type.
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Protected method RegisterModelTypes When implemented in a derived class, registers the model types that are found in the provided model schema.
Public method SchemaVersionSupported Returns a value that indicates whether the provided version is the same as that of the schema model, or whether an XLST is available to convert the schema model to the provided version.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Remarks

Use this base class to create a concrete implementation for a specific database product such as SQL Server, which is represented by the SqlDatabaseSchemaProvider class. SqlDatabaseSchemaProvider serves as the base class for each of several database schema providers (DSPs) for specific versions of SQL Server, such as Sql100DatabaseSchemaProvider and Sql90DatabaseSchemaProvider.

Concrete implementations of the DatabaseSchemaProvider class for the various database products expose these services:

  • Parse a script file into a script model.

  • Interpret a script model into a schema model.

  • Generate a script model from a schema model.

  • Generate a script file from a script model.

In addition to these high-level abilities, more detailed services are exposed, such as comparison services and user interface (UI) help for display names, icons, or other UI objects. These detailed services are provided by the DataProviderServices class.

DatabaseSchemaProvider implementations also enable application features to declare compatibility with various DSPs. For example, if a feature declares compatibility with DatabaseSchemaProvider, that feature is designed to work with abstract interfaces such as IDatabaseTable and IDatabaseColumn. If a feature declares compatibility with a concrete implementation such as Sql100DatabaseSchemaProvider, it is designed to work with abstract interfaces such as ISql100Table. That feature can be loaded only if the project is also of the declared compatible provider type. This gives the feature safe access to functionality that is specific to the concrete implementation.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.Data.Schema Namespace

IExtension

Sql100DatabaseSchemaProvider

Sql90DatabaseSchemaProvider

IDatabaseTable

ISql100Table