Table of Contents

Class InformixSqlBuilder

Namespace
LinqToDB.Internal.DataProvider.Informix
Assembly
linq2db.dll
public class InformixSqlBuilder : BasicSqlBuilder, ISqlBuilder
Inheritance
object
InformixSqlBuilder
Implements
Inherited Members
Extension Methods

Constructors

InformixSqlBuilder(IDataProvider?, MappingSchema, DataOptions, ISqlOptimizer, SqlProviderFlags)

public InformixSqlBuilder(IDataProvider? provider, MappingSchema mappingSchema, DataOptions dataOptions, ISqlOptimizer sqlOptimizer, SqlProviderFlags sqlProviderFlags)

Parameters

provider IDataProvider
mappingSchema MappingSchema
dataOptions DataOptions
sqlOptimizer ISqlOptimizer
sqlProviderFlags SqlProviderFlags

Properties

ConcatStyle

SQL-emit shape for SqlConcatExpression. Defaults to Plus; override per provider.

protected override BasicSqlBuilder.ConcatBuildStyle ConcatStyle { get; }

Property Value

BasicSqlBuilder.ConcatBuildStyle

FakeTable

If IsValuesSyntaxSupported set to false and provider doesn't support SELECTs without FROM clause, this property should contain name of table (or equivalent SQL) with single record. IMPORTANT: as this property could return SQL, we don't escape it, so it should contain only valid SQL/identifiers.

protected override string FakeTable { get; }

Property Value

string

IsValuesSyntaxSupported

If true, provider supports list of VALUES as a source element of merge command.

protected override bool IsValuesSyntaxSupported { get; }

Property Value

bool

ParameterCastDecimalNullsOnly

Whether decimal facets are only filled in where the parameter type leaves them unset, rather than always taken from the value.

protected override bool ParameterCastDecimalNullsOnly { get; }

Property Value

bool

SkipFormat

protected override string SkipFormat { get; }

Property Value

string

Methods

BuildCommand(SqlStatement, int)

protected override void BuildCommand(SqlStatement statement, int commandNumber)

Parameters

statement SqlStatement
commandNumber int

BuildCreateTableCommand(SqlTable)

protected override void BuildCreateTableCommand(SqlTable table)

Parameters

table SqlTable

BuildCreateTableFieldType(SqlField)

protected override void BuildCreateTableFieldType(SqlField field)

Parameters

field SqlField

BuildCreateTablePrimaryKey(SqlCreateTableStatement, string, IEnumerable<string>)

protected override void BuildCreateTablePrimaryKey(SqlCreateTableStatement createTable, string pkName, IEnumerable<string> fieldNames)

Parameters

createTable SqlCreateTableStatement
pkName string
fieldNames IEnumerable<string>

BuildDataTypeFromDataType(DbDataType, bool, bool)

protected override void BuildDataTypeFromDataType(DbDataType type, bool forCreateTable, bool canBeNull)

Parameters

type DbDataType
forCreateTable bool
canBeNull bool

Type could store NULL values (could be used for column table type generation or for databases with explicit typee nullability like ClickHouse).

BuildDropTableStatement(SqlDropTableStatement)

protected override void BuildDropTableStatement(SqlDropTableStatement dropTable)

Parameters

dropTable SqlDropTableStatement

BuildInListPredicate(InList)

protected override void BuildInListPredicate(SqlPredicate.InList predicate)

Parameters

predicate SqlPredicate.InList

BuildInSubQueryPredicate(InSubQuery)

protected override void BuildInSubQueryPredicate(SqlPredicate.InSubQuery predicate)

Parameters

predicate SqlPredicate.InSubQuery

BuildIsDistinctPredicate(IsDistinct)

protected override void BuildIsDistinctPredicate(SqlPredicate.IsDistinct expr)

Parameters

expr SqlPredicate.IsDistinct

BuildLikePredicate(Like)

