Table of Contents

Interface ISqlBuilder

Namespace
LinqToDB.SqlProvider
Assembly
linq2db.dll
public interface ISqlBuilder
Extension Methods

Properties

MappingSchema

MappingSchema MappingSchema { get; }

Property Value

MappingSchema

Name

string Name { get; }

Property Value

string

QueryName

string? QueryName { get; }

Property Value

string

SqlProviderFlags

SqlProviderFlags SqlProviderFlags { get; }

Property Value

SqlProviderFlags

StringBuilder

StringBuilder StringBuilder { get; }

Property Value

StringBuilder

TableIDs

Dictionary<string, TableIDInfo>? TableIDs { get; }

Property Value

Dictionary<string, TableIDInfo>

TablePath

string? TablePath { get; }

Property Value

string

Methods

ApplyQueryHints(string, IReadOnlyCollection<string>)

string ApplyQueryHints(string sqlText, IReadOnlyCollection<string> queryHints)

Parameters

sqlText string
queryHints IReadOnlyCollection<string>

Returns

string

BuildDataType(StringBuilder, SqlDataType)

StringBuilder BuildDataType(StringBuilder sb, SqlDataType dataType)

Parameters

sb StringBuilder
dataType SqlDataType

Returns

StringBuilder

BuildExpression(StringBuilder, ISqlExpression, bool, object?)

void BuildExpression(StringBuilder sb, ISqlExpression expr, bool buildTableName, object? context = null)

Parameters

sb StringBuilder
expr ISqlExpression
buildTableName bool
context object

BuildObjectName(StringBuilder, SqlObjectName, ConvertType, bool, TableOptions, bool)

Writes database object name into provided StringBuilder instance.

StringBuilder BuildObjectName(StringBuilder sb, SqlObjectName name, ConvertType objectType = ConvertType.NameToQueryTable, bool escape = true, TableOptions tableOptions = TableOptions.NotSet, bool withoutSuffix = false)

Parameters

sb StringBuilder

String builder for generated object name.

name SqlObjectName

Name of database object (e.g. table, view, procedure or function).

objectType ConvertType

Type of database object, used to select proper name converter.

escape bool

If true, apply required escaping to name components. Must be true except rare cases when escaping is not needed.

tableOptions TableOptions

Table options if called for table. Used to properly generate names for temporary tables.

withoutSuffix bool

If object name have suffix, which could be detached from main name, this parameter disables suffix generation (enables generation of only main name part).

Returns

StringBuilder

sb parameter value.

BuildSql(int, SqlStatement, StringBuilder, OptimizationContext, int)

void BuildSql(int commandNumber, SqlStatement statement, StringBuilder sb, OptimizationContext optimizationContext, int startIndent = 0)

Parameters

commandNumber int
statement SqlStatement
sb StringBuilder
optimizationContext OptimizationContext
startIndent int

BuildSqlID(SqlID)

string? BuildSqlID(Sql.SqlID id)

Parameters

id Sql.SqlID

Returns

string

CommandCount(SqlStatement)

int CommandCount(SqlStatement statement)

Parameters

statement SqlStatement

Returns

int

Convert(StringBuilder, string, ConvertType)

StringBuilder Convert(StringBuilder sb, string value, ConvertType convertType)

Parameters

sb StringBuilder
value string
convertType ConvertType

Returns

StringBuilder

ConvertInline(string, ConvertType)

string ConvertInline(string value, ConvertType convertType)

Parameters

value string
convertType ConvertType

Returns

string

GetIdentityExpression(SqlTable)

ISqlExpression? GetIdentityExpression(SqlTable table)

Parameters

table SqlTable

Returns

ISqlExpression

GetMaxValueSql(EntityDescriptor, ColumnDescriptor)

string GetMaxValueSql(EntityDescriptor entity, ColumnDescriptor column)

Parameters

entity EntityDescriptor
column ColumnDescriptor

Returns

string

GetReserveSequenceValuesSql(int, string)

string GetReserveSequenceValuesSql(int count, string sequenceName)

Parameters

count int
sequenceName string

Returns

string

PrintParameters(IDataContext, StringBuilder, IEnumerable<DbParameter>?)

StringBuilder PrintParameters(IDataContext dataContext, StringBuilder sb, IEnumerable<DbParameter>? parameters)

Parameters

dataContext IDataContext
sb StringBuilder
parameters IEnumerable<DbParameter>

Returns

StringBuilder