# Class NpgsqlConnector

Namespace
  Npgsql.Internal

Assembly
  Npgsql.dll

Represents a connection to a PostgreSQL backend. Unlike NpgsqlConnection objects, which are exposed to users, connectors are internal to Npgsql and are recycled by the connection pool.

    [Experimental("NPG9001")]
    public sealed class NpgsqlConnector

Inheritance
  object
  NpgsqlConnector

Inherited Members
  object.Equals(object)
  object.Equals(object, object)
  object.GetHashCode()
  object.GetType()
  object.ReferenceEquals(object, object)
  object.ToString()

## Properties

### DatabaseInfo

Information about PostgreSQL and PostgreSQL-like databases (e.g. type definitions, capabilities...).

    public NpgsqlDatabaseInfo DatabaseInfo { get; }

#### Property Value

NpgsqlDatabaseInfo

### Settings

The parsed connection string.

    public NpgsqlConnectionStringBuilder Settings { get; }

#### Property Value

NpgsqlConnectionStringBuilder

### TextEncoding

    public Encoding TextEncoding { get; }

#### Property Value

Encoding

## Methods

### CreateBatch()

Creates and returns a NpgsqlBatch object associated with the NpgsqlConnector.

    public NpgsqlBatch CreateBatch()

#### Returns

NpgsqlBatch

  A NpgsqlBatch object.

### CreateCommand(string?)

Creates and returns a NpgsqlCommand object associated with the NpgsqlConnector.

    public NpgsqlCommand CreateCommand(string? cmdText = null)

#### Parameters

`cmdText` string

  The text of the query.

#### Returns

NpgsqlCommand

  A NpgsqlCommand object.