Class SqlDbClient
Provides the database client class for SQL Server
Implements
Inherited Members
Namespace: TimeCockpit.Data.Database
Assembly: TimeCockpit.Data.dll
Syntax
public sealed class SqlDbClient : DbClient, IDisposable
Properties
SupportsNoCheckConstraint
Gets a value indicating whether this db client supports disabling constraints.
Declaration
public override bool SupportsNoCheckConstraint { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
SupportsTableValuedParameters
Gets a value indicating whether this db client supports TVPs.
Declaration
public override bool SupportsTableValuedParameters { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
Methods
DeleteBlobGarbage(DbConnection, IEnumerable<BlobGarbageRow>)
Deletes rows from the blob garbage collection
Declaration
protected override void DeleteBlobGarbage(DbConnection conn, IEnumerable<BlobGarbageRow> blobGarbageCollection)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbConnection | conn | Database connection used to access the database |
System.Collections.Generic.IEnumerable<BlobGarbageRow> | blobGarbageCollection | Guids of the blob that should be deleted |
Overrides
ExecuteDatabaseOperation(Func<DbConnection, UInt64, DbCommand>, Boolean)
Executes a database operation.
Declaration
[CLSCompliant(false)]
protected override ulong ExecuteDatabaseOperation(Func<DbConnection, ulong, DbCommand> commandCreator, bool syncContent)
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.Data.Common.DbConnection, System.UInt64, System.Data.Common.DbCommand> | commandCreator | Function that is used to create the database command object. |
System.Boolean | syncContent | Indicates how and if the ModelElement that is targeted is synced. |
Returns
Type | Description |
---|---|
System.UInt64 | Version of the database operation |
Overrides
FindOrCreateCommand(String, DbConnection)
Create DB command by looking it up in a cache of prepared commands or creating it.
Declaration
protected override DbCommand FindOrCreateCommand(string sqlText, DbConnection connection)
Parameters
Type | Name | Description |
---|---|---|
System.String | sqlText | The SQL command text; always a SELECT statement. |
System.Data.Common.DbConnection | connection | The database connection on which the command will be executed. |
Returns
Type | Description |
---|---|
System.Data.Common.DbCommand | DB command from the cache or newly created command. |
Overrides
Remarks
Command caching for SQL server is disabled.
FinishCommand(DbCommand)
Called after DbClient is done with the command
.
Declaration
protected override void FinishCommand(DbCommand command)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbCommand | command | A command previously returned by FindOrCreateCommand(String, DbConnection). |
Overrides
Remarks
The SQL Server does not cache commands -> command is immediately disposed.
OpenConnectionAsync(CancellationToken)
Opens a new connection.
Declaration
protected override Task<DbConnection> OpenConnectionAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Data.Common.DbConnection> | Returns the newly opened connection. |