Table of Contents

Class SqlServerDialect

Namespace
Fdyay.IdentityServer.Dapper.Sql
Assembly
Fdyay.IdentityServer.Dapper.dll

SQL Server dialect. Uses datetime2 timestamps and UPDATE-then-INSERT upserts.

public sealed class SqlServerDialect : ISqlDialect
Inheritance
SqlServerDialect
Implements
Inherited Members

Properties

Name

The provider name (e.g. Sqlite, SqlServer).

public string Name { get; }

Property Value

string

Remarks

Always "SqlServer".

PagingClause

Takes one page of an ordered result, using @skip and @take.

public string PagingClause { get; }

Property Value

string

Remarks

The one place the two dialects disagree on more than punctuation: SQLite spells this LIMIT/OFFSET and has no FETCH, SQL Server spells it OFFSET/FETCH and has no LIMIT. Both require the ORDER BY that precedes it, which is the property paging depends on anyway — an unstable order repeats a row on page two and drops another, and only the repeat shows.

UpsertBackChannelAuthenticationRequest

Inserts or replaces a pending backchannel authentication request.

public string UpsertBackChannelAuthenticationRequest { get; }

Property Value

string

UpsertDeviceFlowCode

Upsert statement for a device authorization, keyed on DeviceCode.

public string UpsertDeviceFlowCode { get; }

Property Value

string

UpsertPersistedGrant

Upsert statement for a persisted grant, keyed on GrantKey.

public string UpsertPersistedGrant { get; }

Property Value

string

UpsertPushedAuthorizationRequest

Upsert statement for a pushed authorization request, keyed on ReferenceValueHash.

public string UpsertPushedAuthorizationRequest { get; }

Property Value

string

UpsertServerSideSession

Upsert statement for a server-side session, keyed on SessionKey.

public string UpsertServerSideSession { get; }

Property Value

string

UpsertSigningKey

Upsert statement for a signing key, keyed on Id.

public string UpsertSigningKey { get; }

Property Value

string

Methods

CreateSchemaScript(DapperStores)

An idempotent script creating the tables for stores, and nothing else.

public string CreateSchemaScript(DapperStores stores)

Parameters

stores DapperStores

Returns

string

Remarks

Each table and index is guarded by an OBJECT_ID or sys.indexes check, so the script can run on every startup. It creates what is missing and never alters what is there; a selection of None yields an empty script.