Interface ISqlBuilder
- Namespace
- LinqToDB.SqlProvider
- Assembly
- linq2db.dll
public interface ISqlBuilder
- Extension Methods
Properties
MappingSchema
MappingSchema MappingSchema { get; }
Property Value
Name
string Name { get; }
Property Value
QueryName
string? QueryName { get; }
Property Value
SqlProviderFlags
SqlProviderFlags SqlProviderFlags { get; }
Property Value
StringBuilder
StringBuilder StringBuilder { get; }
Property Value
TableIDs
Dictionary<string, TableIDInfo>? TableIDs { get; }
Property Value
TablePath
string? TablePath { get; }
Property Value
Methods
ApplyQueryHints(string, IReadOnlyCollection<string>)
string ApplyQueryHints(string sqlText, IReadOnlyCollection<string> queryHints)
Parameters
sqlText
stringqueryHints
IReadOnlyCollection<string>
Returns
BuildDataType(StringBuilder, SqlDataType)
StringBuilder BuildDataType(StringBuilder sb, SqlDataType dataType)
Parameters
sb
StringBuilderdataType
SqlDataType
Returns
BuildExpression(StringBuilder, ISqlExpression, bool, object?)
void BuildExpression(StringBuilder sb, ISqlExpression expr, bool buildTableName, object? context = null)
Parameters
sb
StringBuilderexpr
ISqlExpressionbuildTableName
boolcontext
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
StringBuilderString builder for generated object name.
name
SqlObjectNameName of database object (e.g. table, view, procedure or function).
objectType
ConvertTypeType of database object, used to select proper name converter.
escape
boolIf
true
, apply required escaping to name components. Must betrue
except rare cases when escaping is not needed.tableOptions
TableOptionsTable options if called for table. Used to properly generate names for temporary tables.
withoutSuffix
boolIf 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
intstatement
SqlStatementsb
StringBuilderoptimizationContext
OptimizationContextstartIndent
int
BuildSqlID(SqlID)
string? BuildSqlID(Sql.SqlID id)
Parameters
Returns
CommandCount(SqlStatement)
int CommandCount(SqlStatement statement)
Parameters
statement
SqlStatement
Returns
Convert(StringBuilder, string, ConvertType)
StringBuilder Convert(StringBuilder sb, string value, ConvertType convertType)
Parameters
sb
StringBuildervalue
stringconvertType
ConvertType
Returns
ConvertInline(string, ConvertType)
string ConvertInline(string value, ConvertType convertType)
Parameters
value
stringconvertType
ConvertType
Returns
GetIdentityExpression(SqlTable)
ISqlExpression? GetIdentityExpression(SqlTable table)
Parameters
table
SqlTable
Returns
GetMaxValueSql(EntityDescriptor, ColumnDescriptor)
string GetMaxValueSql(EntityDescriptor entity, ColumnDescriptor column)
Parameters
entity
EntityDescriptorcolumn
ColumnDescriptor
Returns
GetReserveSequenceValuesSql(int, string)
string GetReserveSequenceValuesSql(int count, string sequenceName)
Parameters
Returns
PrintParameters(IDataContext, StringBuilder, IEnumerable<DbParameter>?)
StringBuilder PrintParameters(IDataContext dataContext, StringBuilder sb, IEnumerable<DbParameter>? parameters)
Parameters
dataContext
IDataContextsb
StringBuilderparameters
IEnumerable<DbParameter>