Locate the main entry points in the Couchbase .NET SDK
masterCouchbase namespace. For applications using dependency injection, look for support in the Couchbase.Extensions.DependencyInjection namespace.repository·master·Indexed 43 days ago
https://github.com/couchbase/couchbase-net-clientThe official Couchbase .NET SDK provides high-performance access to Couchbase Server from .NET applications, supporting core features such as Key-Value, Query, and Search. It is available via the CouchbaseNetClient NuGet package and includes built-in instrumentation for .NET metrics and OpenTelemetry tracing.
Couchbase namespace. For applications using dependency injection, look for support in the Couchbase.Extensions.DependencyInjection namespace.When designing .proto files, avoid import cycles to ensure compatibility with the Go compiler. A cycle occurs when a top-level package is imported by a sub-package that is itself part of the same hierarchy.
Example of a breaking cycle:
// a.proto
package protocol;
import "c.proto";
// b.proto
package protocol;
// c.proto
package protocol.sdk;
import "b.proto";In this scenario, c.proto imports from the top-level protocol package again, which Go identifies as an import cycle.
a.proto:
package protocol;
import "c.proto";
b.proto:
package protocol;
c.proto:
package protocol.sdk;
import "b.proto";The FIT GRPC implementation follows specific packaging conventions to ensure compatibility across different languages (Go, Java, C#) and to avoid import cycles.
Naming Conventions:
sdk.kv.options.proto belongs to package protocol.sdk.kv).sdk.cluster.query.index_manager identifies an index_manager that is a query type at the cluster level.protocol.shared package for code shared between the SDK and transactions.sdk.kv.Get instead of sdk.kv.SdkKvGet. (Exception: transactions.TransactionResult remains as-is for backward compatibility).Package Mapping Example:
To maintain a one-to-one mapping between GRPC packages and generated language packages, use options within the .proto file:
package protocol.sdk.kv;
option csharp_namespace = "Couchbase.Grpc.Protocol.Sdk.Kv";
option java_package = "com.couchbase.client.performer.protocol.sdk.kv";Performers in the FIT (Functional Integration Testing) framework are designed to be 'dumb-as-rocks passthrough agents'. They should not interpret or manipulate data, but rather act as a transparent bridge between the test environment and the SDK.
Key Implementation Rules:
couchbase:// to connection strings) as this can mask SDK bugs or cause driver issues.UNSUPPORTED. This includes the default behavior for any oneof handling.optional. If a configuration block is not provided, the performer should call the appropriate no-option overload in the SDK (e.g., use cluster.query(statement) instead of cluster.query(statement, options)).The SDK uses three standard .NET metric types to represent different kinds of data:
You can find the official Couchbase .NET SDK source code on GitHub and comprehensive usage documentation on the Couchbase website to help you build applications with Microsoft Core and Standard.
https://www.nuget.org/packages/CouchbaseNetClient/
https://github.com/couchbase/couchbase-net-client
https://www.couchbase.com/products/developer-sdk/dotnetThe Couchbase .NET SDK provides instrumentation via .NET metrics. You can collect these metrics using several methods:
The Couchbase .NET SDK is available as a NuGet package for building applications using Microsoft Core and Standard on Windows, Linux, and MacOS. You can install it directly from NuGet to integrate it into your .NET projects.
# Use the NuGet CLI to install the package
dotnet add package CouchbaseNetClientThe Couchbase.Stellar.CodeGen project generates gRPC stubs and proxies using protos from the protostellar repository.
Note for most developers: This project is intended for internal use. For general development, you do not need to run this; the generated stubs and proxies are already committed to the Couchbase.Stellar project within the couchbase-net-client repository.
To manually trigger code generation, you must ensure the protostellar repository is located in a directory adjacent to the couchbase-net-client repository so that MSBuild can locate the protos.
- couchbase-net-client (cloned repo)
- ..
- src
- ..
- Couchbase.Stellar.CodeGen
- ..
- ..
- protostellar (cloned repo)To use the code generation tool, follow these steps:
mkdir repos
cd repos
git clone git@github.com:couchbase/couchbase-net-client.git
git clone git@github.com:couchbase/protostellar.gitCouchbase.Stellar.CodeGen project build is disabled by default in the solution build configuration. You must enable it for code generation to occur during a solution build.dotnet build directly within the Couchbase.Stellar.CodeGen folder.obj/Debug/net6.0 directory within Couchbase.Stellar.CodeGen.CodeGen directory of the Couchbase.Stellar project. These files are committed to the repository and should only be updated when the protos change.$ mkdir repos
$ cd repos
$ git clone git@github.com:couchbase/couchbase-net-client.git
$ git clone git@github.com:couchbase/protostellar.git
# Alternatively, run build directly in the folder
$ dotnet buildIntegration tests in Couchbase.IntegrationTests run against a real Couchbase Server. Requirements vary by server version.
beer-sample and travel-sample via the Couchbase Console (Settings -> Sample Buckets).default: No password.authenticated: Password set to secret.memcached: No password.default, authenticated, beer-sample, and travel-sample (e.g., CREATE PRIMARY INDEX ON default`;).travel-sample bucket named idx-travel.config.json: Set the Couchbase Server IP hostname and set enhancedAuth to false.app.config: Set the hostname and the basic Couchbase client section with the Couchbase Server IP.ephemeral bucket.config.json to set enhancedAuth to true.authenticated with the password secret (Note: 5.0+ uses Role-Based Access Control).