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
IDataProvidermappingSchema
MappingSchemadataOptions
DataOptionssqlOptimizer
ISqlOptimizersqlProviderFlags
SqlProviderFlags
Properties
CteFirst
Identifies CTE clause location:
CteFirst = true
(default): WITH clause goes first in queryCteFirst = false
: WITH clause goes before SELECT
public override bool CteFirst { get; }
Property Value
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
IsRecursiveCteKeywordRequired
protected override bool IsRecursiveCteKeywordRequired { get; }
Property Value
IsValuesSyntaxSupported
If true, provider supports list of VALUES as a source element of merge command.
protected override bool IsValuesSyntaxSupported { get; }
Property Value
SkipFirst
protected override bool SkipFirst { get; }
Property Value
SkipFormat
protected override string SkipFormat { get; }
Property Value
Methods
BuildCommand(SqlStatement, int)
protected override void BuildCommand(SqlStatement statement, int commandNumber)
Parameters
statement
SqlStatementcommandNumber
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
SqlFielddefaultNullable
DefaultNullable
BuildDataTypeFromDataType(SqlDataType, bool, bool)
protected override void BuildDataTypeFromDataType(SqlDataType type, bool forCreateTable, bool canBeNull)
Parameters
type
SqlDataTypeforCreateTable
boolcanBeNull
boolType 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
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.
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
SqlDataTypevalue
ISqlExpression
CommandCount(SqlStatement)
public override int CommandCount(SqlStatement statement)
Parameters
statement
SqlStatement
Returns
Convert(StringBuilder, string, ConvertType)
public override StringBuilder Convert(StringBuilder sb, string value, ConvertType convertType)
Parameters
sb
StringBuildervalue
stringconvertType
ConvertType
Returns
CreateSqlBuilder()
protected override ISqlBuilder CreateSqlBuilder()
Returns
FirstFormat(SelectQuery)
protected override string FirstFormat(SelectQuery selectQuery)
Parameters
selectQuery
SelectQuery
Returns
GetIdentityExpression(SqlTable)
public override ISqlExpression? GetIdentityExpression(SqlTable table)
Parameters
table
SqlTable
Returns
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
ISqlTableSourcealias
stringignoreTableExpression
booldefaultDatabaseName
stringwithoutSuffix
bool
Returns
GetProviderTypeName(IDataContext, DbParameter)
protected override string? GetProviderTypeName(IDataContext dataContext, DbParameter parameter)
Parameters
dataContext
IDataContextparameter
DbParameter
Returns
IsReserved(string)
protected override sealed bool IsReserved(string word)
Parameters
word
string
Returns
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
SqlValuesTableMerge source table.
rows
IReadOnlyList<ISqlExpression[]>Merge source data.
row
intIndex of data row to check. Could contain -1 to indicate that this is a check for empty source NULL value.
column
intIndex of data column to check in row.
Returns
- bool
Returns
true
, if generated SQL should include type information for value at specified position, otherwisefalse
returned.