Class SqlServerSyntaxProvider
Represents an SqlSyntaxProvider for Sql Server.
Inheritance
System.Object
Assembly: cs.temp.dll.dll
Syntax
public class SqlServerSyntaxProvider : MicrosoftSqlSyntaxProviderBase<SqlServerSyntaxProvider>, ISqlSyntaxProvider
Constructors
SqlServerSyntaxProvider(IOptions<GlobalSettings>)
Declaration
public SqlServerSyntaxProvider(IOptions<GlobalSettings> globalSettings)
Parameters
| Type |
Name |
Description |
| IOptions<GlobalSettings> |
globalSettings |
|
Properties
CreateIndex
Declaration
public override string CreateIndex { get; }
Property Value
| Type |
Description |
| System.String |
|
DbProvider
Declaration
public override string DbProvider { get; }
Property Value
| Type |
Description |
| System.String |
|
DefaultIsolationLevel
Declaration
public override IsolationLevel DefaultIsolationLevel { get; }
Property Value
| Type |
Description |
| IsolationLevel |
|
DeleteDefaultConstraint
Declaration
public override string DeleteDefaultConstraint { get; }
Property Value
| Type |
Description |
| System.String |
|
DropIndex
Declaration
public override string DropIndex { get; }
Property Value
| Type |
Description |
| System.String |
|
ProviderName
Declaration
public override string ProviderName { get; }
Property Value
| Type |
Description |
| System.String |
|
RenameColumn
Declaration
public override string RenameColumn { get; }
Property Value
| Type |
Description |
| System.String |
|
ServerVersion
Declaration
public SqlServerSyntaxProvider.ServerVersionInfo ServerVersion { get; }
Property Value
Methods
DoesTableExist(IDatabase, String)
Declaration
public override bool DoesTableExist(IDatabase db, string tableName)
Parameters
| Type |
Name |
Description |
| IDatabase |
db |
|
| System.String |
tableName |
|
Returns
| Type |
Description |
| System.Boolean |
|
Declaration
public override string Format(IndexDefinition index)
Parameters
| Type |
Name |
Description |
| IndexDefinition |
index |
|
Returns
| Type |
Description |
| System.String |
|
Declaration
public override string FormatColumnRename(string tableName, string oldName, string newName)
Parameters
| Type |
Name |
Description |
| System.String |
tableName |
|
| System.String |
oldName |
|
| System.String |
newName |
|
Returns
| Type |
Description |
| System.String |
|
Declaration
protected override string FormatIdentity(ColumnDefinition column)
Parameters
| Type |
Name |
Description |
| ColumnDefinition |
column |
|
Returns
| Type |
Description |
| System.String |
|
Declaration
protected override string FormatSystemMethods(SystemMethods systemMethod)
Parameters
| Type |
Name |
Description |
| SystemMethods |
systemMethod |
|
Returns
| Type |
Description |
| System.String |
|
Declaration
public override string FormatTableRename(string oldName, string newName)
Parameters
| Type |
Name |
Description |
| System.String |
oldName |
|
| System.String |
newName |
|
Returns
| Type |
Description |
| System.String |
|
GetColumnsInSchema(IDatabase)
Declaration
public override IEnumerable<ColumnInfo> GetColumnsInSchema(IDatabase db)
Parameters
| Type |
Name |
Description |
| IDatabase |
db |
|
Returns
| Type |
Description |
| System.Collections.Generic.IEnumerable<ColumnInfo> |
|
GetConstraintsPerColumn(IDatabase)
Declaration
public override IEnumerable<Tuple<string, string, string>> GetConstraintsPerColumn(IDatabase db)
Parameters
| Type |
Name |
Description |
| IDatabase |
db |
|
Returns
| Type |
Description |
| System.Collections.Generic.IEnumerable<System.Tuple<System.String, System.String, System.String>> |
|
GetConstraintsPerTable(IDatabase)
Declaration
public override IEnumerable<Tuple<string, string>> GetConstraintsPerTable(IDatabase db)
Parameters
| Type |
Name |
Description |
| IDatabase |
db |
|
Returns
| Type |
Description |
| System.Collections.Generic.IEnumerable<System.Tuple<System.String, System.String>> |
|
GetDefaultConstraintsPerColumn(IDatabase)
SQL Server stores default values assigned to columns as constraints, it also stores them with named values, this is the only
server type that does this, therefore this method doesn't exist on any other syntax provider
Declaration
public IEnumerable<Tuple<string, string, string, string>> GetDefaultConstraintsPerColumn(IDatabase db)
Parameters
| Type |
Name |
Description |
| IDatabase |
db |
|
Returns
| Type |
Description |
| System.Collections.Generic.IEnumerable<System.Tuple<System.String, System.String, System.String, System.String>> |
|
GetDefinedIndexes(IDatabase)
Declaration
public override IEnumerable<Tuple<string, string, string, bool>> GetDefinedIndexes(IDatabase db)
Parameters
| Type |
Name |
Description |
| IDatabase |
db |
|
Returns
| Type |
Description |
| System.Collections.Generic.IEnumerable<System.Tuple<System.String, System.String, System.String, System.Boolean>> |
|
GetTablesInSchema(IDatabase)
Declaration
public override IEnumerable<string> GetTablesInSchema(IDatabase db)
Parameters
| Type |
Name |
Description |
| IDatabase |
db |
|
Returns
| Type |
Description |
| System.Collections.Generic.IEnumerable<System.String> |
|
ReadLock(IDatabase, Int32[])
Declaration
public override void ReadLock(IDatabase db, params int[] lockIds)
Parameters
| Type |
Name |
Description |
| IDatabase |
db |
|
| System.Int32[] |
lockIds |
|
ReadLock(IDatabase, TimeSpan, Int32)
Declaration
public override void ReadLock(IDatabase db, TimeSpan timeout, int lockId)
Parameters
| Type |
Name |
Description |
| IDatabase |
db |
|
| System.TimeSpan |
timeout |
|
| System.Int32 |
lockId |
|
SelectTop(Sql<ISqlContext>, Int32)
Declaration
public override Sql<ISqlContext> SelectTop(Sql<ISqlContext> sql, int top)
Parameters
| Type |
Name |
Description |
| Sql<ISqlContext> |
sql |
|
| System.Int32 |
top |
|
Returns
TryGetDefaultConstraint(IDatabase, String, String, out String)
Declaration
public override bool TryGetDefaultConstraint(IDatabase db, string tableName, string columnName, out string constraintName)
Parameters
| Type |
Name |
Description |
| IDatabase |
db |
|
| System.String |
tableName |
|
| System.String |
columnName |
|
| System.String |
constraintName |
|
Returns
| Type |
Description |
| System.Boolean |
|
WriteLock(IDatabase, Int32[])
Declaration
public override void WriteLock(IDatabase db, params int[] lockIds)
Parameters
| Type |
Name |
Description |
| IDatabase |
db |
|
| System.Int32[] |
lockIds |
|
WriteLock(IDatabase, TimeSpan, Int32)
Declaration
public override void WriteLock(IDatabase db, TimeSpan timeout, int lockId)
Parameters
| Type |
Name |
Description |
| IDatabase |
db |
|
| System.TimeSpan |
timeout |
|
| System.Int32 |
lockId |
|
WriteLock(IDatabase, TimeSpan, Int32[])
Declaration
public void WriteLock(IDatabase db, TimeSpan timeout, params int[] lockIds)
Parameters
| Type |
Name |
Description |
| IDatabase |
db |
|
| System.TimeSpan |
timeout |
|
| System.Int32[] |
lockIds |
|