![]() |
VOOZH | about |
dotnet add package MVFC.Aspire.Helpers.GcpSpanner --version 9.0.3
NuGet\Install-Package MVFC.Aspire.Helpers.GcpSpanner -Version 9.0.3
<PackageReference Include="MVFC.Aspire.Helpers.GcpSpanner" Version="9.0.3" />
<PackageVersion Include="MVFC.Aspire.Helpers.GcpSpanner" Version="9.0.3" />Directory.Packages.props
<PackageReference Include="MVFC.Aspire.Helpers.GcpSpanner" />Project file
paket add MVFC.Aspire.Helpers.GcpSpanner --version 9.0.3
#r "nuget: MVFC.Aspire.Helpers.GcpSpanner, 9.0.3"
#:package MVFC.Aspire.Helpers.GcpSpanner@9.0.3
#addin nuget:?package=MVFC.Aspire.Helpers.GcpSpanner&version=9.0.3Install as a Cake Addin
#tool nuget:?package=MVFC.Aspire.Helpers.GcpSpanner&version=9.0.3Install as a Cake Tool
🇧🇷
👁 CI
👁 codecov
👁 Platform
👁 NuGet Version
👁 NuGet Downloads
Helpers for integrating with Google Cloud Spanner in .NET Aspire projects, including support for the emulator.
Working with Google Cloud Spanner locally usually means:
With .NET Aspire you can define containers, but you still need to:
MVFC.Aspire.Helpers.GcpSpanner provides:
AddGcpSpanner(...) to start the emulator.WithSpannerConfigs(...) to describe instances, databases, and execute DDLs in code.WithReference(...) to wire projects to the emulator and inject connection configurations automatically.This project facilitates the configuration and integration of Google Cloud Spanner in distributed .NET Aspire applications, providing extension methods to:
gcr.io/cloud-spanner-emulator/emulator (Default in Aspire helper)dotnet add package MVFC.Aspire.Helpers.GcpSpanner
using Aspire.Hosting;
using MVFC.Aspire.Helpers.GcpSpanner;
using MVFC.Aspire.Helpers.GcpSpanner.Models;
var builder = DistributedApplication.CreateBuilder(args);
var spannerConfig = new SpannerConfig(
ProjectId: "test-project",
InstanceId: "dev-instance",
DatabaseId: "dev-db",
DdlStatements:
[
"""
CREATE TABLE Users (
UserId STRING(36) NOT NULL,
Name STRING(256) NOT NULL,
CreatedAt TIMESTAMP NOT NULL OPTIONS (allow_commit_timestamp=true)
) PRIMARY KEY (UserId)
"""
]);
var spanner = builder.AddGcpSpanner("gcp-spanner")
.WithSpannerConfigs(spannerConfig)
.WithWaitTimeout(30);
builder.AddProject<Projects.MVFC_Aspire_Helpers_Playground_Api>("api-example")
.WithReference(spanner)
.WaitFor(spanner);
await builder.Build().RunAsync();
SpannerConfig| Parameter | Type | Default | Description |
|---|---|---|---|
ProjectId |
string | — | GCP project ID. |
InstanceId |
string | — | Instance ID. |
DatabaseId |
string | — | Database ID. |
DdlStatements |
IReadOnlyList<string>? |
null |
Check DDL statements to run after DB creation. |
9010sequenceDiagram
participant Aspire as .NET Aspire
participant Container as Spanner Emulator Container
participant Configurator as Config Processor
Aspire->>Container: Start container (gcr.io/cloud-spanner-emulator/emulator)
Container-->>Aspire: Ready (gRPC port 9010 available)
Aspire->>Configurator: Trigger OnResourceReady
Configurator->>Container: Check/Create Instance
Configurator->>Container: Check/Create Database
Configurator->>Container: Execute DDLs
Configurator-->>Aspire: Provisioning Completed
Aspire->>App: Start App with SPANNER_EMULATOR_HOST
AddGcpSpanner – adds the emulator container.WithSpannerConfigs – configures instances, databases, and DDL scripts.WithWaitTimeout – sets emulator startup delay timeout.WithReference – wires projects to the emulator and sets the SPANNER_EMULATOR_HOST environment variable automatically.Apache-2.0
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 9.0.3 | 109 | 4/12/2026 |
| 9.0.2 | 96 | 4/12/2026 |
| 9.0.1 | 105 | 4/12/2026 |
| 9.0.0 | 114 | 4/12/2026 |
| 8.0.2 | 108 | 4/11/2026 |
| 8.0.1 | 119 | 4/3/2026 |
| 8.0.0 | 101 | 4/2/2026 |
| 7.3.3 | 104 | 3/31/2026 |
| 7.3.2 | 102 | 3/30/2026 |
| 7.3.1 | 101 | 3/30/2026 |
| 7.3.0 | 111 | 3/30/2026 |
| 7.2.2 | 108 | 3/29/2026 |
| 7.2.1 | 104 | 3/29/2026 |
| 7.2.0 | 110 | 3/29/2026 |
| 7.1.0 | 105 | 3/22/2026 |