Search Results for

    Show / Hide Table of Contents

    Class NpgsqlDataSource

    Inheritance
    Object
    DbDataSource
    NpgsqlDataSource
    NpgsqlMultiHostDataSource
    Implements
    IDisposable
    IAsyncDisposable
    Inherited Members
    DbDataSource.OpenDbConnection()
    DbDataSource.OpenDbConnectionAsync(CancellationToken)
    DbDataSource.Dispose()
    DbDataSource.DisposeAsync()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: Npgsql
    Assembly: Npgsql.dll
    Syntax
    public abstract class NpgsqlDataSource : DbDataSource, IDisposable, IAsyncDisposable

    Properties

    | Improve this Doc View Source

    ConnectionString

    Declaration
    public override string ConnectionString { get; }
    Property Value
    Type Description
    String
    Overrides
    DbDataSource.ConnectionString
    | Improve this Doc View Source

    Password

    Manually sets the password to be used the next time a physical connection is opened. Consider using UsePeriodicPasswordProvider(Func<NpgsqlConnectionStringBuilder, CancellationToken, ValueTask<String>>, TimeSpan, TimeSpan) instead.

    Declaration
    public string Password { set; }
    Property Value
    Type Description
    String

    Methods

    | Improve this Doc View Source

    Create(NpgsqlConnectionStringBuilder)

    Creates a new NpgsqlDataSource for the given connectionStringBuilder.

    Declaration
    public static NpgsqlDataSource Create(NpgsqlConnectionStringBuilder connectionStringBuilder)
    Parameters
    Type Name Description
    NpgsqlConnectionStringBuilder connectionStringBuilder
    Returns
    Type Description
    NpgsqlDataSource
    | Improve this Doc View Source

    Create(String)

    Creates a new NpgsqlDataSource for the given connectionString.

    Declaration
    public static NpgsqlDataSource Create(string connectionString)
    Parameters
    Type Name Description
    String connectionString
    Returns
    Type Description
    NpgsqlDataSource
    | Improve this Doc View Source

    CreateBatch()

    Creates a batch ready for use against this NpgsqlDataSource.

    Declaration
    public NpgsqlBatch CreateBatch()
    Returns
    Type Description
    NpgsqlBatch
    | Improve this Doc View Source

    CreateCommand(String)

    Creates a command ready for use against this NpgsqlDataSource.

    Declaration
    public NpgsqlCommand CreateCommand(string commandText = null)
    Parameters
    Type Name Description
    String commandText

    An optional SQL for the command.

    Returns
    Type Description
    NpgsqlCommand
    | Improve this Doc View Source

    CreateConnection()

    Returns a new, unopened connection from this data source.

    Declaration
    public NpgsqlConnection CreateConnection()
    Returns
    Type Description
    NpgsqlConnection
    | Improve this Doc View Source

    CreateDbBatch()

    Declaration
    protected override DbBatch CreateDbBatch()
    Returns
    Type Description
    DbBatch
    Overrides
    DbDataSource.CreateDbBatch()
    | Improve this Doc View Source

    CreateDbCommand(String)

    Declaration
    protected override DbCommand CreateDbCommand(string commandText = null)
    Parameters
    Type Name Description
    String commandText
    Returns
    Type Description
    DbCommand
    Overrides
    DbDataSource.CreateDbCommand(String)
    | Improve this Doc View Source

    CreateDbConnection()

    Declaration
    protected override DbConnection CreateDbConnection()
    Returns
    Type Description
    DbConnection
    Overrides
    DbDataSource.CreateDbConnection()
    | Improve this Doc View Source

    Dispose(Boolean)

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    Boolean disposing
    Overrides
    DbDataSource.Dispose(Boolean)
    | Improve this Doc View Source

    DisposeAsyncCore()

    Declaration
    protected override ValueTask DisposeAsyncCore()
    Returns
    Type Description
    ValueTask
    Overrides
    DbDataSource.DisposeAsyncCore()
    | Improve this Doc View Source

    OpenConnection()

    Returns a new, opened connection from this data source.

    Declaration
    public NpgsqlConnection OpenConnection()
    Returns
    Type Description
    NpgsqlConnection
    | Improve this Doc View Source

    OpenConnectionAsync(CancellationToken)

    Returns a new, opened connection from this data source.

    Declaration
    public async ValueTask<NpgsqlConnection> OpenConnectionAsync(CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    CancellationToken cancellationToken

    An optional token to cancel the asynchronous operation. The default value is None.

    Returns
    Type Description
    ValueTask<NpgsqlConnection>

    Implements

    System.IDisposable
    System.IAsyncDisposable
    • Improve this Doc
    • View Source
    In This Article
    Back to top © Copyright 2022 The Npgsql Development Team