protected override void BuildLikePredicate(SqlPredicate.Like predicate)

Parameters

predicate SqlPredicate.Like

BuildMergeInto(NullabilityContext, SqlMergeStatement)

protected override void BuildMergeInto(NullabilityContext nullability, SqlMergeStatement merge)

Parameters

nullability NullabilityContext
merge SqlMergeStatement

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

Writes database object name into provided StringBuilder instance.

public override 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.

BuildSelectClause(SelectQuery)

protected override void BuildSelectClause(SelectQuery selectQuery)

Parameters

selectQuery SelectQuery

BuildSql(int, SqlStatement, StringBuilder, OptimizationContext, int, ColumnAliasMode, NullabilityContext?)

protected override void BuildSql(int commandNumber, SqlStatement statement, StringBuilder sb, OptimizationContext optimizationContext, int indent, BasicSqlBuilder.ColumnAliasMode aliasMode, NullabilityContext? nullabilityContext)

Parameters

commandNumber int
statement SqlStatement
sb StringBuilder
optimizationContext OptimizationContext
indent int
aliasMode BasicSqlBuilder.ColumnAliasMode
nullabilityContext NullabilityContext

BuildSqlRow(SqlRowExpression, bool, bool, bool)

protected override void BuildSqlRow(SqlRowExpression expr, bool buildTableName, bool checkParentheses, bool throwExceptionIfTableNotFound)

Parameters

expr SqlRowExpression
buildTableName bool
checkParentheses bool
throwExceptionIfTableNotFound bool

BuildTruncateTable(SqlTruncateTableStatement)

protected override void BuildTruncateTable(SqlTruncateTableStatement truncateTable)

Parameters

truncateTable SqlTruncateTableStatement

BuildTypedExpression(DbDataType, ISqlExpression)

protected override void BuildTypedExpression(DbDataType dataType, ISqlExpression value)

Parameters

dataType DbDataType
value ISqlExpression

CommandCount(SqlStatement)

public override int CommandCount(SqlStatement statement)

Parameters

statement SqlStatement

Returns

int

Convert(StringBuilder, string, ConvertType)

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

Parameters

sb StringBuilder
value string
convertType ConvertType

Returns

StringBuilder

CreateSqlBuilder()

protected override ISqlBuilder CreateSqlBuilder()

Returns

ISqlBuilder

FirstFormat(SelectQuery)

protected override string FirstFormat(SelectQuery selectQuery)

Parameters

selectQuery SelectQuery

Returns

string

GetParameterCastType(SqlParameter)

Type used to render a SqlParameterCastExpression over parameter, or null to render the parameter bare. Defaults to the parameter's own type; providers that must state exact facets override it, typically via GetValueBasedParameterCastType(SqlParameter).

protected override DbDataType? GetParameterCastType(SqlParameter parameter)

Parameters

parameter SqlParameter

Returns

DbDataType?

GetProviderTypeName(IDataContext, DbParameter)

protected override string? GetProviderTypeName(IDataContext dataContext, DbParameter parameter)

Parameters

dataContext IDataContext
parameter DbParameter

Returns

string

IsReserved(string)

protected override bool IsReserved(string word)

Parameters

word string

Returns

bool

IsSqlValuesTableValueTypeRequired(SqlValuesTable, IReadOnlyList<List<ISqlExpression>>, int, int)

Checks that value in specific row and column in enumerable source requires type information generation.

protected override bool IsSqlValuesTableValueTypeRequired(SqlValuesTable source, IReadOnlyList<List<ISqlExpression>> rows, int row, int column)

Parameters

source SqlValuesTable

Merge source table.

rows IReadOnlyList<List<ISqlExpression>>

Merge source data.

row int

Index of data row to check. Could contain -1 to indicate that this is a check for empty source NULL value.

column int

Index of data column to check in row.

Returns

bool

Returns true, if generated SQL should include type information for value at specified position, otherwise false returned.