Class PostgreSqlConnectionProvider
- Namespace
- DevExpress.Xpo.DB
- Assembly
- DevExpress.Xpo.v24.1.dll
Implements data-aware operations for working with a PostgreSQL database.
public class PostgreSqlConnectionProvider : ConnectionProviderSql
- Inheritance
-
PostgreSqlConnectionProvider
Constructors
PostgreSqlConnectionProvider(IDbConnection, AutoCreateOption)
Initializes a new instance of the PostgreSqlConnectionProvider class with the specified settings.
public PostgreSqlConnectionProvider(IDbConnection connection, AutoCreateOption autoCreateOption)
Parameters
connection
IDbConnectionAn object implementing the IDbConnection interface that represents an open connection to a data source.
autoCreateOption
AutoCreateOptionAn DevExpress.Xpo.DB.AutoCreateOption value that specifies which operations should be performed when storage is accessed for the first time. This parameter is used to initialize the IDataStore.AutoCreateOption property.
Fields
GlobalCommandPoolBehavior
Specifies the default command pool behavior for all PostgreSqlConnectionProvider instances. The default value is null, which means that the behavior is ConnectionSession for PostgreSQL 8.3+ and None for older versions.
public static CommandPoolBehavior? GlobalCommandPoolBehavior
Field Value
- CommandPoolBehavior?
GlobalUseLegacyGuidSupport
Specifies the default GUID mapping mode for all PostgreSqlConnectionProvider instances. Set this field to true to map GUIDs to CHAR(36) columns or set it to false to map to the UUID columns (requires Npgsql v3.1.0). To specify the character set for a specific PostgreSqlConnectionProvider instance, use the UseLegacyGuidSupport field instead.
public static bool? GlobalUseLegacyGuidSupport
Field Value
- bool?
MaximumStringSize
This member supports the internal infrastructure and is not intended to be used directly from your code.
public const int MaximumStringSize = 4000
Field Value
ObjectsOwner
This member supports the internal infrastructure and is not intended to be used directly from your code.
public string ObjectsOwner
Field Value
UseLegacyGuidSupport
Specifies the default GUID mapping mode for the current PostgreSqlConnectionProvider instance. Set this field to true to map GUIDs to CHAR(36) columns or set it to false to map to the UUID columns (requires Npgsql v3.1.0). When this field is set to null), the GlobalUseLegacyGuidSupport value is used. When both values are null, the UUID columns are used.
public bool? UseLegacyGuidSupport
Field Value
- bool?
XpoProviderTypeString
Gets the name of the current connection provider. This name is used internally when generating a connection string via the PostgreSqlConnectionProvider.GetConnectionString method.
public const string XpoProviderTypeString = "Postgres"
Field Value
Properties
CommandPoolBehavior
protected override CommandPoolBehavior CommandPoolBehavior { get; }
Property Value
- CommandPoolBehavior
DbTypeMapper
protected override DbTypeMapperBase DbTypeMapper { get; }
Property Value
- DbTypeMapperBase
NativeOuterApplySupported
public override bool NativeOuterApplySupported { get; }
Property Value
NativeSkipTakeSupported
This member supports the internal infrastructure and is not intended to be used directly from your code.
public override bool NativeSkipTakeSupported { get; }
Property Value
UpdateSchemaFormatter
protected override UpdateSchemaSqlFormatterHelper UpdateSchemaFormatter { get; }
Property Value
- UpdateSchemaSqlFormatterHelper
Methods
ClearDatabase(IDbCommand)
This method supports the internal infrastructure and is not intended to be called directly from your code.
public void ClearDatabase(IDbCommand command)
Parameters
command
IDbCommand
CollectTablesToCreate(ICollection)
This method supports the internal infrastructure and is not intended to be called directly from your code.
public override ICollection CollectTablesToCreate(ICollection tables)
Parameters
tables
ICollection
Returns
CommandBuilderDeriveParameters(IDbCommand)
protected override void CommandBuilderDeriveParameters(IDbCommand command)
Parameters
command
IDbCommand
ConvertToDbParameter(object, TypeCode)
protected override object ConvertToDbParameter(object clientValue, TypeCode clientValueTypeCode)
Parameters
Returns
CreateConnection()
protected override IDbConnection CreateConnection()
Returns
CreateConnection(string)
This method supports the internal infrastructure and is not intended to be called directly from your code.
public static IDbConnection CreateConnection(string connectionString)
Parameters
connectionString
string
Returns
CreateDataBase()
protected override void CreateDataBase()
CreateParameter(IDbCommand, object, string, DBColumnType, string, int)
protected override IDataParameter CreateParameter(IDbCommand command, object value, string name, DBColumnType dbType, string dbTypeName, int size)
Parameters
command
IDbCommandvalue
objectname
stringdbType
DBColumnTypedbTypeName
stringsize
int
Returns
CreateProviderFromConnection(IDbConnection, AutoCreateOption)
This member supports the internal infrastructure and is not intended to be used directly from your code.
public static IDataStore CreateProviderFromConnection(IDbConnection connection, AutoCreateOption autoCreateOption)
Parameters
connection
IDbConnectionautoCreateOption
AutoCreateOption
Returns
- IDataStore
CreateProviderFromString(string, AutoCreateOption, out IDisposable[])
This member supports the internal infrastructure and is not intended to be used directly from your code.
public static IDataStore CreateProviderFromString(string connectionString, AutoCreateOption autoCreateOption, out IDisposable[] objectsToDisposeOnDisconnect)
Parameters
connectionString
stringautoCreateOption
AutoCreateOptionobjectsToDisposeOnDisconnect
IDisposable[]
Returns
- IDataStore
CreateSchemaComparer()
protected override DBSchemaComparerSql CreateSchemaComparer()
Returns
- DBSchemaComparerSql
CreateTable(DBTable)
This member supports the internal infrastructure and is not intended to be used directly from your code.
public override void CreateTable(DBTable table)
Parameters
table
DBTable
FormatBinary(BinaryOperatorType, string, string)
This member supports the internal infrastructure and is not intended to be used directly from your code.
public override string FormatBinary(BinaryOperatorType operatorType, string leftOperand, string rightOperand)
Parameters
Returns
FormatColumn(string)
This member supports the internal infrastructure and is not intended to be used directly from your code.
public override string FormatColumn(string columnName)
Parameters
columnName
string
Returns
FormatColumn(string, string)
This member supports the internal infrastructure and is not intended to be used directly from your code.
public override string FormatColumn(string columnName, string tableAlias)
Parameters
Returns
FormatConstant(object)
protected string FormatConstant(object value)
Parameters
value
object
Returns
FormatConstraint(string)
This member supports the internal infrastructure and is not intended to be used directly from your code.
public override string FormatConstraint(string constraintName)
Parameters
constraintName
string
Returns
FormatDelete(string, string)
This member supports the internal infrastructure and is not intended to be used directly from your code.
public override string FormatDelete(string tableName, string whereClause)
Parameters
Returns
FormatFunction(FunctionOperatorType, params string[])
This member supports the internal infrastructure and is not intended to be used directly from your code.
public override string FormatFunction(FunctionOperatorType operatorType, params string[] operands)
Parameters
operatorType
FunctionOperatorTypeoperands
string[]
Returns
FormatFunction(ProcessParameter, FunctionOperatorType, params object[])
This member supports the internal infrastructure and is not intended to be used directly from your code.
public override string FormatFunction(ProcessParameter processParameter, FunctionOperatorType operatorType, params object[] operands)
Parameters
processParameter
ProcessParameteroperatorType
FunctionOperatorTypeoperands
object[]
Returns
FormatInsert(string, string, string)
This member supports the internal infrastructure and is not intended to be used directly from your code.
public override string FormatInsert(string tableName, string fields, string values)
Parameters
Returns
FormatInsertDefaultValues(string)
This member supports the internal infrastructure and is not intended to be used directly from your code.
public override string FormatInsertDefaultValues(string tableName)
Parameters
tableName
string
Returns
FormatOrder(string, SortingDirection)
This member supports the internal infrastructure and is not intended to be used directly from your code.
public override string FormatOrder(string sortProperty, SortingDirection direction)
Parameters
sortProperty
stringdirection
SortingDirection
Returns
FormatOuterApply(string, string)
public override string FormatOuterApply(string sql, string alias)
Parameters
Returns
FormatSelect(string, string, string, string, string, string, int, int)
This member supports the internal infrastructure and is not intended to be used directly from your code.
public override string FormatSelect(string selectedPropertiesSql, string fromSql, string whereSql, string orderBySql, string groupBySql, string havingSql, int skipSelectedRecords, int topSelectedRecords)
Parameters
selectedPropertiesSql
stringfromSql
stringwhereSql
stringorderBySql
stringgroupBySql
stringhavingSql
stringskipSelectedRecords
inttopSelectedRecords
int
Returns
FormatString(object)
protected string FormatString(object value)
Parameters
value
object
Returns
FormatTable(string, string)
This member supports the internal infrastructure and is not intended to be used directly from your code.
public override string FormatTable(string schema, string tableName)
Parameters
Returns
FormatTable(string, string, string)
This member supports the internal infrastructure and is not intended to be used directly from your code.
public override string FormatTable(string schema, string tableName, string tableAlias)
Parameters
Returns
FormatUpdate(string, string, string)
This member supports the internal infrastructure and is not intended to be used directly from your code.
public override string FormatUpdate(string tableName, string sets, string whereClause)
Parameters
Returns
GetConnectionString(string, int, string, string, string)
Returns a connection string used to open a specified PostgreSQL database using provided login credentials.
public static string GetConnectionString(string server, int port, string userId, string password, string database)
Parameters
server
stringA string that specifies the server’s name.
port
intAn integer that specifies the server’s port number.
userId
stringA string that specifies a password.
password
stringA string that specifies the database name.
database
stringA string that specifies the database’s character set.
Returns
- string
A connection string.
GetConnectionString(string, string, string, string)
Returns a connection string used to open a specified PostgreSQL database using provided login credentials.
public static string GetConnectionString(string server, string userId, string password, string database)
Parameters
server
stringA string that specifies the server’s name.
userId
stringA string that specifies a user name.
password
stringA string that specifies a password.
database
stringA string that specifies the database name.
Returns
- string
A connection string.
GetIdentity(InsertStatement, TaggedParametersHolder)
protected override long GetIdentity(InsertStatement root, TaggedParametersHolder identitiesByTag)
Parameters
root
InsertStatementidentitiesByTag
TaggedParametersHolder
Returns
GetIdentityAsync(InsertStatement, TaggedParametersHolder, AsyncOperationIdentifier, CancellationToken)
protected override Task<long> GetIdentityAsync(InsertStatement root, TaggedParametersHolder identitiesByTag, AsyncOperationIdentifier asyncOperationId, CancellationToken cancellationToken)
Parameters
root
InsertStatementidentitiesByTag
TaggedParametersHolderasyncOperationId
AsyncOperationIdentifiercancellationToken
CancellationToken
Returns
GetObjectNameEffectiveLength(string)
protected override int GetObjectNameEffectiveLength(string objectName)
Parameters
objectName
string
Returns
GetParameterName(OperandValue, int, ref bool)
This member supports the .NET Framework infrastructure and cannot be used directly from your code.
public override string GetParameterName(OperandValue parameter, int index, ref bool createParameter)
Parameters
Returns
GetSafeNameTableMaxLength()
protected override int GetSafeNameTableMaxLength()
Returns
GetSeqName(string, string)
protected virtual string GetSeqName(string tableName, string columnName)
Parameters
Returns
GetSqlCreateColumnFullAttributes(DBTable, DBColumn)
This member supports the .NET Framework infrastructure and cannot be used directly from your code.
public override string GetSqlCreateColumnFullAttributes(DBTable table, DBColumn column)
Parameters
table
DBTablecolumn
DBColumn
Returns
GetSqlCreateColumnFullAttributes(DBTable, DBColumn, bool)
This member supports the .NET Framework infrastructure and cannot be used directly from your code.
public override string GetSqlCreateColumnFullAttributes(DBTable table, DBColumn column, bool forTableCreate)
Parameters
table
DBTablecolumn
DBColumnforTableCreate
bool
Returns
GetSqlCreateColumnTypeForBoolean(DBTable, DBColumn)
protected override string GetSqlCreateColumnTypeForBoolean(DBTable table, DBColumn column)
Parameters
table
DBTablecolumn
DBColumn
Returns
GetSqlCreateColumnTypeForByte(DBTable, DBColumn)
protected override string GetSqlCreateColumnTypeForByte(DBTable table, DBColumn column)
Parameters
table
DBTablecolumn
DBColumn
Returns
GetSqlCreateColumnTypeForByteArray(DBTable, DBColumn)
protected override string GetSqlCreateColumnTypeForByteArray(DBTable table, DBColumn column)
Parameters
table
DBTablecolumn
DBColumn
Returns
GetSqlCreateColumnTypeForChar(DBTable, DBColumn)
protected override string GetSqlCreateColumnTypeForChar(DBTable table, DBColumn column)
Parameters
table
DBTablecolumn
DBColumn
Returns
GetSqlCreateColumnTypeForDateTime(DBTable, DBColumn)
protected override string GetSqlCreateColumnTypeForDateTime(DBTable table, DBColumn column)
Parameters
table
DBTablecolumn
DBColumn
Returns
GetSqlCreateColumnTypeForDecimal(DBTable, DBColumn)
protected override string GetSqlCreateColumnTypeForDecimal(DBTable table, DBColumn column)
Parameters
table
DBTablecolumn
DBColumn
Returns
GetSqlCreateColumnTypeForDouble(DBTable, DBColumn)
protected override string GetSqlCreateColumnTypeForDouble(DBTable table, DBColumn column)
Parameters
table
DBTablecolumn
DBColumn
Returns
GetSqlCreateColumnTypeForGuid(DBTable, DBColumn)
protected override string GetSqlCreateColumnTypeForGuid(DBTable table, DBColumn column)
Parameters
table
DBTablecolumn
DBColumn
Returns
GetSqlCreateColumnTypeForInt16(DBTable, DBColumn)
protected override string GetSqlCreateColumnTypeForInt16(DBTable table, DBColumn column)
Parameters
table
DBTablecolumn
DBColumn
Returns
GetSqlCreateColumnTypeForInt32(DBTable, DBColumn)
protected override string GetSqlCreateColumnTypeForInt32(DBTable table, DBColumn column)
Parameters
table
DBTablecolumn
DBColumn
Returns
GetSqlCreateColumnTypeForInt64(DBTable, DBColumn)
protected override string GetSqlCreateColumnTypeForInt64(DBTable table, DBColumn column)
Parameters
table
DBTablecolumn
DBColumn
Returns
GetSqlCreateColumnTypeForSByte(DBTable, DBColumn)
protected override string GetSqlCreateColumnTypeForSByte(DBTable table, DBColumn column)
Parameters
table
DBTablecolumn
DBColumn
Returns
GetSqlCreateColumnTypeForSingle(DBTable, DBColumn)
protected override string GetSqlCreateColumnTypeForSingle(DBTable table, DBColumn column)
Parameters
table
DBTablecolumn
DBColumn
Returns
GetSqlCreateColumnTypeForString(DBTable, DBColumn)
protected override string GetSqlCreateColumnTypeForString(DBTable table, DBColumn column)
Parameters
table
DBTablecolumn
DBColumn
Returns
GetSqlCreateColumnTypeForUInt16(DBTable, DBColumn)
protected override string GetSqlCreateColumnTypeForUInt16(DBTable table, DBColumn column)
Parameters
table
DBTablecolumn
DBColumn
Returns
GetSqlCreateColumnTypeForUInt32(DBTable, DBColumn)
protected override string GetSqlCreateColumnTypeForUInt32(DBTable table, DBColumn column)
Parameters
table
DBTablecolumn
DBColumn
Returns
GetSqlCreateColumnTypeForUInt64(DBTable, DBColumn)
protected override string GetSqlCreateColumnTypeForUInt64(DBTable table, DBColumn column)
Parameters
table
DBTablecolumn
DBColumn
Returns
GetStorageTablesList(bool)
Returns a list of the available tables in the data store.
public override string[] GetStorageTablesList(bool includeViews)
Parameters
includeViews
booltrue, to include available database views in the resulting array; otherwise, false.
Returns
- string[]
An array of the table names in the data store.
GetStoredProcedures()
This member supports the internal infrastructure and is not intended to be used directly from your code.
public override DBStoredProcedure[] GetStoredProcedures()
Returns
- DBStoredProcedure[]
GetTableSchema(DBTable, bool, bool)
This member supports the internal infrastructure and is not intended to be used directly from your code.
public override void GetTableSchema(DBTable table, bool checkIndexes, bool checkForeignKeys)
Parameters
PreparePooledCommand(IDbCommand)
protected override void PreparePooledCommand(IDbCommand command)
Parameters
command
IDbCommand
ProcessClearDatabase()
protected override void ProcessClearDatabase()
Register()
Registers the provider for use with XPO.
public static void Register()
SetServerVersion(string)
This member supports the internal infrastructure and is not intended to be used directly from your code.
public void SetServerVersion(string versionString)
Parameters
versionString
string
WrapException(Exception, IDbCommand)
protected override Exception WrapException(Exception e, IDbCommand query)
Parameters
e
Exceptionquery
IDbCommand