# Class NpgsqlRelationalConnection

Namespace
  Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal

Assembly
  Npgsql.EntityFrameworkCore.PostgreSQL.dll

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

    public class NpgsqlRelationalConnection : RelationalConnection, ITransactionEnlistmentManager, INpgsqlRelationalConnection, IRelationalConnection, IRelationalTransactionManager, IDbContextTransactionManager, IResettableService, IDisposable, IAsyncDisposable

Inheritance
  object
  RelationalConnection
  NpgsqlRelationalConnection

Implements
  ITransactionEnlistmentManager
  INpgsqlRelationalConnection
  IRelationalConnection
  IRelationalTransactionManager
  IDbContextTransactionManager
  IResettableService
  IDisposable
  IAsyncDisposable

Inherited Members
  RelationalConnection.GetValidatedConnectionString()
  RelationalConnection.SetDbConnection(DbConnection, bool)
  RelationalConnection.EnlistTransaction(Transaction)
  RelationalConnection.ConnectionEnlistTransaction(Transaction)
  RelationalConnection.RentCommand()
  RelationalConnection.ReturnCommand(IRelationalCommand)
  RelationalConnection.BeginTransaction()
  RelationalConnection.BeginTransactionAsync(CancellationToken)
  RelationalConnection.BeginTransaction(IsolationLevel)
  RelationalConnection.ConnectionBeginTransaction(IsolationLevel)
  RelationalConnection.BeginTransactionAsync(IsolationLevel, CancellationToken)
  RelationalConnection.ConnectionBeginTransactionAsync(IsolationLevel, CancellationToken)
  RelationalConnection.UseTransaction(DbTransaction)
  RelationalConnection.UseTransaction(DbTransaction, Guid)
  RelationalConnection.UseTransactionAsync(DbTransaction, CancellationToken)
  RelationalConnection.UseTransactionAsync(DbTransaction, Guid, CancellationToken)
  RelationalConnection.CommitTransaction()
  RelationalConnection.CommitTransactionAsync(CancellationToken)
  RelationalConnection.RollbackTransaction()
  RelationalConnection.RollbackTransactionAsync(CancellationToken)
  RelationalConnection.Open(bool)
  RelationalConnection.OpenAsync(CancellationToken, bool)
  RelationalConnection.OpenDbConnection(bool)
  RelationalConnection.OpenDbConnectionAsync(bool, CancellationToken)
  RelationalConnection.Close()
  RelationalConnection.CloseDbConnection()
  RelationalConnection.CloseAsync()
  RelationalConnection.CloseDbConnectionAsync()
  RelationalConnection.Dispose()
  RelationalConnection.DisposeAsync()
  RelationalConnection.ResetState(bool)
  RelationalConnection.ResetStateAsync(bool)
  RelationalConnection.DisposeDbConnection()
  RelationalConnection.DisposeDbConnectionAsync()
  RelationalConnection.ConnectionId
  RelationalConnection.Context
  RelationalConnection.Dependencies
  RelationalConnection.CurrentTransaction
  RelationalConnection.EnlistedTransaction
  RelationalConnection.CommandTimeout
  object.Equals(object)
  object.Equals(object, object)
  object.GetHashCode()
  object.GetType()
  object.MemberwiseClone()
  object.ReferenceEquals(object, object)
  object.ToString()

## Constructors

### NpgsqlRelationalConnection(RelationalConnectionDependencies, NpgsqlDataSourceManager, IDbContextOptions)

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

    public NpgsqlRelationalConnection(RelationalConnectionDependencies dependencies, NpgsqlDataSourceManager dataSourceManager, IDbContextOptions options)

#### Parameters

`dependencies` RelationalConnectionDependencies
`dataSourceManager` NpgsqlDataSourceManager
`options` IDbContextOptions

### NpgsqlRelationalConnection(RelationalConnectionDependencies, DbDataSource?)

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

    protected NpgsqlRelationalConnection(RelationalConnectionDependencies dependencies, DbDataSource? dataSource)

#### Parameters

`dependencies` RelationalConnectionDependencies
`dataSource` DbDataSource

## Properties

### ConnectionString

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

    public override string? ConnectionString { get; set; }

#### Property Value

string

### CurrentAmbientTransaction

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

    public override Transaction? CurrentAmbientTransaction { get; }

#### Property Value

Transaction

### DataSource

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

    public DbDataSource? DataSource { get; }

#### Property Value

DbDataSource

### DbConnection

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

    [AllowNull]
    public virtual NpgsqlConnection DbConnection { get; set; }

#### Property Value

NpgsqlConnection

### DbDataSource

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

    public virtual DbDataSource? DbDataSource { get; set; }

#### Property Value

DbDataSource

### SupportsAmbientTransactions

Indicates whether the store connection supports ambient transactions

    protected override bool SupportsAmbientTransactions { get; }

#### Property Value

bool

## Methods

### CloneWith(string, bool, CancellationToken)

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

    public virtual ValueTask<INpgsqlRelationalConnection> CloneWith(string connectionString, bool async, CancellationToken cancellationToken = default)

#### Parameters

`connectionString` string
`async` bool
`cancellationToken` CancellationToken

#### Returns

ValueTask<INpgsqlRelationalConnection>

### CreateAdminConnection()

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

    public virtual INpgsqlRelationalConnection CreateAdminConnection()

#### Returns

INpgsqlRelationalConnection

### CreateDbConnection()

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

    protected override DbConnection CreateDbConnection()

#### Returns

DbConnection