Table of Contents

Class SqlDbClient

Namespace
TimeCockpit.Data.Database
Assembly
TimeCockpit.Data.dll

Provides the database client class for SQL Server

public sealed class SqlDbClient : DbClient, IDisposable
Inheritance
Object
SqlDbClient
Implements
IDisposable
Inherited Members
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()

Properties

SupportsNoCheckConstraint

Gets a value indicating whether this db client supports disabling constraints.

public override bool SupportsNoCheckConstraint { get; }

Property Value

Boolean

SupportsTableValuedParameters

Gets a value indicating whether this db client supports TVPs.

public override bool SupportsTableValuedParameters { get; }

Property Value

Boolean

Methods

DeleteBlobGarbage(DbConnection, IEnumerable<BlobGarbageRow>)

Deletes rows from the blob garbage collection

protected override void DeleteBlobGarbage(DbConnection conn, IEnumerable<BlobGarbageRow> blobGarbageCollection)

Parameters

conn DbConnection

Database connection used to access the database

blobGarbageCollection IEnumerable<BlobGarbageRow>

Guids of the blob that should be deleted

ExecuteDatabaseOperation(Func<DbConnection, UInt64, DbCommand>, Boolean)

Executes a database operation.

[CLSCompliant(false)]
protected override ulong ExecuteDatabaseOperation(Func<DbConnection, ulong, DbCommand> commandCreator, bool syncContent)

Parameters

commandCreator Func<DbConnection, UInt64, DbCommand>

Function that is used to create the database command object.

syncContent Boolean

Indicates how and if the ModelElement that is targeted is synced.

Returns

UInt64

Version of the database operation

FindOrCreateCommand(String, DbConnection)

Create DB command by looking it up in a cache of prepared commands or creating it.

protected override DbCommand FindOrCreateCommand(string sqlText, DbConnection connection)

Parameters

sqlText String

The SQL command text; always a SELECT statement.

connection DbConnection

The database connection on which the command will be executed.

Returns

DbCommand

DB command from the cache or newly created command.

Remarks

Command caching for SQL server is disabled.

FinishCommand(DbCommand)

Called after DbClient is done with the command.

protected override void FinishCommand(DbCommand command)

Parameters

command DbCommand

A command previously returned by FindOrCreateCommand(String, DbConnection).

Remarks

The SQL Server does not cache commands -> command is immediately disposed.

OpenConnectionAsync(CancellationToken)

Opens a new connection.

protected override Task<DbConnection> OpenConnectionAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

The cancellation token.

Returns

Task<DbConnection>

Returns the newly opened connection.