View Source
Interface ISqlSyntaxProvider
Defines an SqlSyntaxProvider
Assembly: Umbraco.Infrastructure.dll
Syntax
public interface ISqlSyntaxProvider
Properties
View Source
AddColumn
Declaration
string AddColumn { get; }
Property Value
Type |
Description |
System.String |
|
View Source
AliasRegex
Gets a regex matching aliased fields.
Declaration
Regex AliasRegex { get; }
Property Value
Type |
Description |
System.Text.RegularExpressions.Regex |
|
View Source
AlterColumn
Declaration
string AlterColumn { get; }
Property Value
Type |
Description |
System.String |
|
View Source
AlterSchema
Declaration
string AlterSchema { get; }
Property Value
Type |
Description |
System.String |
|
View Source
ConvertDateToOrderableString
Declaration
string ConvertDateToOrderableString { get; }
Property Value
Type |
Description |
System.String |
|
View Source
ConvertDecimalToOrderableString
Declaration
string ConvertDecimalToOrderableString { get; }
Property Value
Type |
Description |
System.String |
|
View Source
ConvertIntegerToOrderableString
Declaration
string ConvertIntegerToOrderableString { get; }
Property Value
Type |
Description |
System.String |
|
View Source
CreateConstraint
Declaration
string CreateConstraint { get; }
Property Value
Type |
Description |
System.String |
|
View Source
CreateIndex
Declaration
string CreateIndex { get; }
Property Value
Type |
Description |
System.String |
|
View Source
CreateSchema
Declaration
string CreateSchema { get; }
Property Value
Type |
Description |
System.String |
|
View Source
CreateTable
Declaration
string CreateTable { get; }
Property Value
Type |
Description |
System.String |
|
View Source
DbProvider
Declaration
string DbProvider { get; }
Property Value
Type |
Description |
System.String |
|
View Source
DefaultIsolationLevel
Returns the default isolation level for the database
Declaration
IsolationLevel DefaultIsolationLevel { get; }
Property Value
Type |
Description |
System.Data.IsolationLevel |
|
View Source
DeleteConstraint
Declaration
string DeleteConstraint { get; }
Property Value
Type |
Description |
System.String |
|
View Source
DeleteData
Declaration
string DeleteData { get; }
Property Value
Type |
Description |
System.String |
|
View Source
DeleteDefaultConstraint
Declaration
string DeleteDefaultConstraint { get; }
Property Value
Type |
Description |
System.String |
|
View Source
DropColumn
Declaration
string DropColumn { get; }
Property Value
Type |
Description |
System.String |
|
View Source
DropIndex
Declaration
string DropIndex { get; }
Property Value
Type |
Description |
System.String |
|
View Source
DropSchema
Declaration
string DropSchema { get; }
Property Value
Type |
Description |
System.String |
|
View Source
DropTable
Declaration
string DropTable { get; }
Property Value
Type |
Description |
System.String |
|
View Source
InsertData
Declaration
string InsertData { get; }
Property Value
Type |
Description |
System.String |
|
View Source
Length
Declaration
Property Value
Type |
Description |
System.String |
|
View Source
ProviderName
Declaration
string ProviderName { get; }
Property Value
Type |
Description |
System.String |
|
View Source
RenameColumn
Declaration
string RenameColumn { get; }
Property Value
Type |
Description |
System.String |
|
View Source
Declaration
string RenameTable { get; }
Property Value
Type |
Description |
System.String |
|
View Source
ScalarMappers
Declaration
virtual IDictionary<Type, IScalarMapper>? ScalarMappers { get; }
Property Value
Type |
Description |
System.Nullable<IDictionary<Type, IScalarMapper>> |
|
View Source
Substring
Declaration
string Substring { get; }
Property Value
Type |
Description |
System.String |
|
View Source
TruncateTable
Declaration
string TruncateTable { get; }
Property Value
Type |
Description |
System.String |
|
View Source
UpdateData
Declaration
string UpdateData { get; }
Property Value
Type |
Description |
System.String |
|
Methods
View Source
AppendForUpdateHint(Sql<ISqlContext>)
Appends the relevant ForUpdate hint.
Declaration
Sql<ISqlContext> AppendForUpdateHint(Sql<ISqlContext> sql)
Parameters
Returns
View Source
DoesPrimaryKeyExist(IDatabase, String, String)
Declaration
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
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
string EscapeString(string val)
Parameters
Type |
Name |
Description |
System.String |
val |
|
Returns
Type |
Description |
System.String |
|
View Source
Declaration
string Format(IEnumerable<ColumnDefinition> columns)
Parameters
Returns
Type |
Description |
System.String |
|
View Source
Declaration
List<string> Format(IEnumerable<ForeignKeyDefinition> foreignKeys)
Parameters
Returns
Type |
Description |
List<System.String> |
|
View Source
Declaration
List<string> Format(IEnumerable<IndexDefinition> indexes)
Parameters
Returns
Type |
Description |
List<System.String> |
|
View Source
Declaration
string Format(ColumnDefinition column)
Parameters
Returns
Type |
Description |
System.String |
|
View Source
Declaration
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
string Format(ForeignKeyDefinition foreignKey)
Parameters
Returns
Type |
Description |
System.String |
|
View Source
Declaration
string Format(IndexDefinition index)
Parameters
Returns
Type |
Description |
System.String |
|
View Source
Declaration
string Format(TableDefinition table)
Parameters
Returns
Type |
Description |
System.String |
|
View Source
Declaration
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
string FormatDateTime(DateTime date, bool includeTime = true)
Parameters
Type |
Name |
Description |
DateTime |
date |
|
System.Boolean |
includeTime |
|
Returns
Type |
Description |
System.String |
|
View Source
Declaration
string FormatPrimaryKey(TableDefinition table)
Parameters
Returns
Type |
Description |
System.String |
|
View Source
Declaration
string FormatTableRename(string oldName, string newName)
Parameters
Type |
Name |
Description |
System.String |
oldName |
|
System.String |
newName |
|
Returns
Type |
Description |
System.String |
|
View Source
GetColumn(DatabaseType, String, String, String, String, Boolean)
Declaration
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
IEnumerable<ColumnInfo> GetColumnsInSchema(IDatabase db)
Parameters
Type |
Name |
Description |
IDatabase |
db |
|
Returns
View Source
GetConcat(String[])
Declaration
string GetConcat(params string[] args)
Parameters
Type |
Name |
Description |
System.String[] |
args |
|
Returns
Type |
Description |
System.String |
|
View Source
GetConstraintsPerColumn(IDatabase)
Returns all constraints defined in the database (Primary keys, foreign keys, unique constraints...) (does not
include indexes)
Declaration
IEnumerable<Tuple<string, string, string>> GetConstraintsPerColumn(IDatabase db)
Parameters
Type |
Name |
Description |
IDatabase |
db |
|
Returns
Type |
Description |
IEnumerable<Tuple<System.String, System.String, System.String>> |
A Tuple containing: TableName, ColumnName, ConstraintName
|
View Source
GetConstraintsPerTable(IDatabase)
Returns all constraints defined in the database (Primary keys, foreign keys, unique constraints...) (does not
include indexes)
Declaration
IEnumerable<Tuple<string, string>> GetConstraintsPerTable(IDatabase db)
Parameters
Type |
Name |
Description |
IDatabase |
db |
|
Returns
Type |
Description |
IEnumerable<Tuple<System.String, System.String>> |
A Tuple containing: TableName, ConstraintName
|
View Source
GetDefinedIndexes(IDatabase)
Returns all defined Indexes in the database excluding primary keys
Declaration
IEnumerable<Tuple<string, string, string, bool>> GetDefinedIndexes(IDatabase db)
Parameters
Type |
Name |
Description |
IDatabase |
db |
|
Returns
Type |
Description |
IEnumerable<Tuple<System.String, System.String, System.String, System.Boolean>> |
A Tuple containing: TableName, IndexName, ColumnName, IsUnique
|
View Source
GetFieldNameForUpdate<TDto>(Expression<Func<TDto, Object>>, String)
Declaration
string GetFieldNameForUpdate<TDto>(Expression<Func<TDto, object>> fieldSelector, string tableAlias = null)
Parameters
Type |
Name |
Description |
System.Linq.Expressions.Expression<Func<TDto, System.Object>> |
fieldSelector |
|
System.String |
tableAlias |
|
Returns
Type |
Description |
System.String |
|
Type Parameters
View Source
GetIndexType(IndexTypes)
Declaration
string GetIndexType(IndexTypes indexTypes)
Parameters
Returns
Type |
Description |
System.String |
|
View Source
GetQuotedColumnName(String)
Declaration
string GetQuotedColumnName(string columnName)
Parameters
Type |
Name |
Description |
System.String |
columnName |
|
Returns
Type |
Description |
System.String |
|
View Source
GetQuotedName(String)
Declaration
string GetQuotedName(string name)
Parameters
Type |
Name |
Description |
System.String |
name |
|
Returns
Type |
Description |
System.String |
|
View Source
GetQuotedTableName(String)
Declaration
string GetQuotedTableName(string tableName)
Parameters
Type |
Name |
Description |
System.String |
tableName |
|
Returns
Type |
Description |
System.String |
|
View Source
GetQuotedValue(String)
Declaration
string GetQuotedValue(string value)
Parameters
Type |
Name |
Description |
System.String |
value |
|
Returns
Type |
Description |
System.String |
|
View Source
GetSpecialDbType(SpecialDbType)
Declaration
string GetSpecialDbType(SpecialDbType dbType)
Parameters
Returns
Type |
Description |
System.String |
|
View Source
GetStringColumnEqualComparison(String, Int32, TextColumnType)
Declaration
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
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
IEnumerable<string> GetTablesInSchema(IDatabase db)
Parameters
Type |
Name |
Description |
IDatabase |
db |
|
Returns
Type |
Description |
IEnumerable<System.String> |
|
View Source
GetUpdatedDatabaseType(DatabaseType, String)
Declaration
virtual DatabaseType GetUpdatedDatabaseType(DatabaseType current, string connectionString)
Parameters
Type |
Name |
Description |
DatabaseType |
current |
|
System.String |
connectionString |
|
Returns
Type |
Description |
DatabaseType |
|
View Source
GetWildcardPlaceholder()
Declaration
string GetWildcardPlaceholder()
Returns
Type |
Description |
System.String |
|
View Source
HandleCreateTable(IDatabase, TableDefinition, Boolean)
Declaration
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>)
Appends the relevant ForUpdate hint.
Declaration
Sql<ISqlContext> InsertForUpdateHint(Sql<ISqlContext> sql)
Parameters
Returns
View Source
LeftJoinWithNestedJoin<TDto>(Sql<ISqlContext>, Func<Sql<ISqlContext>, Sql<ISqlContext>>, String)
Handles left join with nested join
Declaration
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
Sql<ISqlContext> SelectTop(Sql<ISqlContext> sql, int top)
Parameters
Type |
Name |
Description |
Sql<ISqlContext> |
sql |
|
System.Int32 |
top |
|
Returns
View Source
SupportsClustered()
Declaration
Returns
Type |
Description |
System.Boolean |
|
View Source
SupportsIdentityInsert()
Declaration
bool SupportsIdentityInsert()
Returns
Type |
Description |
System.Boolean |
|
View Source
TryGetDefaultConstraint(IDatabase, String, String, out String)
Tries to gets the name of the default constraint on a column.
Declaration
bool TryGetDefaultConstraint(IDatabase db, string tableName, string columnName, out string constraintName)
Parameters
Type |
Name |
Description |
IDatabase |
db |
The database.
|
System.String |
tableName |
The table name.
|
System.String |
columnName |
The column name.
|
System.String |
constraintName |
The constraint name.
|
Returns
Type |
Description |
System.Boolean |
A value indicating whether a default constraint was found.
|