Table of Contents

Interface ISchemaProvider

Namespace
LinqToDB.Schema
Assembly
linq2db.Tools.dll

Database schema provider.

public interface ISchemaProvider
Extension Methods

Properties

DataSource

Gets value of DataSource property. Returned value is implementation-specific to used ADO.NET provider.

string? DataSource { get; }

Property Value

string

DatabaseName

Gets current database name.

string? DatabaseName { get; }

Property Value

string

DatabaseOptions

Database-specific options, useful for scaffold process.

DatabaseOptions DatabaseOptions { get; }

Property Value

DatabaseOptions

ServerVersion

Gets current server name.

string? ServerVersion { get; }

Property Value

string

Methods

GetAggregateFunctions()

Returns schema information for all aggregate functions.

IEnumerable<AggregateFunction> GetAggregateFunctions()

Returns

IEnumerable<AggregateFunction>

Aggregate functions schema collection.

GetDefaultSchemas()

Gets list of default database schemas.

ISet<string> GetDefaultSchemas()

Returns

ISet<string>

List of default schemas.

GetForeignKeys()

Returns schema information for all foreign keys.

IEnumerable<ForeignKey> GetForeignKeys()

Returns

IEnumerable<ForeignKey>

Foreign keys schema collection.

GetProcedures(bool, bool)

Returns schema information for all stored procedures.

IEnumerable<StoredProcedure> GetProcedures(bool withSchema, bool safeSchemaOnly)

Parameters

withSchema bool

Try to load result records schema.

safeSchemaOnly bool

When withSchema is true, specify record schema load method:

  • true: read record metadata (not supported by most of databases)
  • false: execute procedure in schema-only mode. Could lead to unwanted side-effects if procedure contains non-transactional functionality

Returns

IEnumerable<StoredProcedure>

Stored procedures schema collection.

GetScalarFunctions()

Returns schema information for all scalar functions.

IEnumerable<ScalarFunction> GetScalarFunctions()

Returns

IEnumerable<ScalarFunction>

Scalar functions schema collection.

GetTableFunctions()

Returns schema information for all table functions.

IEnumerable<TableFunction> GetTableFunctions()

Returns

IEnumerable<TableFunction>

Table functions schema collection.

GetTables()

Returns schema information for all tables.

IEnumerable<Table> GetTables()

Returns

IEnumerable<Table>

Tables schema collection.

GetViews()

Returns schema information for all views.

IEnumerable<View> GetViews()

Returns

IEnumerable<View>

Views schema collection.