Table of Contents

Class FirebirdSqlBuilder

Namespace
LinqToDB.DataProvider.Firebird
Assembly
linq2db.dll
public class FirebirdSqlBuilder : BasicSqlBuilder<FirebirdOptions>, ISqlBuilder
Inheritance
FirebirdSqlBuilder
Implements
Inherited Members
Extension Methods

Constructors

FirebirdSqlBuilder(IDataProvider, MappingSchema, DataOptions, ISqlOptimizer, SqlProviderFlags)

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

Parameters

provider IDataProvider
mappingSchema MappingSchema
dataOptions DataOptions
sqlOptimizer ISqlOptimizer
sqlProviderFlags SqlProviderFlags

Properties

CteFirst

Identifies CTE clause location:

  • CteFirst = true (default): WITH clause goes first in query
  • CteFirst = false: WITH clause goes before SELECT
public override bool CteFirst { get; }

Property Value

bool

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

IsRecursiveCteKeywordRequired

protected override bool IsRecursiveCteKeywordRequired { get; }

Property Value

bool

IsValuesSyntaxSupported

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

protected override bool IsValuesSyntaxSupported { get; }

Property Value

bool

SkipFirst

protected override bool SkipFirst { 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

BuildCreateTableNullAttribute(SqlField, DefaultNullable)

protected override void BuildCreateTableNullAttribute(SqlField field, DefaultNullable defaultNullable)

Parameters

field SqlField
defaultNullable DefaultNullable

BuildDataTypeFromDataType(SqlDataType, bool, bool)

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

Parameters

type SqlDataType
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).

BuildDeleteQuery(SqlDeleteStatement)

protected override void BuildDeleteQuery(SqlDeleteStatement deleteStatement)

Parameters

deleteStatement SqlDeleteStatement

BuildDropTableStatement(SqlDropTableStatement)

protected override void BuildDropTableStatement(SqlDropTableStatement dropTable)

Parameters

dropTable SqlDropTableStatement

BuildEndCreateTableStatement(SqlCreateTableStatement)

protected override void BuildEndCreateTableStatement(SqlCreateTableStatement createTable)

Parameters

createTable SqlCreateTableStatement

BuildGetIdentity(SqlInsertClause)

protected override void BuildGetIdentity(SqlInsertClause insertClause)

Parameters

insertClause SqlInsertClause

BuildInsertOrUpdateQuery(SqlInsertOrUpdateStatement)

protected override void BuildInsertOrUpdateQuery(SqlInsertOrUpdateStatement insertOrUpdate)

Parameters

insertOrUpdate SqlInsertOrUpdateStatement

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, bool escape, TableOptions tableOptions, bool withoutSuffix)

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

BuildStartCreateTableStatement(SqlCreateTableStatement)

protected override void BuildStartCreateTableStatement(SqlCreateTableStatement createTable)

Parameters

createTable SqlCreateTableStatement

BuildTypedExpression(SqlDataType, ISqlExpression)

protected override void BuildTypedExpression(SqlDataType dataType, ISqlExpression value)

Parameters

dataType SqlDataType
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

GetIdentityExpression(SqlTable)

public override ISqlExpression? GetIdentityExpression(SqlTable table)

Parameters

table SqlTable

Returns

ISqlExpression

GetPhysicalTableName(ISqlTableSource, string?, bool, string?, bool)

protected override string GetPhysicalTableName(ISqlTableSource table, string? alias, bool ignoreTableExpression = false, string? defaultDatabaseName = null, bool withoutSuffix = false)

Parameters

table ISqlTableSource
alias string
ignoreTableExpression bool
defaultDatabaseName string
withoutSuffix bool

Returns

string

GetProviderTypeName(IDataContext, DbParameter)

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

Parameters

dataContext IDataContext
parameter DbParameter

Returns

string

IsReserved(string)

protected override sealed bool IsReserved(string word)

Parameters

word string

Returns

bool

IsSqlValuesTableValueTypeRequired(SqlValuesTable, IReadOnlyList<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<ISqlExpression[]> rows, int row, int column)

Parameters

source SqlValuesTable

Merge source table.

rows IReadOnlyList<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.