Search Results for

    Show / Hide Table of Contents
    View Source

    Interface ISqlSyntaxProvider

    Defines an SqlSyntaxProvider

    Namespace: Umbraco.Cms.Infrastructure.Persistence.SqlSyntax
    Assembly: Umbraco.Infrastructure.dll
    Syntax
    public interface ISqlSyntaxProvider

    Properties

    View Source

    AddColumn

    Declaration
    string AddColumn { get; }
    Property Value
    Type Description
    string
    View Source

    AliasRegex

    Gets a regex matching aliased fields.

    Declaration
    Regex AliasRegex { get; }
    Property Value
    Type Description
    Regex
    Remarks

    Matches "(table.column) AS (alias)" where table, column and alias are properly escaped.

    View Source

    AlterColumn

    Declaration
    string AlterColumn { get; }
    Property Value
    Type Description
    string
    View Source

    AlterSchema

    Declaration
    string AlterSchema { get; }
    Property Value
    Type Description
    string
    View Source

    ConvertDateToOrderableString

    Declaration
    string ConvertDateToOrderableString { get; }
    Property Value
    Type Description
    string
    View Source

    ConvertDecimalToOrderableString

    Declaration
    string ConvertDecimalToOrderableString { get; }
    Property Value
    Type Description
    string
    View Source

    ConvertIntegerToOrderableString

    Declaration
    string ConvertIntegerToOrderableString { get; }
    Property Value
    Type Description
    string
    View Source

    ConvertUniqueIdentifierToString

    Declaration
    string ConvertUniqueIdentifierToString { get; }
    Property Value
    Type Description
    string
    View Source

    CreateConstraint

    Declaration
    string CreateConstraint { get; }
    Property Value
    Type Description
    string
    View Source

    CreateIndex

    Declaration
    string CreateIndex { get; }
    Property Value
    Type Description
    string
    View Source

    CreateSchema

    Declaration
    string CreateSchema { get; }
    Property Value
    Type Description
    string
    View Source

    CreateTable

    Declaration
    string CreateTable { get; }
    Property Value
    Type Description
    string
    View Source

    DbProvider

    Declaration
    string DbProvider { get; }
    Property Value
    Type Description
    string
    View Source

    DefaultIsolationLevel

    Returns the default isolation level for the database

    Declaration
    IsolationLevel DefaultIsolationLevel { get; }
    Property Value
    Type Description
    IsolationLevel
    View Source

    DeleteConstraint

    Declaration
    string DeleteConstraint { get; }
    Property Value
    Type Description
    string
    View Source

    DeleteData

    Declaration
    string DeleteData { get; }
    Property Value
    Type Description
    string
    View Source

    DeleteDefaultConstraint

    Declaration
    string DeleteDefaultConstraint { get; }
    Property Value
    Type Description
    string
    View Source

    DropColumn

    Declaration
    string DropColumn { get; }
    Property Value
    Type Description
    string
    View Source

    DropIndex

    Declaration
    string DropIndex { get; }
    Property Value
    Type Description
    string
    View Source

    DropSchema

    Declaration
    string DropSchema { get; }
    Property Value
    Type Description
    string
    View Source

    DropTable

    Declaration
    string DropTable { get; }
    Property Value
    Type Description
    string
    View Source

    InsertData

    Declaration
    string InsertData { get; }
    Property Value
    Type Description
    string
    View Source

    Length

    Declaration
    string Length { get; }
    Property Value
    Type Description
    string
    View Source

    ProviderName

    Declaration
    string ProviderName { get; }
    Property Value
    Type Description
    string
    View Source

    RenameColumn

    Declaration
    string RenameColumn { get; }
    Property Value
    Type Description
    string
    View Source

    RenameTable

    Declaration
    string RenameTable { get; }
    Property Value
    Type Description
    string
    View Source

    ScalarMappers

    Declaration
    IDictionary<Type, IScalarMapper>? ScalarMappers { get; }
    Property Value
    Type Description
    IDictionary<Type, IScalarMapper>
    View Source

    Substring

    Declaration
    string Substring { get; }
    Property Value
    Type Description
    string
    View Source

    TruncateTable

    Declaration
    string TruncateTable { get; }
    Property Value
    Type Description
    string
    View Source

    UpdateData

    Declaration
    string UpdateData { get; }
    Property Value
    Type Description
    string

    Methods

    View Source

    AppendForUpdateHint(Sql<ISqlContext>)

    Appends the relevant ForUpdate hint.

    Declaration
    Sql<ISqlContext> AppendForUpdateHint(Sql<ISqlContext> sql)
    Parameters
    Type Name Description
    Sql<ISqlContext> sql
    Returns
    Type Description
    Sql<ISqlContext>
    View Source

    ColumnWithAlias(string, string, string)

    Declaration
    string ColumnWithAlias(string tableNameOrAlias, string columnName, string columnAlias = "")
    Parameters
    Type Name Description
    string tableNameOrAlias
    string columnName
    string columnAlias
    Returns
    Type Description
    string
    View Source

    ConvertIntegerToBoolean(int)

    Declaration
    string ConvertIntegerToBoolean(int value)
    Parameters
    Type Name Description
    int value
    Returns
    Type Description
    string
    View Source

    DoesPrimaryKeyExist(IDatabase, string, string)

    Declaration
    bool DoesPrimaryKeyExist(IDatabase db, string tableName, string primaryKeyName)
    Parameters
    Type Name Description
    IDatabase db
    string tableName
    string primaryKeyName
    Returns
    Type Description
    bool
    View Source

    DoesTableExist(IDatabase, string)

    Declaration
    bool DoesTableExist(IDatabase db, string tableName)
    Parameters
    Type Name Description
    IDatabase db
    string tableName
    Returns
    Type Description
    bool
    View Source

    EscapeString(string)

    Declaration
    string EscapeString(string val)
    Parameters
    Type Name Description
    string val
    Returns
    Type Description
    string
    View Source

    Format(IEnumerable<ColumnDefinition>)

    Declaration
    string Format(IEnumerable<ColumnDefinition> columns)
    Parameters
    Type Name Description
    IEnumerable<ColumnDefinition> columns
    Returns
    Type Description
    string
    View Source

    Format(IEnumerable<ForeignKeyDefinition>)

    Declaration
    List<string> Format(IEnumerable<ForeignKeyDefinition> foreignKeys)
    Parameters
    Type Name Description
    IEnumerable<ForeignKeyDefinition> foreignKeys
    Returns
    Type Description
    List<string>
    View Source

    Format(IEnumerable<IndexDefinition>)

    Declaration
    List<string> Format(IEnumerable<IndexDefinition> indexes)
    Parameters
    Type Name Description
    IEnumerable<IndexDefinition> indexes
    Returns
    Type Description
    List<string>
    View Source

    Format(ColumnDefinition)

    Declaration
    string Format(ColumnDefinition column)
    Parameters
    Type Name Description
    ColumnDefinition column
    Returns
    Type Description
    string
    View Source

    Format(ColumnDefinition, string, out IEnumerable<string>)

    Declaration
    string Format(ColumnDefinition column, string tableName, out IEnumerable<string> sqls)
    Parameters
    Type Name Description
    ColumnDefinition column
    string tableName
    IEnumerable<string> sqls
    Returns
    Type Description
    string
    View Source

    Format(ForeignKeyDefinition)

    Declaration
    string Format(ForeignKeyDefinition foreignKey)
    Parameters
    Type Name Description
    ForeignKeyDefinition foreignKey
    Returns
    Type Description
    string
    View Source

    Format(IndexDefinition)

    Declaration
    string Format(IndexDefinition index)
    Parameters
    Type Name Description
    IndexDefinition index
    Returns
    Type Description
    string
    View Source

    Format(TableDefinition)

    Declaration
    string Format(TableDefinition table)
    Parameters
    Type Name Description
    TableDefinition table
    Returns
    Type Description
    string
    View Source

    FormatColumnRename(string?, string?, string?)

    Declaration
    string FormatColumnRename(string? tableName, string? oldName, string? newName)
    Parameters
    Type Name Description
    string tableName
    string oldName
    string newName
    Returns
    Type Description
    string
    View Source

    FormatDateTime(DateTime, bool)

    Declaration
    string FormatDateTime(DateTime date, bool includeTime = true)
    Parameters
    Type Name Description
    DateTime date
    bool includeTime
    Returns
    Type Description
    string
    View Source

    FormatPrimaryKey(TableDefinition)

    Declaration
    string FormatPrimaryKey(TableDefinition table)
    Parameters
    Type Name Description
    TableDefinition table
    Returns
    Type Description
    string
    View Source

    FormatTableRename(string?, string?)

    Declaration
    string FormatTableRename(string? oldName, string? newName)
    Parameters
    Type Name Description
    string oldName
    string newName
    Returns
    Type Description
    string
    View Source

    GetColumn(DatabaseType, string, string, string?, string?, bool)

    Declaration
    string GetColumn(DatabaseType dbType, string tableName, string columnName, string? columnAlias, string? referenceName = null, bool forInsert = false)
    Parameters
    Type Name Description
    DatabaseType dbType
    string tableName
    string columnName
    string columnAlias
    string referenceName
    bool forInsert
    Returns
    Type Description
    string
    View Source

    GetColumnsInSchema(IDatabase)

    Declaration
    IEnumerable<ColumnInfo> GetColumnsInSchema(IDatabase db)
    Parameters
    Type Name Description
    IDatabase db
    Returns
    Type Description
    IEnumerable<ColumnInfo>
    View Source

    GetConcat(params string[])

    Declaration
    string GetConcat(params string[] args)
    Parameters
    Type Name Description
    string[] args
    Returns
    Type Description
    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<string, string, 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<string, 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<string, string, string, bool>>

    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
    Expression<Func<TDto, object>> fieldSelector
    string tableAlias
    Returns
    Type Description
    string
    Type Parameters
    Name Description
    TDto
    View Source

    GetIndexType(IndexTypes)

    Declaration
    string GetIndexType(IndexTypes indexTypes)
    Parameters
    Type Name Description
    IndexTypes indexTypes
    Returns
    Type Description
    string
    View Source

    GetQuotedColumnName(string?)

    Declaration
    string GetQuotedColumnName(string? columnName)
    Parameters
    Type Name Description
    string columnName
    Returns
    Type Description
    string
    View Source

    GetQuotedName(string?)

    Declaration
    string GetQuotedName(string? name)
    Parameters
    Type Name Description
    string name
    Returns
    Type Description
    string
    View Source

    GetQuotedTableName(string?)

    Declaration
    string GetQuotedTableName(string? tableName)
    Parameters
    Type Name Description
    string tableName
    Returns
    Type Description
    string
    View Source

    GetQuotedValue(string)

    Declaration
    string GetQuotedValue(string value)
    Parameters
    Type Name Description
    string value
    Returns
    Type Description
    string
    View Source

    GetSpecialDbType(SpecialDbType)

    Declaration
    string GetSpecialDbType(SpecialDbType dbType)
    Parameters
    Type Name Description
    SpecialDbType dbType
    Returns
    Type Description
    string
    View Source

    GetStringColumnEqualComparison(string, int, TextColumnType)

    Declaration
    string GetStringColumnEqualComparison(string column, int paramIndex, TextColumnType columnType)
    Parameters
    Type Name Description
    string column
    int paramIndex
    TextColumnType columnType
    Returns
    Type Description
    string
    View Source

    GetStringColumnWildcardComparison(string, int, TextColumnType)

    Declaration
    string GetStringColumnWildcardComparison(string column, int paramIndex, TextColumnType columnType)
    Parameters
    Type Name Description
    string column
    int paramIndex
    TextColumnType columnType
    Returns
    Type Description
    string
    View Source

    GetTablesInSchema(IDatabase)

    Declaration
    IEnumerable<string> GetTablesInSchema(IDatabase db)
    Parameters
    Type Name Description
    IDatabase db
    Returns
    Type Description
    IEnumerable<string>
    View Source

    GetUpdatedDatabaseType(DatabaseType, string?)

    Declaration
    DatabaseType GetUpdatedDatabaseType(DatabaseType current, string? connectionString)
    Parameters
    Type Name Description
    DatabaseType current
    string connectionString
    Returns
    Type Description
    DatabaseType
    View Source

    GetWildcardConcat(string)

    This ensures that GetWildcardPlaceholder() character is surronded by '' when used inside a LIKE statement. E.g. in WhereLike() extension and the defaultConcat is used.

    Declaration
    string GetWildcardConcat(string concatDefault = "")
    Parameters
    Type Name Description
    string concatDefault

    When provided this overides the GetWildcardPlaceholder() default.

    Returns
    Type Description
    string
    View Source

    GetWildcardPlaceholder()

    Declaration
    string GetWildcardPlaceholder()
    Returns
    Type Description
    string
    View Source

    HandleCreateTable(IDatabase, TableDefinition, bool)

    Declaration
    void HandleCreateTable(IDatabase database, TableDefinition tableDefinition, bool skipKeysAndIndexes = false)
    Parameters
    Type Name Description
    IDatabase database
    TableDefinition tableDefinition
    bool skipKeysAndIndexes
    View Source

    InsertForUpdateHint(Sql<ISqlContext>)

    Appends the relevant ForUpdate hint.

    Declaration
    Sql<ISqlContext> InsertForUpdateHint(Sql<ISqlContext> sql)
    Parameters
    Type Name Description
    Sql<ISqlContext> sql
    Returns
    Type Description
    Sql<ISqlContext>
    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
    Type Name Description
    Sql<ISqlContext> sql
    Func<Sql<ISqlContext>, Sql<ISqlContext>> nestedJoin
    string alias
    Returns
    Type Description
    Sql<ISqlContext>.SqlJoinClause<ISqlContext>
    Type Parameters
    Name Description
    TDto
    View Source

    OrderByGuid(string, string)

    Declaration
    string OrderByGuid(string tableName, string columnName)
    Parameters
    Type Name Description
    string tableName
    string columnName
    Returns
    Type Description
    string
    View Source

    SelectTop(Sql<ISqlContext>, int)

    Declaration
    Sql<ISqlContext> SelectTop(Sql<ISqlContext> sql, int top)
    Parameters
    Type Name Description
    Sql<ISqlContext> sql
    int top
    Returns
    Type Description
    Sql<ISqlContext>
    View Source

    SupportsClustered()

    Declaration
    bool SupportsClustered()
    Returns
    Type Description
    bool
    View Source

    SupportsIdentityInsert()

    Declaration
    bool SupportsIdentityInsert()
    Returns
    Type Description
    bool
    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.

    string tableName

    The table name.

    string columnName

    The column name.

    string constraintName

    The constraint name.

    Returns
    Type Description
    bool

    A value indicating whether a default constraint was found.

    Remarks

    Some database engines may not have names for default constraints, in which case the function may return true, but constraintName is unspecified.

    • Edit this page
    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX