Search Results for

    Show / Hide Table of Contents

    Class NpgsqlDataSource

    Inheritance
    object
    DbDataSource
    NpgsqlDataSource
    NpgsqlMultiHostDataSource
    Implements
    IAsyncDisposable
    Inherited Members
    DbDataSource.Dispose()
    DbDataSource.DisposeAsync()
    Namespace: Npgsql
    Assembly: Npgsql.dll
    Syntax
    public abstract class NpgsqlDataSource : DbDataSource, 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()

    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(bool)

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

    DisposeAsyncBase()

    Declaration
    protected virtual ValueTask DisposeAsyncBase()
    Returns
    Type Description
    ValueTask
    | Improve this Doc View Source

    DisposeAsyncCore()

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

    DisposeBase()

    Declaration
    protected virtual void DisposeBase()
    | Improve this Doc View Source

    OpenConnection()

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

    OpenConnectionAsync(CancellationToken)

    Declaration
    public ValueTask<NpgsqlConnection> OpenConnectionAsync(CancellationToken cancellationToken = null)
    Parameters
    Type Name Description
    CancellationToken cancellationToken
    Returns
    Type Description
    ValueTask<><NpgsqlConnection>
    | Improve this Doc View Source

    OpenDbConnection()

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

    OpenDbConnectionAsync(CancellationToken)

    Declaration
    protected override ValueTask<DbConnection> OpenDbConnectionAsync(CancellationToken cancellationToken = null)
    Parameters
    Type Name Description
    CancellationToken cancellationToken
    Returns
    Type Description
    ValueTask<><DbConnection>
    Overrides
    DbDataSource.OpenDbConnectionAsync(CancellationToken)

    Implements

    IAsyncDisposable

    Extension Methods

    CrsMapExtensions.GetCrsMap(NpgsqlDataSource)
    CrsMapExtensions.GetCrsMapAsync(NpgsqlDataSource)
    • Improve this Doc
    • View Source
    In This Article
    Back to top © Copyright 2023 The Npgsql Development Team