Alpha.Google.Cloud.Spanner.DataProvider
1.0.0-alpha.20260123102444
dotnet add package Alpha.Google.Cloud.Spanner.DataProvider --version 1.0.0-alpha.20260123102444
NuGet\Install-Package Alpha.Google.Cloud.Spanner.DataProvider -Version 1.0.0-alpha.20260123102444
<PackageReference Include="Alpha.Google.Cloud.Spanner.DataProvider" Version="1.0.0-alpha.20260123102444" />
<PackageVersion Include="Alpha.Google.Cloud.Spanner.DataProvider" Version="1.0.0-alpha.20260123102444" />
<PackageReference Include="Alpha.Google.Cloud.Spanner.DataProvider" />
paket add Alpha.Google.Cloud.Spanner.DataProvider --version 1.0.0-alpha.20260123102444
#r "nuget: Alpha.Google.Cloud.Spanner.DataProvider, 1.0.0-alpha.20260123102444"
#:package Alpha.Google.Cloud.Spanner.DataProvider@1.0.0-alpha.20260123102444
#addin nuget:?package=Alpha.Google.Cloud.Spanner.DataProvider&version=1.0.0-alpha.20260123102444&prerelease
#tool nuget:?package=Alpha.Google.Cloud.Spanner.DataProvider&version=1.0.0-alpha.20260123102444&prerelease
Spanner ADO.NET Data Provider
ALPHA: This library is still in development. It is not yet ready for production use.
ADO.NET Data Provider for Spanner. This library implements the standard ADO.NET interfaces and classes and exposes an API that is similar to ADO.NET data providers for other relational database systems.
Supported Platforms
This driver uses a native library for communication with Spanner. This library supports the following operating systems and architectures:
- linux-x64
- linux-arm64
- osx-arm64
- win-x64
Usage
Create a connection string using a SpannerConnectionStringBuilder:
var builder = new SpannerConnectionStringBuilder
{
Project = "my-project",
Instance = "my-instance",
Database = "my-database",
DefaultIsolationLevel = IsolationLevel.ReadCommitted,
};
await using var connection = new SpannerConnection(builder.ConnectionString);
await connection.OpenAsync();
await using var command = connection.CreateCommand();
command.CommandText = "SELECT 'Hello World' as Message";
await using var reader = await command.ExecuteReaderAsync();
while (await reader.ReadAsync())
{
Console.WriteLine($"Greeting from Spanner: {reader.GetString(0)}");
}
Emulator
The driver can also connect to the Spanner Emulator. The easiest way to do this is to set the AutoConfigEmulator
property to true. This instructs the driver to connect to the Emulator on localhost:9010 and to automatically
create the Spanner instance and database in the connection string if these do not already exist.
var builder = new SpannerConnectionStringBuilder
{
Project = "my-project",
Instance = "my-instance",
Database = "my-database",
DefaultIsolationLevel = IsolationLevel.ReadCommitted,
// Setting AutoConfigEmulator=true instructs the driver to connect to the Spanner emulator on 'localhost:9010',
// and to create the instance and database on the emulator if these do not already exist.
AutoConfigEmulator = true,
};
await using var connection = new SpannerConnection(builder.ConnectionString);
await connection.OpenAsync();
await using var command = connection.CreateCommand();
command.CommandText = "SELECT 'Hello World' as Message";
await using var reader = await command.ExecuteReaderAsync();
while (await reader.ReadAsync())
{
Console.WriteLine($"Greeting from Spanner: {reader.GetString(0)}");
}
Examples
See the spanner-ado-net-samples project for ready-to-run examples for how to use various Spanner features with this driver.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Google.Cloud.Spanner.V1 (>= 5.12.0)
- Grpc.Net.Client (>= 2.76.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0-alpha.20260123102444 | 54 | 1/23/2026 |
| 1.0.0-alpha.20260123101735 | 46 | 1/23/2026 |
| 1.0.0-alpha.20260123101030 | 53 | 1/23/2026 |
| 1.0.0-alpha.20251217172149 | 253 | 12/17/2025 |
| 1.0.0-alpha.20251216092833 | 232 | 12/16/2025 |
| 1.0.0-alpha.20251209081138 | 414 | 12/9/2025 |
| 1.0.0-alpha.20251207191847 | 289 | 12/7/2025 |
| 1.0.0-alpha.20251207184911 | 271 | 12/7/2025 |
| 1.0.0-alpha.20251207162533 | 189 | 12/7/2025 |
| 1.0.0-alpha.20251207122112 | 189 | 12/7/2025 |
| 1.0.0-alpha.20251205155619 | 177 | 12/5/2025 |
| 1.0.0-alpha.20251205144904 | 149 | 12/5/2025 |
| 1.0.0-alpha.20251205141154 | 151 | 12/5/2025 |
| 1.0.0-alpha.20251204111803 | 177 | 12/4/2025 |
| 1.0.0-alpha.20251204100036 | 169 | 12/4/2025 |
| 1.0.0-alpha.20251203163647 | 633 | 12/3/2025 |
| 1.0.0-alpha.20251202132913 | 654 | 12/2/2025 |
| 1.0.0-alpha.20251201193156 | 644 | 12/1/2025 |
| 1.0.0-alpha.20251201122031 | 558 | 12/1/2025 |
| 1.0.0-alpha.20251003170157 | 139 | 10/3/2025 |