Table of Contents

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 IDataProvider
mappingSchema MappingSchema
dataOptions DataOptions
sqlOptimizer ISqlOptimizer
sqlProviderFlags 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

PostgreSQLIdentifierQuoteMode

IsRecursiveCteKeywordRequired

protected override bool IsRecursiveCteKeywordRequired { get; }

Property Value

bool

SupportsNullInColumn

protected override bool SupportsNullInColumn { get; }

Property Value

bool

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

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 SqlJoinedTable
condition SqlSearchCondition

Returns

bool

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

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 StringBuilder
value string
convertType ConvertType

Returns

StringBuilder

CreateSqlBuilder()

protected override ISqlBuilder CreateSqlBuilder()

Returns

ISqlBuilder

GetIdentityExpression(SqlTable)

public override ISqlExpression? GetIdentityExpression(SqlTable table)

Parameters

table SqlTable

Returns

ISqlExpression

GetProviderTypeName(IDataContext, DbParameter)

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

Parameters

dataContext IDataContext
parameter DbParameter

Returns

string

GetReserveSequenceValuesSql(int, string)

public override string GetReserveSequenceValuesSql(int count, string sequenceName)

Parameters

count int
sequenceName string

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.

LimitFormat(SelectQuery)

protected override string LimitFormat(SelectQuery selectQuery)

Parameters

selectQuery SelectQuery

Returns

string

OffsetFormat(SelectQuery)

protected override string OffsetFormat(SelectQuery selectQuery)

Parameters

selectQuery SelectQuery

Returns

string