View Source
Class SqlSyntaxProviderBase<TSyntax>
Represents the Base Sql Syntax provider implementation.
Inheritance
System.Object
Assembly: Umbraco.Infrastructure.dll
Syntax
public abstract class SqlSyntaxProviderBase<TSyntax> : ISqlSyntaxProvider where TSyntax : ISqlSyntaxProvider
Type Parameters
Constructors
View Source
SqlSyntaxProviderBase()
Declaration
protected SqlSyntaxProviderBase()
Properties
View Source
AddColumn
Declaration
public virtual string AddColumn { get; }
Property Value
Type |
Description |
System.String |
|
View Source
AliasRegex
Declaration
public Regex AliasRegex { get; }
Property Value
Type |
Description |
System.Text.RegularExpressions.Regex |
|
View Source
AlterColumn
Declaration
public virtual string AlterColumn { get; }
Property Value
Type |
Description |
System.String |
|
View Source
AlterSchema
Declaration
public virtual string AlterSchema { get; }
Property Value
Type |
Description |
System.String |
|
View Source
AutoIncrementDefinition
Declaration
public string AutoIncrementDefinition { get; protected set; }
Property Value
Type |
Description |
System.String |
|
View Source
BlobColumnDefinition
Declaration
public string BlobColumnDefinition { get; protected set; }
Property Value
Type |
Description |
System.String |
|
View Source
BoolColumnDefinition
Declaration
public string BoolColumnDefinition { get; protected set; }
Property Value
Type |
Description |
System.String |
|
View Source
ClauseOrder
Declaration
protected IList<Func<ColumnDefinition, string>> ClauseOrder { get; }
Property Value
View Source
ConvertDateToOrderableString
Declaration
public virtual string ConvertDateToOrderableString { get; }
Property Value
Type |
Description |
System.String |
|
View Source
ConvertDecimalToOrderableString
Declaration
public virtual string ConvertDecimalToOrderableString { get; }
Property Value
Type |
Description |
System.String |
|
View Source
ConvertIntegerToOrderableString
Declaration
public virtual string ConvertIntegerToOrderableString { get; }
Property Value
Type |
Description |
System.String |
|
View Source
CreateConstraint
Declaration
public virtual string CreateConstraint { get; }
Property Value
Type |
Description |
System.String |
|
View Source
CreateDefaultConstraint
Declaration
public virtual string CreateDefaultConstraint { get; }
Property Value
Type |
Description |
System.String |
|
View Source
CreateForeignKeyConstraint
Declaration
public virtual string CreateForeignKeyConstraint { get; }
Property Value
Type |
Description |
System.String |
|
View Source
CreateIndex
Declaration
public virtual string CreateIndex { get; }
Property Value
Type |
Description |
System.String |
|
View Source
CreateSchema
Declaration
public virtual string CreateSchema { get; }
Property Value
Type |
Description |
System.String |
|
View Source
CreateTable
Declaration
public virtual string CreateTable { get; }
Property Value
Type |
Description |
System.String |
|
View Source
DateTimeColumnDefinition
Declaration
public string DateTimeColumnDefinition { get; protected set; }
Property Value
Type |
Description |
System.String |
|
View Source
DateTimeOffsetColumnDefinition
Declaration
public string DateTimeOffsetColumnDefinition { get; protected set; }
Property Value
Type |
Description |
System.String |
|
View Source
DbProvider
Declaration
public abstract string DbProvider { get; }
Property Value
Type |
Description |
System.String |
|
View Source
DbTypeMap
Declaration
protected DbTypes DbTypeMap { get; }
Property Value
View Source
DecimalColumnDefinition
Declaration
public string DecimalColumnDefinition { get; protected set; }
Property Value
Type |
Description |
System.String |
|
View Source
Declaration
public string DecimalColumnDefinitionFormat { get; }
Property Value
Type |
Description |
System.String |
|
View Source
DefaultDecimalPrecision
Declaration
public int DefaultDecimalPrecision { get; }
Property Value
Type |
Description |
System.Int32 |
|
View Source
DefaultDecimalScale
Declaration
public int DefaultDecimalScale { get; }
Property Value
Type |
Description |
System.Int32 |
|
View Source
DefaultIsolationLevel
Declaration
public abstract IsolationLevel DefaultIsolationLevel { get; }
Property Value
Type |
Description |
System.Data.IsolationLevel |
|
View Source
DefaultStringLength
Declaration
public int DefaultStringLength { get; }
Property Value
Type |
Description |
System.Int32 |
|
View Source
Declaration
public string DefaultValueFormat { get; }
Property Value
Type |
Description |
System.String |
|
View Source
DeleteConstraint
Declaration
public virtual string DeleteConstraint { get; }
Property Value
Type |
Description |
System.String |
|
View Source
DeleteData
Declaration
public virtual string DeleteData { get; }
Property Value
Type |
Description |
System.String |
|
View Source
DeleteDefaultConstraint
Declaration
public virtual string DeleteDefaultConstraint { get; }
Property Value
Type |
Description |
System.String |
|
View Source
DropColumn
Declaration
public virtual string DropColumn { get; }
Property Value
Type |
Description |
System.String |
|
View Source
DropIndex
Declaration
public virtual string DropIndex { get; }
Property Value
Type |
Description |
System.String |
|
View Source
DropSchema
Declaration
public virtual string DropSchema { get; }
Property Value
Type |
Description |
System.String |
|
View Source
DropTable
Declaration
public virtual string DropTable { get; }
Property Value
Type |
Description |
System.String |
|
View Source
GuidColumnDefinition
Declaration
public string GuidColumnDefinition { get; protected set; }
Property Value
Type |
Description |
System.String |
|
View Source
InsertData
Declaration
public virtual string InsertData { get; }
Property Value
Type |
Description |
System.String |
|
View Source
IntColumnDefinition
Declaration
public string IntColumnDefinition { get; protected set; }
Property Value
Type |
Description |
System.String |
|
View Source
LongColumnDefinition
Declaration
public string LongColumnDefinition { get; protected set; }
Property Value
Type |
Description |
System.String |
|
View Source
ProviderName
Declaration
public abstract string ProviderName { get; }
Property Value
Type |
Description |
System.String |
|
View Source
RealColumnDefinition
Declaration
public string RealColumnDefinition { get; protected set; }
Property Value
Type |
Description |
System.String |
|
View Source
RenameColumn
Declaration
public virtual string RenameColumn { get; }
Property Value
Type |
Description |
System.String |
|
View Source
Declaration
public virtual string RenameTable { get; }
Property Value
Type |
Description |
System.String |
|
View Source
ScalarMappers
Declaration
public virtual IDictionary<Type, IScalarMapper>? ScalarMappers { get; }
Property Value
Type |
Description |
System.Nullable<IDictionary<System.Type, IScalarMapper>> |
|
View Source
StringColumnDefinition
Declaration
public virtual string StringColumnDefinition { get; }
Property Value
Type |
Description |
System.String |
|
View Source
Declaration
public string StringLengthColumnDefinitionFormat { get; }
Property Value
Type |
Description |
System.String |
|
View Source
Declaration
public string StringLengthNonUnicodeColumnDefinitionFormat { get; }
Property Value
Type |
Description |
System.String |
|
View Source
Declaration
public virtual string StringLengthUnicodeColumnDefinitionFormat { get; }
Property Value
Type |
Description |
System.String |
|
View Source
TimeColumnDefinition
Declaration
public string TimeColumnDefinition { get; protected set; }
Property Value
Type |
Description |
System.String |
|
View Source
TruncateTable
Declaration
public virtual string TruncateTable { get; }
Property Value
Type |
Description |
System.String |
|
View Source
UpdateData
Declaration
public virtual string UpdateData { get; }
Property Value
Type |
Description |
System.String |
|
Methods
View Source
AppendForUpdateHint(Sql<ISqlContext>)
Declaration
public virtual Sql<ISqlContext> AppendForUpdateHint(Sql<ISqlContext> sql)
Parameters
Returns
View Source
DoesPrimaryKeyExist(IDatabase, String, String)
Declaration
public virtual bool DoesPrimaryKeyExist(IDatabase db, string tableName, string primaryKeyName)
Parameters
Type |
Name |
Description |
IDatabase |
db |
|
System.String |
tableName |
|
System.String |
primaryKeyName |
|
Returns
Type |
Description |
System.Boolean |
|
View Source
DoesTableExist(IDatabase, String)
Declaration
public virtual bool DoesTableExist(IDatabase db, string tableName)
Parameters
Type |
Name |
Description |
IDatabase |
db |
|
System.String |
tableName |
|
Returns
Type |
Description |
System.Boolean |
|
View Source
EscapeString(String)
Declaration
public virtual string EscapeString(string val)
Parameters
Type |
Name |
Description |
System.String |
val |
|
Returns
Type |
Description |
System.String |
|
View Source
Declaration
public virtual string Format(IEnumerable<ColumnDefinition> columns)
Parameters
Returns
Type |
Description |
System.String |
|
View Source
Declaration
public virtual List<string> Format(IEnumerable<ForeignKeyDefinition> foreignKeys)
Parameters
Returns
Type |
Description |
List<System.String> |
|
View Source
Declaration
public virtual List<string> Format(IEnumerable<IndexDefinition> indexes)
Parameters
Returns
Type |
Description |
List<System.String> |
|
View Source
Declaration
public virtual string Format(ColumnDefinition column)
Parameters
Returns
Type |
Description |
System.String |
|
View Source
Declaration
public virtual string Format(ColumnDefinition column, string tableName, out IEnumerable<string> sqls)
Parameters
Type |
Name |
Description |
ColumnDefinition |
column |
|
System.String |
tableName |
|
IEnumerable<System.String> |
sqls |
|
Returns
Type |
Description |
System.String |
|
View Source
Declaration
public virtual string Format(ForeignKeyDefinition foreignKey)
Parameters
Returns
Type |
Description |
System.String |
|
View Source
Declaration
public virtual string Format(IndexDefinition index)
Parameters
Returns
Type |
Description |
System.String |
|
View Source
Declaration
public virtual string Format(TableDefinition table)
Parameters
Returns
Type |
Description |
System.String |
|
View Source
Declaration
protected virtual string FormatCascade(string onWhat, Rule rule)
Parameters
Type |
Name |
Description |
System.String |
onWhat |
|
System.Data.Rule |
rule |
|
Returns
Type |
Description |
System.String |
|
View Source
Declaration
public virtual 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 |
|
View Source
Declaration
protected virtual string FormatConstraint(ColumnDefinition column)
Parameters
Returns
Type |
Description |
System.String |
|
View Source
This is used ONLY if we need to format datetime without using SQL parameters (i.e. during migrations)
Declaration
public virtual string FormatDateTime(DateTime date, bool includeTime = true)
Parameters
Type |
Name |
Description |
System.DateTime |
date |
|
System.Boolean |
includeTime |
|
Returns
Type |
Description |
System.String |
|
View Source
Declaration
protected virtual string FormatDefaultValue(ColumnDefinition column)
Parameters
Returns
Type |
Description |
System.String |
|
View Source
Declaration
protected abstract string FormatIdentity(ColumnDefinition column)
Parameters
Returns
Type |
Description |
System.String |
|
View Source
Declaration
protected virtual string FormatNullable(ColumnDefinition column)
Parameters
Returns
Type |
Description |
System.String |
|
View Source
Declaration
protected virtual string FormatPrimaryKey(ColumnDefinition column)
Parameters
Returns
Type |
Description |
System.String |
|
View Source
Declaration
public virtual string FormatPrimaryKey(TableDefinition table)
Parameters
Returns
Type |
Description |
System.String |
|
View Source
Declaration
protected virtual string FormatString(ColumnDefinition column)
Parameters
Returns
Type |
Description |
System.String |
|
View Source
Declaration
protected abstract string FormatSystemMethods(SystemMethods systemMethod)
Parameters
Returns
Type |
Description |
System.String |
|
View Source
Declaration
public virtual string FormatTableRename(string oldName, string newName)
Parameters
Type |
Name |
Description |
System.String |
oldName |
|
System.String |
newName |
|
Returns
Type |
Description |
System.String |
|
View Source
Declaration
protected virtual string FormatType(ColumnDefinition column)
Parameters
Returns
Type |
Description |
System.String |
|
View Source
GetColumn(DatabaseType, String, String, String, String, Boolean)
Declaration
public virtual string GetColumn(DatabaseType dbType, string tableName, string columnName, string columnAlias, string referenceName = null, bool forInsert = false)
Parameters
Type |
Name |
Description |
DatabaseType |
dbType |
|
System.String |
tableName |
|
System.String |
columnName |
|
System.String |
columnAlias |
|
System.String |
referenceName |
|
System.Boolean |
forInsert |
|
Returns
Type |
Description |
System.String |
|
View Source
GetColumnsInSchema(IDatabase)
Declaration
public virtual IEnumerable<ColumnInfo> GetColumnsInSchema(IDatabase db)
Parameters
Type |
Name |
Description |
IDatabase |
db |
|
Returns
View Source
GetConcat(String[])
Declaration
public virtual string GetConcat(params string[] args)
Parameters
Type |
Name |
Description |
System.String[] |
args |
|
Returns
Type |
Description |
System.String |
|
View Source
GetConstraintsPerColumn(IDatabase)
Declaration
public virtual IEnumerable<Tuple<string, string, string>> GetConstraintsPerColumn(IDatabase db)
Parameters
Type |
Name |
Description |
IDatabase |
db |
|
Returns
Type |
Description |
IEnumerable<System.Tuple<System.String, System.String, System.String>> |
|
View Source
GetConstraintsPerTable(IDatabase)
Declaration
public virtual IEnumerable<Tuple<string, string>> GetConstraintsPerTable(IDatabase db)
Parameters
Type |
Name |
Description |
IDatabase |
db |
|
Returns
Type |
Description |
IEnumerable<System.Tuple<System.String, System.String>> |
|
View Source
GetDefinedIndexes(IDatabase)
Declaration
public abstract IEnumerable<Tuple<string, string, string, bool>> GetDefinedIndexes(IDatabase db)
Parameters
Type |
Name |
Description |
IDatabase |
db |
|
Returns
Type |
Description |
IEnumerable<System.Tuple<System.String, System.String, System.String, System.Boolean>> |
|
View Source
GetFieldNameForUpdate<TDto>(Expression<Func<TDto, Object>>, String)
Declaration
public virtual string GetFieldNameForUpdate<TDto>(Expression<Func<TDto, object>> fieldSelector, string tableAlias = null)
Parameters
Type |
Name |
Description |
System.Linq.Expressions.Expression<System.Func<TDto, System.Object>> |
fieldSelector |
|
System.String |
tableAlias |
|
Returns
Type |
Description |
System.String |
|
Type Parameters
View Source
GetIndexType(IndexTypes)
Declaration
public virtual string GetIndexType(IndexTypes indexTypes)
Parameters
Returns
Type |
Description |
System.String |
|
View Source
GetQuotedColumnName(String)
Declaration
public virtual string GetQuotedColumnName(string columnName)
Parameters
Type |
Name |
Description |
System.String |
columnName |
|
Returns
Type |
Description |
System.String |
|
View Source
GetQuotedName(String)
Declaration
public virtual string GetQuotedName(string name)
Parameters
Type |
Name |
Description |
System.String |
name |
|
Returns
Type |
Description |
System.String |
|
View Source
GetQuotedTableName(String)
Declaration
public virtual string GetQuotedTableName(string tableName)
Parameters
Type |
Name |
Description |
System.String |
tableName |
|
Returns
Type |
Description |
System.String |
|
View Source
GetQuotedValue(String)
Declaration
public virtual string GetQuotedValue(string value)
Parameters
Type |
Name |
Description |
System.String |
value |
|
Returns
Type |
Description |
System.String |
|
View Source
GetSpecialDbType(SpecialDbType)
Declaration
public virtual string GetSpecialDbType(SpecialDbType dbType)
Parameters
Returns
Type |
Description |
System.String |
|
View Source
GetSpecialDbType(SpecialDbType, Int32)
Declaration
public virtual string GetSpecialDbType(SpecialDbType dbType, int customSize)
Parameters
Type |
Name |
Description |
SpecialDbType |
dbType |
|
System.Int32 |
customSize |
|
Returns
Type |
Description |
System.String |
|
View Source
GetStringColumnEqualComparison(String, Int32, TextColumnType)
Declaration
public virtual string GetStringColumnEqualComparison(string column, int paramIndex, TextColumnType columnType)
Parameters
Type |
Name |
Description |
System.String |
column |
|
System.Int32 |
paramIndex |
|
TextColumnType |
columnType |
|
Returns
Type |
Description |
System.String |
|
View Source
GetStringColumnWildcardComparison(String, Int32, TextColumnType)
Declaration
public virtual string GetStringColumnWildcardComparison(string column, int paramIndex, TextColumnType columnType)
Parameters
Type |
Name |
Description |
System.String |
column |
|
System.Int32 |
paramIndex |
|
TextColumnType |
columnType |
|
Returns
Type |
Description |
System.String |
|
View Source
GetTablesInSchema(IDatabase)
Declaration
public virtual IEnumerable<string> GetTablesInSchema(IDatabase db)
Parameters
Type |
Name |
Description |
IDatabase |
db |
|
Returns
Type |
Description |
IEnumerable<System.String> |
|
View Source
GetUpdatedDatabaseType(DatabaseType, String)
Declaration
public virtual DatabaseType GetUpdatedDatabaseType(DatabaseType current, string connectionString)
Parameters
Type |
Name |
Description |
DatabaseType |
current |
|
System.String |
connectionString |
|
Returns
Type |
Description |
DatabaseType |
|
View Source
GetWildcardPlaceholder()
Declaration
public string GetWildcardPlaceholder()
Returns
Type |
Description |
System.String |
|
View Source
HandleCreateTable(IDatabase, TableDefinition, Boolean)
Declaration
public abstract void HandleCreateTable(IDatabase database, TableDefinition tableDefinition, bool skipKeysAndIndexes = false)
Parameters
Type |
Name |
Description |
IDatabase |
database |
|
TableDefinition |
tableDefinition |
|
System.Boolean |
skipKeysAndIndexes |
|
View Source
InsertForUpdateHint(Sql<ISqlContext>)
Declaration
public virtual Sql<ISqlContext> InsertForUpdateHint(Sql<ISqlContext> sql)
Parameters
Returns
View Source
LeftJoinWithNestedJoin<TDto>(Sql<ISqlContext>, Func<Sql<ISqlContext>, Sql<ISqlContext>>, String)
Declaration
public abstract Sql<ISqlContext>.SqlJoinClause<ISqlContext> LeftJoinWithNestedJoin<TDto>(Sql<ISqlContext> sql, Func<Sql<ISqlContext>, Sql<ISqlContext>> nestedJoin, string alias = null)
Parameters
Returns
Type Parameters
View Source
SelectTop(Sql<ISqlContext>, Int32)
Declaration
public abstract Sql<ISqlContext> SelectTop(Sql<ISqlContext> sql, int top)
Parameters
Type |
Name |
Description |
Sql<ISqlContext> |
sql |
|
System.Int32 |
top |
|
Returns
View Source
SupportsClustered()
Declaration
public virtual bool SupportsClustered()
Returns
Type |
Description |
System.Boolean |
|
View Source
SupportsIdentityInsert()
Declaration
public virtual bool SupportsIdentityInsert()
Returns
Type |
Description |
System.Boolean |
|
View Source
TryGetDefaultConstraint(IDatabase, String, String, out String)
Declaration
public abstract 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 |
|