Table of Contents

Class SqlDatabase

Namespace
LfrlAnvil.Sql.Objects
Assembly
LfrlAnvil.Sql.Core.dll

Represents an SQL database.

public abstract class SqlDatabase : ISqlDatabase, IDisposable
Inheritance
SqlDatabase
Implements
Derived
Inherited Members

Constructors

SqlDatabase(SqlDatabaseBuilder, SqlSchemaCollection, ISqlDatabaseConnector<DbConnection>, Version, SqlQueryReaderExecutor<SqlDatabaseVersionRecord>)

Creates a new SqlDatabase instance.

protected SqlDatabase(SqlDatabaseBuilder builder, SqlSchemaCollection schemas, ISqlDatabaseConnector<DbConnection> connector, Version version, SqlQueryReaderExecutor<SqlDatabaseVersionRecord> versionRecordsQuery)

Parameters

builder SqlDatabaseBuilder

Source builder.

schemas SqlSchemaCollection

Collection of schemas defined in this database.

connector ISqlDatabaseConnector<DbConnection>

Connector object that can be used to connect to this database.

version Version

Current version of this database.

versionRecordsQuery SqlQueryReaderExecutor<SqlDatabaseVersionRecord>

Query reader's executor capable of reading metadata of all versions applied to this database.

Properties

Connector

Connector object that can be used to connect to this database.

public ISqlDatabaseConnector<DbConnection> Connector { get; }

Property Value

ISqlDatabaseConnector<DbConnection>

DataTypes

Provider of SQL data types.

public ISqlDataTypeProvider DataTypes { get; }

Property Value

ISqlDataTypeProvider

Dialect

Specifies the SQL dialect of this database.

public SqlDialect Dialect { get; }

Property Value

SqlDialect

NodeInterpreters

Factory of node interpreters.

public ISqlNodeInterpreterFactory NodeInterpreters { get; }

Property Value

ISqlNodeInterpreterFactory

ParameterBinders

Factory of parameter binders.

public SqlParameterBinderFactory ParameterBinders { get; }

Property Value

SqlParameterBinderFactory

QueryReaders

Factory of query readers.

public SqlQueryReaderFactory QueryReaders { get; }

Property Value

SqlQueryReaderFactory

Schemas

Collection of schemas defined in this database.

public SqlSchemaCollection Schemas { get; }

Property Value

SqlSchemaCollection

ServerVersion

Current ServerVersion of this database.

public string ServerVersion { get; }

Property Value

string

TypeDefinitions

Provider of column type definitions.

public SqlColumnTypeDefinitionProvider TypeDefinitions { get; }

Property Value

SqlColumnTypeDefinitionProvider

Version

Current version of this database.

public Version Version { get; }

Property Value

Version

VersionRecordsQuery

Query reader's executor capable of reading metadata of all versions applied to this database.

public SqlQueryReaderExecutor<SqlDatabaseVersionRecord> VersionRecordsQuery { get; }

Property Value

SqlQueryReaderExecutor<SqlDatabaseVersionRecord>

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public virtual void Dispose()

GetRegisteredVersions()

Returns a collection of all versions applied to this database.

[Pure]
public SqlDatabaseVersionRecord[] GetRegisteredVersions()

Returns

SqlDatabaseVersionRecord[]

Collection of all versions applied to this database.