Skip to main content
Published
May 21, 2024
2y ago
Total Downloads
1.4M
1,439,841

Install

dotnet add package Apache.Arrow.Adbc.Client --version 0.12.0
ProductVersions
.NET
net6.0
.NET Standard
netstandard2.0

README

Client

The Client library provides an ADO.NET client over the the top of results from the ExecuteQuery and ExecuteUpdate calls in the AdbcStatement class.

Library Design

The Client is designed to work with any driver that inherits from AdbcDriver, whether they are written in a .NET language or a C-compatible language that can be loaded via Interop. The driver is injected at runtime during the creation of the Adbc.Client.AdbcConnection, seen here:

Dependency Injection Model

This enables the client to work with multiple ADBC drivers in the same fashion. When a new client AdbcConnection is created, the driver is just passed in as part of the constructor, like:

new Adbc.Client.AdbcConnection()
{
   new DriverA(),
   ...
}

new Adbc.Client.AdbcConnection()
{
   new DriverB(),
   ...
}

Since ADO.NET is row-oriented, and ADBC is column-oriented, the row index is tracked through the Read() call. When the end of the current record batch is reached, the Client library calls the ReadNextRecordBatchAsync method on the QueryResult until no more record batches can be obtained.

This can be thought of as:

Arrow to DbDataReader

Connection Properties

The ADO.NET Client is designed so that properties in the connection string map to the properties that are sent to the ADBC driver in the code:

AdbcDriver.Open(adbcConnectionParameters);

The connection string is parsed using the DbConnectionStringBuilder class and the key/value pairs are then added to the properties for the ADBC driver.

For example, when using the Snowflake ADBC Go Driver, the connection string will look similar to:

 adbc.snowflake.sql.account={account};adbc.snowflake.sql.warehouse={warehouse};username={user};password={password}

if using the default user name and password authentication, but look like

 adbc.snowflake.sql.account={account};adbc.snowflake.sql.warehouse={warehouse};username={user};password={password};adbc.snowflake.sql.auth_type=snowflake_jwt;adbc.snowflake.sql.client_option.jwt_private_key={private_key_file}

when using JWT authentication with an unencrypted key file.

Other ADBC drivers will have different connection parameters, so be sure to check the documentation for each driver.

Changes from Previous Version

No structural changes between v0.11.0 and v0.12.0.

Adoption Assessment

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

No SPDX license expression is published. Review the license text and your organisation's policy before redistribution.Compatibility metadata lists 2 target frameworks; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.