Class PostgreSQLSqlBuilder
- Namespace
- LinqToDB.DataProvider.PostgreSQL
- Assembly
- linq2db.dll
public class PostgreSQLSqlBuilder : BasicSqlBuilder<PostgreSQLOptions>, ISqlBuilder
- Inheritance
-
PostgreSQLSqlBuilder
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
PostgreSQLSqlBuilder(IDataProvider?, MappingSchema, DataOptions, ISqlOptimizer, SqlProviderFlags)
public PostgreSQLSqlBuilder(IDataProvider? provider, MappingSchema mappingSchema, DataOptions dataOptions, ISqlOptimizer sqlOptimizer, SqlProviderFlags sqlProviderFlags)
Parameters
provider
IDataProvidermappingSchema
MappingSchemadataOptions
DataOptionssqlOptimizer
ISqlOptimizersqlProviderFlags
SqlProviderFlags
PostgreSQLSqlBuilder(BasicSqlBuilder)
protected PostgreSQLSqlBuilder(BasicSqlBuilder parentBuilder)
Parameters
parentBuilder
BasicSqlBuilder
Properties
IdentifierQuoteMode
[Obsolete("Use PostgreSQLOptions.Default.IdentifierQuoteMode instead.")]
public static PostgreSQLIdentifierQuoteMode IdentifierQuoteMode { get; set; }
Property Value
IsRecursiveCteKeywordRequired
protected override bool IsRecursiveCteKeywordRequired { get; }
Property Value
SupportsNullInColumn
protected override bool SupportsNullInColumn { get; }
Property Value
Methods
BuildCreateTableCommand(SqlTable)
protected override void BuildCreateTableCommand(SqlTable table)
Parameters
table
SqlTable
BuildCreateTableFieldType(SqlField)
protected override void BuildCreateTableFieldType(SqlField field)
Parameters
field
SqlField
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).
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
BuildJoinType(SqlJoinedTable, SqlSearchCondition)
protected override bool BuildJoinType(SqlJoinedTable join, SqlSearchCondition condition)
Parameters
join
SqlJoinedTablecondition
SqlSearchCondition
Returns
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 = 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.
BuildQueryExtensions(SqlStatement)
protected override void BuildQueryExtensions(SqlStatement statement)
Parameters
statement
SqlStatement
BuildSql()
protected override void BuildSql()
BuildSubQueryExtensions(SqlStatement)
protected override void BuildSubQueryExtensions(SqlStatement statement)
Parameters
statement
SqlStatement
BuildTruncateTableStatement(SqlTruncateTableStatement)
protected override void BuildTruncateTableStatement(SqlTruncateTableStatement truncateTable)
Parameters
truncateTable
SqlTruncateTableStatement
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
GetIdentityExpression(SqlTable)
public override ISqlExpression? GetIdentityExpression(SqlTable table)
Parameters
table
SqlTable
Returns
GetProviderTypeName(IDataContext, DbParameter)
protected override string? GetProviderTypeName(IDataContext dataContext, DbParameter parameter)
Parameters
dataContext
IDataContextparameter
DbParameter
Returns
GetReserveSequenceValuesSql(int, string)
public override string GetReserveSequenceValuesSql(int count, string sequenceName)
Parameters
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.
LimitFormat(SelectQuery)
protected override string LimitFormat(SelectQuery selectQuery)
Parameters
selectQuery
SelectQuery
Returns
OffsetFormat(SelectQuery)
protected override string OffsetFormat(SelectQuery selectQuery)
Parameters
selectQuery
SelectQuery