diff --git a/.github/workflows/spanner-lib-tests.yml b/.github/workflows/spanner-lib-tests.yml
index d39c4785..468cd3d6 100644
--- a/.github/workflows/spanner-lib-tests.yml
+++ b/.github/workflows/spanner-lib-tests.yml
@@ -48,6 +48,11 @@ jobs:
- name: Build shared library
working-directory: spannerlib/shared
run: go build -o spannerlib.so -buildmode=c-shared shared_lib.go
+ - name: Build gRPC server
+ working-directory: spannerlib/grpc-server
+ run: |
+ go build -o grpc_server server.go
+ chmod +x grpc_server
- name: Copy to Java wrapper
working-directory: spannerlib
run: |
@@ -55,12 +60,15 @@ jobs:
if [ "$RUNNER_OS" == "Windows" ]; then
mkdir -p wrappers/spannerlib-java/src/main/resources/win32-x86-64
cp shared/spannerlib.so wrappers/spannerlib-java/src/main/resources/win32-x86-64/spanner.dll
+ cp grpc-server/grpc_server wrappers/spannerlib-java/src/main/resources/win32-x86-64/grpc_server
elif [ "$RUNNER_OS" == "macOS" ]; then
mkdir -p wrappers/spannerlib-java/src/main/resources/darwin-aarch64
cp shared/spannerlib.so wrappers/spannerlib-java/src/main/resources/darwin-aarch64/libspanner.dylib
+ cp grpc-server/grpc_server wrappers/spannerlib-java/src/main/resources/darwin-aarch64/grpc_server
else
mkdir -p wrappers/spannerlib-java/src/main/resources/linux-x86-64
cp shared/spannerlib.so wrappers/spannerlib-java/src/main/resources/linux-x86-64/libspanner.so
+ cp grpc-server/grpc_server wrappers/spannerlib-java/src/main/resources/linux-x86-64/grpc_server
fi
shell: bash
- name: ls spannerlib.so
@@ -71,3 +79,90 @@ jobs:
run: mvn -Djna.debug_load=true test
working-directory: spannerlib/wrappers/spannerlib-java
shell: bash
+
+ dotnet-wrapper:
+ strategy:
+ matrix:
+ go-version: [1.25.x]
+ os: [ubuntu-latest, macos-latest, windows-latest]
+ runs-on: ${{ matrix.os }}
+ steps:
+ - name: Install dotnet
+ uses: actions/setup-dotnet@v4
+ with:
+ dotnet-version: '9.0.x'
+ - name: Install Go
+ uses: actions/setup-go@v5
+ with:
+ go-version: ${{ matrix.go-version }}
+ - name: Checkout code
+ uses: actions/checkout@v4
+ with:
+ submodules: 'true'
+ - name: Build shared library
+ working-directory: spannerlib/shared
+ run: go build -o spannerlib.so -buildmode=c-shared shared_lib.go
+ - name: Copy to .NET wrapper
+ working-directory: spannerlib
+ run: |
+ mkdir -p wrappers/spannerlib-dotnet/spannerlib-dotnet-native/libraries/any
+ if [ "$RUNNER_OS" == "Windows" ]; then
+ cp shared/spannerlib.so wrappers/spannerlib-dotnet/spannerlib-dotnet-native/libraries/any/spannerlib.dll
+ else
+ cp shared/spannerlib.so wrappers/spannerlib-dotnet/spannerlib-dotnet-native/libraries/any/spannerlib
+ fi
+ shell: bash
+ - name: Build .NET native library package
+ run: dotnet pack
+ working-directory: spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-native
+ shell: bash
+ - name: Add .NET package source
+ run: |
+ if [ "$RUNNER_OS" == "Windows" ]; then
+ echo ${GITHUB_WORKSPACE}"\spannerlib\wrappers\spannerlib-dotnet\spannerlib-dotnet-native\bin\Release"
+ dotnet nuget add source ${GITHUB_WORKSPACE}"\spannerlib\wrappers\spannerlib-dotnet\spannerlib-dotnet-native\bin\Release" --name local
+ else
+ dotnet nuget add source "$PWD"/bin/Release --name local
+ fi
+ working-directory: spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-native
+ shell: bash
+ - name: Build gRPC server
+ working-directory: spannerlib/grpc-server
+ run: |
+ go build -o grpc_server server.go
+ chmod +x grpc_server
+ - name: Copy gRPC server to .NET wrapper
+ working-directory: spannerlib
+ run: |
+ mkdir -p wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-server/binaries/any
+ if [ "$RUNNER_OS" == "Windows" ]; then
+ cp grpc-server/grpc_server wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-server/binaries/any/grpc_server.exe
+ else
+ cp grpc-server/grpc_server wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-server/binaries/any/grpc_server
+ fi
+ shell: bash
+ - name: Build .NET gRPC server package
+ run: dotnet pack
+ working-directory: spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-server
+ shell: bash
+ - name: Add .NET package source
+ run: |
+ if [ "$RUNNER_OS" == "Windows" ]; then
+ dotnet nuget add source ${GITHUB_WORKSPACE}"\spannerlib\wrappers\spannerlib-dotnet\spannerlib-dotnet-grpc-server\bin\Release" --name local-grpc-server
+ else
+ dotnet nuget add source "$PWD"/bin/Release --name local-grpc-server
+ fi
+ working-directory: spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-server
+ shell: bash
+ - name: Restore dependencies
+ run: dotnet restore
+ working-directory: spannerlib/wrappers/spannerlib-dotnet
+ shell: bash
+ - name: Build
+ run: dotnet build --no-restore
+ working-directory: spannerlib/wrappers/spannerlib-dotnet
+ shell: bash
+ - name: .NET Unit Tests
+ working-directory: spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-tests
+ run: dotnet test --no-build --verbosity normal
+ shell: bash
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 00000000..4b3a259c
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "spannerlib/grpc-server/googleapis"]
+ path = spannerlib/grpc-server/googleapis
+ url = git@github.com:googleapis/googleapis.git
diff --git a/conn.go b/conn.go
index 31dc2c41..a5c415fc 100644
--- a/conn.go
+++ b/conn.go
@@ -1119,6 +1119,12 @@ func (c *conn) BeginReadOnlyTransaction(ctx context.Context, options *ReadOnlyTr
//
// BeginReadWriteTransaction starts a new read/write transaction on this connection.
func (c *conn) BeginReadWriteTransaction(ctx context.Context, options *ReadWriteTransactionOptions) (driver.Tx, error) {
+ // TODO: Support `set local transaction_tag = 'my_tag'` and similar.
+ // Get the current options of this connection and merge these with the input options.
+ // The input options take precedence over the default options of the connection.
+ execOptions := c.options(false)
+ mergeTransactionOptions(&execOptions.TransactionOptions, &options.TransactionOptions)
+ options.TransactionOptions = execOptions.TransactionOptions
c.withTempTransactionOptions(options)
tx, err := c.BeginTx(ctx, driver.TxOptions{})
if err != nil {
diff --git a/spannerlib/.gitignore b/spannerlib/.gitignore
index f6dbcd3d..5944b517 100644
--- a/spannerlib/.gitignore
+++ b/spannerlib/.gitignore
@@ -1,3 +1,5 @@
spannerlib.h
spannerlib.so
+spannerlib.dll
grpc_server
+grpc_server.exe
diff --git a/spannerlib/go.mod b/spannerlib/go.mod
index 6d6912b0..e42baa6b 100644
--- a/spannerlib/go.mod
+++ b/spannerlib/go.mod
@@ -7,9 +7,11 @@ toolchain go1.25.1
replace github.com/googleapis/go-sql-spanner => ..
require (
+ cloud.google.com/go/longrunning v0.6.7
cloud.google.com/go/spanner v1.85.1
github.com/google/go-cmp v0.7.0
github.com/googleapis/go-sql-spanner v1.18.0
+ google.golang.org/genproto/googleapis/api v0.0.0-20250818200422-3122310a409c
google.golang.org/grpc v1.75.1
google.golang.org/protobuf v1.36.9
)
@@ -21,7 +23,6 @@ require (
cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
cloud.google.com/go/compute/metadata v0.8.0 // indirect
cloud.google.com/go/iam v1.5.2 // indirect
- cloud.google.com/go/longrunning v0.6.7 // indirect
cloud.google.com/go/monitoring v1.24.2 // indirect
github.com/GoogleCloudPlatform/grpc-gcp-go/grpcgcp v1.5.3 // indirect
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.29.0 // indirect
@@ -62,6 +63,5 @@ require (
golang.org/x/time v0.12.0 // indirect
google.golang.org/api v0.249.0 // indirect
google.golang.org/genproto v0.0.0-20250804133106-a7a43d27e69b // indirect
- google.golang.org/genproto/googleapis/api v0.0.0-20250818200422-3122310a409c // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250908214217-97024824d090 // indirect
)
diff --git a/spannerlib/grpc-server/build-dotnet-darwin-aarch64.sh b/spannerlib/grpc-server/build-dotnet-darwin-aarch64.sh
new file mode 100755
index 00000000..3578601b
--- /dev/null
+++ b/spannerlib/grpc-server/build-dotnet-darwin-aarch64.sh
@@ -0,0 +1,4 @@
+go build -o grpc_server server.go
+chmod +x grpc_server
+cp grpc_server ../wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc/binaries/any/grpc_server
+cp grpc_server ../wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc/binaries/osx-arm64/grpc_server
diff --git a/spannerlib/grpc-server/build-dotnet.sh b/spannerlib/grpc-server/build-dotnet.sh
new file mode 100755
index 00000000..beb4edd9
--- /dev/null
+++ b/spannerlib/grpc-server/build-dotnet.sh
@@ -0,0 +1,17 @@
+mkdir -p ../wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-server/binaries/any
+rm ../wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-server/binaries/any/grpc_server
+
+GOOS=darwin GOARCH=arm64 go build -o grpc_server server.go
+chmod +x grpc_server
+mkdir -p ../wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-server/binaries/osx-arm64
+cp grpc_server ../wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-server/binaries/osx-arm64/grpc_server
+
+GOOS=linux GOARCH=amd64 go build -o grpc_server server.go
+chmod +x grpc_server
+mkdir -p ../wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-server/binaries/linux-x64
+cp grpc_server ../wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-server/binaries/linux-x64/grpc_server
+
+GOOS=windows GOARCH=amd64 go build -o grpc_server.exe server.go
+chmod +x grpc_server.exe
+mkdir -p ../wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-server/binaries/win-x64
+cp grpc_server.exe ../wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-server/binaries/win-x64/grpc_server.exe
diff --git a/spannerlib/grpc-server/build-java-darwin-aarch64.sh b/spannerlib/grpc-server/build-java-darwin-aarch64.sh
new file mode 100755
index 00000000..a14a7154
--- /dev/null
+++ b/spannerlib/grpc-server/build-java-darwin-aarch64.sh
@@ -0,0 +1,4 @@
+go build -o grpc_server server.go
+chmod +x grpc_server
+mkdir -p ../wrappers/spannerlib-java/src/main/resources/darwin-aarch64
+cp grpc_server ../wrappers/spannerlib-java/src/main/resources/darwin-aarch64/grpc_server
diff --git a/spannerlib/grpc-server/build-protos.sh b/spannerlib/grpc-server/build-protos.sh
new file mode 100755
index 00000000..d3721808
--- /dev/null
+++ b/spannerlib/grpc-server/build-protos.sh
@@ -0,0 +1,25 @@
+PATH="${PATH}:${HOME}/go/bin"
+ln -sf "${PWD}"/google/spannerlib googleapis/google/spannerlib
+cd googleapis || exit 1
+protoc \
+ --go_out=../ \
+ --go_opt=paths=source_relative \
+ --go-grpc_out=../ \
+ --go-grpc_opt=paths=source_relative \
+ google/spannerlib/v1/spannerlib.proto
+protoc \
+ --java_out=../../wrappers/spannerlib-java/src/main/java/ \
+ --plugin=protoc-gen-java-grpc=/Users/loite/protoc-gen-grpc-java-1.75.0-osx-aarch_64.exe \
+ --java-grpc_out=../../wrappers/spannerlib-java/src/main/java/ \
+ --java-grpc_opt=paths=source_relative \
+ google/spannerlib/v1/spannerlib.proto
+protoc \
+ --csharp_out=../../wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-v1/ \
+ --plugin=protoc-gen-csharp_grpc=/Users/loite/.nuget/packages/grpc.tools/2.72.0/tools/macosx_x64/grpc_csharp_plugin \
+ --csharp_grpc_out=../../wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-v1/ \
+ --csharp_opt=file_extension=.g.cs \
+ --csharp_grpc_opt=no_server \
+ --proto_path=. \
+ google/spannerlib/v1/spannerlib.proto
+cd .. || exit 1
+rm googleapis/google/spannerlib
diff --git a/spannerlib/grpc-server/google/spannerlib/spannerlib b/spannerlib/grpc-server/google/spannerlib/spannerlib
new file mode 120000
index 00000000..73970885
--- /dev/null
+++ b/spannerlib/grpc-server/google/spannerlib/spannerlib
@@ -0,0 +1 @@
+/Users/loite/GolandProjects/go-sql-spanner/spannerlib/grpc-server/google/spannerlib
\ No newline at end of file
diff --git a/spannerlib/grpc-server/google/spannerlib/v1/spannerlib.pb.go b/spannerlib/grpc-server/google/spannerlib/v1/spannerlib.pb.go
new file mode 100644
index 00000000..3707b228
--- /dev/null
+++ b/spannerlib/grpc-server/google/spannerlib/v1/spannerlib.pb.go
@@ -0,0 +1,1118 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.36.6
+// protoc v6.32.1
+// source: google/spannerlib/v1/spannerlib.proto
+
+package spannerlibpb
+
+import (
+ spannerpb "cloud.google.com/go/spanner/apiv1/spannerpb"
+ _ "google.golang.org/genproto/googleapis/api/annotations"
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+ emptypb "google.golang.org/protobuf/types/known/emptypb"
+ structpb "google.golang.org/protobuf/types/known/structpb"
+ reflect "reflect"
+ sync "sync"
+ unsafe "unsafe"
+)
+
+const (
+ // Verify that this generated code is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+type InfoRequest struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *InfoRequest) Reset() {
+ *x = InfoRequest{}
+ mi := &file_google_spannerlib_v1_spannerlib_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *InfoRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*InfoRequest) ProtoMessage() {}
+
+func (x *InfoRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_spannerlib_v1_spannerlib_proto_msgTypes[0]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use InfoRequest.ProtoReflect.Descriptor instead.
+func (*InfoRequest) Descriptor() ([]byte, []int) {
+ return file_google_spannerlib_v1_spannerlib_proto_rawDescGZIP(), []int{0}
+}
+
+type InfoResponse struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *InfoResponse) Reset() {
+ *x = InfoResponse{}
+ mi := &file_google_spannerlib_v1_spannerlib_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *InfoResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*InfoResponse) ProtoMessage() {}
+
+func (x *InfoResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_google_spannerlib_v1_spannerlib_proto_msgTypes[1]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use InfoResponse.ProtoReflect.Descriptor instead.
+func (*InfoResponse) Descriptor() ([]byte, []int) {
+ return file_google_spannerlib_v1_spannerlib_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *InfoResponse) GetVersion() string {
+ if x != nil {
+ return x.Version
+ }
+ return ""
+}
+
+type CreatePoolRequest struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ ConnectionString string `protobuf:"bytes,1,opt,name=connection_string,json=connectionString,proto3" json:"connection_string,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *CreatePoolRequest) Reset() {
+ *x = CreatePoolRequest{}
+ mi := &file_google_spannerlib_v1_spannerlib_proto_msgTypes[2]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *CreatePoolRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CreatePoolRequest) ProtoMessage() {}
+
+func (x *CreatePoolRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_spannerlib_v1_spannerlib_proto_msgTypes[2]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use CreatePoolRequest.ProtoReflect.Descriptor instead.
+func (*CreatePoolRequest) Descriptor() ([]byte, []int) {
+ return file_google_spannerlib_v1_spannerlib_proto_rawDescGZIP(), []int{2}
+}
+
+func (x *CreatePoolRequest) GetConnectionString() string {
+ if x != nil {
+ return x.ConnectionString
+ }
+ return ""
+}
+
+type CreateConnectionRequest struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Pool *Pool `protobuf:"bytes,1,opt,name=pool,proto3" json:"pool,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *CreateConnectionRequest) Reset() {
+ *x = CreateConnectionRequest{}
+ mi := &file_google_spannerlib_v1_spannerlib_proto_msgTypes[3]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *CreateConnectionRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CreateConnectionRequest) ProtoMessage() {}
+
+func (x *CreateConnectionRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_spannerlib_v1_spannerlib_proto_msgTypes[3]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use CreateConnectionRequest.ProtoReflect.Descriptor instead.
+func (*CreateConnectionRequest) Descriptor() ([]byte, []int) {
+ return file_google_spannerlib_v1_spannerlib_proto_rawDescGZIP(), []int{3}
+}
+
+func (x *CreateConnectionRequest) GetPool() *Pool {
+ if x != nil {
+ return x.Pool
+ }
+ return nil
+}
+
+type ExecuteRequest struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Connection *Connection `protobuf:"bytes,1,opt,name=connection,proto3" json:"connection,omitempty"`
+ ExecuteSqlRequest *spannerpb.ExecuteSqlRequest `protobuf:"bytes,2,opt,name=execute_sql_request,json=executeSqlRequest,proto3" json:"execute_sql_request,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *ExecuteRequest) Reset() {
+ *x = ExecuteRequest{}
+ mi := &file_google_spannerlib_v1_spannerlib_proto_msgTypes[4]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *ExecuteRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ExecuteRequest) ProtoMessage() {}
+
+func (x *ExecuteRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_spannerlib_v1_spannerlib_proto_msgTypes[4]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use ExecuteRequest.ProtoReflect.Descriptor instead.
+func (*ExecuteRequest) Descriptor() ([]byte, []int) {
+ return file_google_spannerlib_v1_spannerlib_proto_rawDescGZIP(), []int{4}
+}
+
+func (x *ExecuteRequest) GetConnection() *Connection {
+ if x != nil {
+ return x.Connection
+ }
+ return nil
+}
+
+func (x *ExecuteRequest) GetExecuteSqlRequest() *spannerpb.ExecuteSqlRequest {
+ if x != nil {
+ return x.ExecuteSqlRequest
+ }
+ return nil
+}
+
+type ExecuteBatchRequest struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Connection *Connection `protobuf:"bytes,1,opt,name=connection,proto3" json:"connection,omitempty"`
+ ExecuteBatchDmlRequest *spannerpb.ExecuteBatchDmlRequest `protobuf:"bytes,2,opt,name=execute_batch_dml_request,json=executeBatchDmlRequest,proto3" json:"execute_batch_dml_request,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *ExecuteBatchRequest) Reset() {
+ *x = ExecuteBatchRequest{}
+ mi := &file_google_spannerlib_v1_spannerlib_proto_msgTypes[5]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *ExecuteBatchRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ExecuteBatchRequest) ProtoMessage() {}
+
+func (x *ExecuteBatchRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_spannerlib_v1_spannerlib_proto_msgTypes[5]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use ExecuteBatchRequest.ProtoReflect.Descriptor instead.
+func (*ExecuteBatchRequest) Descriptor() ([]byte, []int) {
+ return file_google_spannerlib_v1_spannerlib_proto_rawDescGZIP(), []int{5}
+}
+
+func (x *ExecuteBatchRequest) GetConnection() *Connection {
+ if x != nil {
+ return x.Connection
+ }
+ return nil
+}
+
+func (x *ExecuteBatchRequest) GetExecuteBatchDmlRequest() *spannerpb.ExecuteBatchDmlRequest {
+ if x != nil {
+ return x.ExecuteBatchDmlRequest
+ }
+ return nil
+}
+
+type BeginTransactionRequest struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Connection *Connection `protobuf:"bytes,1,opt,name=connection,proto3" json:"connection,omitempty"`
+ TransactionOptions *spannerpb.TransactionOptions `protobuf:"bytes,2,opt,name=transaction_options,json=transactionOptions,proto3" json:"transaction_options,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *BeginTransactionRequest) Reset() {
+ *x = BeginTransactionRequest{}
+ mi := &file_google_spannerlib_v1_spannerlib_proto_msgTypes[6]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *BeginTransactionRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*BeginTransactionRequest) ProtoMessage() {}
+
+func (x *BeginTransactionRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_spannerlib_v1_spannerlib_proto_msgTypes[6]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use BeginTransactionRequest.ProtoReflect.Descriptor instead.
+func (*BeginTransactionRequest) Descriptor() ([]byte, []int) {
+ return file_google_spannerlib_v1_spannerlib_proto_rawDescGZIP(), []int{6}
+}
+
+func (x *BeginTransactionRequest) GetConnection() *Connection {
+ if x != nil {
+ return x.Connection
+ }
+ return nil
+}
+
+func (x *BeginTransactionRequest) GetTransactionOptions() *spannerpb.TransactionOptions {
+ if x != nil {
+ return x.TransactionOptions
+ }
+ return nil
+}
+
+type WriteMutationsRequest struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Connection *Connection `protobuf:"bytes,1,opt,name=connection,proto3" json:"connection,omitempty"`
+ Mutations *spannerpb.BatchWriteRequest_MutationGroup `protobuf:"bytes,2,opt,name=mutations,proto3" json:"mutations,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *WriteMutationsRequest) Reset() {
+ *x = WriteMutationsRequest{}
+ mi := &file_google_spannerlib_v1_spannerlib_proto_msgTypes[7]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *WriteMutationsRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*WriteMutationsRequest) ProtoMessage() {}
+
+func (x *WriteMutationsRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_spannerlib_v1_spannerlib_proto_msgTypes[7]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use WriteMutationsRequest.ProtoReflect.Descriptor instead.
+func (*WriteMutationsRequest) Descriptor() ([]byte, []int) {
+ return file_google_spannerlib_v1_spannerlib_proto_rawDescGZIP(), []int{7}
+}
+
+func (x *WriteMutationsRequest) GetConnection() *Connection {
+ if x != nil {
+ return x.Connection
+ }
+ return nil
+}
+
+func (x *WriteMutationsRequest) GetMutations() *spannerpb.BatchWriteRequest_MutationGroup {
+ if x != nil {
+ return x.Mutations
+ }
+ return nil
+}
+
+type Pool struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *Pool) Reset() {
+ *x = Pool{}
+ mi := &file_google_spannerlib_v1_spannerlib_proto_msgTypes[8]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *Pool) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Pool) ProtoMessage() {}
+
+func (x *Pool) ProtoReflect() protoreflect.Message {
+ mi := &file_google_spannerlib_v1_spannerlib_proto_msgTypes[8]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use Pool.ProtoReflect.Descriptor instead.
+func (*Pool) Descriptor() ([]byte, []int) {
+ return file_google_spannerlib_v1_spannerlib_proto_rawDescGZIP(), []int{8}
+}
+
+func (x *Pool) GetId() int64 {
+ if x != nil {
+ return x.Id
+ }
+ return 0
+}
+
+type Connection struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Pool *Pool `protobuf:"bytes,1,opt,name=pool,proto3" json:"pool,omitempty"`
+ Id int64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *Connection) Reset() {
+ *x = Connection{}
+ mi := &file_google_spannerlib_v1_spannerlib_proto_msgTypes[9]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *Connection) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Connection) ProtoMessage() {}
+
+func (x *Connection) ProtoReflect() protoreflect.Message {
+ mi := &file_google_spannerlib_v1_spannerlib_proto_msgTypes[9]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use Connection.ProtoReflect.Descriptor instead.
+func (*Connection) Descriptor() ([]byte, []int) {
+ return file_google_spannerlib_v1_spannerlib_proto_rawDescGZIP(), []int{9}
+}
+
+func (x *Connection) GetPool() *Pool {
+ if x != nil {
+ return x.Pool
+ }
+ return nil
+}
+
+func (x *Connection) GetId() int64 {
+ if x != nil {
+ return x.Id
+ }
+ return 0
+}
+
+type Rows struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Connection *Connection `protobuf:"bytes,1,opt,name=connection,proto3" json:"connection,omitempty"`
+ Id int64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *Rows) Reset() {
+ *x = Rows{}
+ mi := &file_google_spannerlib_v1_spannerlib_proto_msgTypes[10]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *Rows) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Rows) ProtoMessage() {}
+
+func (x *Rows) ProtoReflect() protoreflect.Message {
+ mi := &file_google_spannerlib_v1_spannerlib_proto_msgTypes[10]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use Rows.ProtoReflect.Descriptor instead.
+func (*Rows) Descriptor() ([]byte, []int) {
+ return file_google_spannerlib_v1_spannerlib_proto_rawDescGZIP(), []int{10}
+}
+
+func (x *Rows) GetConnection() *Connection {
+ if x != nil {
+ return x.Connection
+ }
+ return nil
+}
+
+func (x *Rows) GetId() int64 {
+ if x != nil {
+ return x.Id
+ }
+ return 0
+}
+
+type NextRequest struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Rows *Rows `protobuf:"bytes,1,opt,name=rows,proto3" json:"rows,omitempty"`
+ NumRows int64 `protobuf:"varint,2,opt,name=num_rows,json=numRows,proto3" json:"num_rows,omitempty"`
+ Encoding int64 `protobuf:"varint,3,opt,name=encoding,proto3" json:"encoding,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *NextRequest) Reset() {
+ *x = NextRequest{}
+ mi := &file_google_spannerlib_v1_spannerlib_proto_msgTypes[11]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *NextRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*NextRequest) ProtoMessage() {}
+
+func (x *NextRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_spannerlib_v1_spannerlib_proto_msgTypes[11]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use NextRequest.ProtoReflect.Descriptor instead.
+func (*NextRequest) Descriptor() ([]byte, []int) {
+ return file_google_spannerlib_v1_spannerlib_proto_rawDescGZIP(), []int{11}
+}
+
+func (x *NextRequest) GetRows() *Rows {
+ if x != nil {
+ return x.Rows
+ }
+ return nil
+}
+
+func (x *NextRequest) GetNumRows() int64 {
+ if x != nil {
+ return x.NumRows
+ }
+ return 0
+}
+
+func (x *NextRequest) GetEncoding() int64 {
+ if x != nil {
+ return x.Encoding
+ }
+ return 0
+}
+
+type RowData struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Rows *Rows `protobuf:"bytes,1,opt,name=rows,proto3" json:"rows,omitempty"`
+ Metadata *spannerpb.ResultSetMetadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"`
+ Data []*structpb.ListValue `protobuf:"bytes,3,rep,name=data,proto3" json:"data,omitempty"`
+ Stats *spannerpb.ResultSetStats `protobuf:"bytes,4,opt,name=stats,proto3" json:"stats,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *RowData) Reset() {
+ *x = RowData{}
+ mi := &file_google_spannerlib_v1_spannerlib_proto_msgTypes[12]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *RowData) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*RowData) ProtoMessage() {}
+
+func (x *RowData) ProtoReflect() protoreflect.Message {
+ mi := &file_google_spannerlib_v1_spannerlib_proto_msgTypes[12]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use RowData.ProtoReflect.Descriptor instead.
+func (*RowData) Descriptor() ([]byte, []int) {
+ return file_google_spannerlib_v1_spannerlib_proto_rawDescGZIP(), []int{12}
+}
+
+func (x *RowData) GetRows() *Rows {
+ if x != nil {
+ return x.Rows
+ }
+ return nil
+}
+
+func (x *RowData) GetMetadata() *spannerpb.ResultSetMetadata {
+ if x != nil {
+ return x.Metadata
+ }
+ return nil
+}
+
+func (x *RowData) GetData() []*structpb.ListValue {
+ if x != nil {
+ return x.Data
+ }
+ return nil
+}
+
+func (x *RowData) GetStats() *spannerpb.ResultSetStats {
+ if x != nil {
+ return x.Stats
+ }
+ return nil
+}
+
+type MetadataRequest struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Rows *Rows `protobuf:"bytes,1,opt,name=rows,proto3" json:"rows,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *MetadataRequest) Reset() {
+ *x = MetadataRequest{}
+ mi := &file_google_spannerlib_v1_spannerlib_proto_msgTypes[13]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *MetadataRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*MetadataRequest) ProtoMessage() {}
+
+func (x *MetadataRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_spannerlib_v1_spannerlib_proto_msgTypes[13]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use MetadataRequest.ProtoReflect.Descriptor instead.
+func (*MetadataRequest) Descriptor() ([]byte, []int) {
+ return file_google_spannerlib_v1_spannerlib_proto_rawDescGZIP(), []int{13}
+}
+
+func (x *MetadataRequest) GetRows() *Rows {
+ if x != nil {
+ return x.Rows
+ }
+ return nil
+}
+
+type ResultSetStatsRequest struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Rows *Rows `protobuf:"bytes,1,opt,name=rows,proto3" json:"rows,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *ResultSetStatsRequest) Reset() {
+ *x = ResultSetStatsRequest{}
+ mi := &file_google_spannerlib_v1_spannerlib_proto_msgTypes[14]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *ResultSetStatsRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ResultSetStatsRequest) ProtoMessage() {}
+
+func (x *ResultSetStatsRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_spannerlib_v1_spannerlib_proto_msgTypes[14]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use ResultSetStatsRequest.ProtoReflect.Descriptor instead.
+func (*ResultSetStatsRequest) Descriptor() ([]byte, []int) {
+ return file_google_spannerlib_v1_spannerlib_proto_rawDescGZIP(), []int{14}
+}
+
+func (x *ResultSetStatsRequest) GetRows() *Rows {
+ if x != nil {
+ return x.Rows
+ }
+ return nil
+}
+
+type ConnectionStreamRequest struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ // Types that are valid to be assigned to Request:
+ //
+ // *ConnectionStreamRequest_ExecuteRequest
+ Request isConnectionStreamRequest_Request `protobuf_oneof:"request"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *ConnectionStreamRequest) Reset() {
+ *x = ConnectionStreamRequest{}
+ mi := &file_google_spannerlib_v1_spannerlib_proto_msgTypes[15]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *ConnectionStreamRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ConnectionStreamRequest) ProtoMessage() {}
+
+func (x *ConnectionStreamRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_spannerlib_v1_spannerlib_proto_msgTypes[15]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use ConnectionStreamRequest.ProtoReflect.Descriptor instead.
+func (*ConnectionStreamRequest) Descriptor() ([]byte, []int) {
+ return file_google_spannerlib_v1_spannerlib_proto_rawDescGZIP(), []int{15}
+}
+
+func (x *ConnectionStreamRequest) GetRequest() isConnectionStreamRequest_Request {
+ if x != nil {
+ return x.Request
+ }
+ return nil
+}
+
+func (x *ConnectionStreamRequest) GetExecuteRequest() *ExecuteRequest {
+ if x != nil {
+ if x, ok := x.Request.(*ConnectionStreamRequest_ExecuteRequest); ok {
+ return x.ExecuteRequest
+ }
+ }
+ return nil
+}
+
+type isConnectionStreamRequest_Request interface {
+ isConnectionStreamRequest_Request()
+}
+
+type ConnectionStreamRequest_ExecuteRequest struct {
+ ExecuteRequest *ExecuteRequest `protobuf:"bytes,1,opt,name=execute_request,json=executeRequest,proto3,oneof"`
+}
+
+func (*ConnectionStreamRequest_ExecuteRequest) isConnectionStreamRequest_Request() {}
+
+type ConnectionStreamResponse struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ // Types that are valid to be assigned to Response:
+ //
+ // *ConnectionStreamResponse_Row
+ Response isConnectionStreamResponse_Response `protobuf_oneof:"response"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *ConnectionStreamResponse) Reset() {
+ *x = ConnectionStreamResponse{}
+ mi := &file_google_spannerlib_v1_spannerlib_proto_msgTypes[16]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *ConnectionStreamResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ConnectionStreamResponse) ProtoMessage() {}
+
+func (x *ConnectionStreamResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_google_spannerlib_v1_spannerlib_proto_msgTypes[16]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use ConnectionStreamResponse.ProtoReflect.Descriptor instead.
+func (*ConnectionStreamResponse) Descriptor() ([]byte, []int) {
+ return file_google_spannerlib_v1_spannerlib_proto_rawDescGZIP(), []int{16}
+}
+
+func (x *ConnectionStreamResponse) GetResponse() isConnectionStreamResponse_Response {
+ if x != nil {
+ return x.Response
+ }
+ return nil
+}
+
+func (x *ConnectionStreamResponse) GetRow() *spannerpb.PartialResultSet {
+ if x != nil {
+ if x, ok := x.Response.(*ConnectionStreamResponse_Row); ok {
+ return x.Row
+ }
+ }
+ return nil
+}
+
+type isConnectionStreamResponse_Response interface {
+ isConnectionStreamResponse_Response()
+}
+
+type ConnectionStreamResponse_Row struct {
+ Row *spannerpb.PartialResultSet `protobuf:"bytes,1,opt,name=row,proto3,oneof"`
+}
+
+func (*ConnectionStreamResponse_Row) isConnectionStreamResponse_Response() {}
+
+var File_google_spannerlib_v1_spannerlib_proto protoreflect.FileDescriptor
+
+const file_google_spannerlib_v1_spannerlib_proto_rawDesc = "" +
+ "\n" +
+ "%google/spannerlib/v1/spannerlib.proto\x12\x14google.spannerlib.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\"google/spanner/v1/result_set.proto\x1a\x1fgoogle/spanner/v1/spanner.proto\x1a#google/spanner/v1/transaction.proto\"\r\n" +
+ "\vInfoRequest\"(\n" +
+ "\fInfoResponse\x12\x18\n" +
+ "\aversion\x18\x01 \x01(\tR\aversion\"E\n" +
+ "\x11CreatePoolRequest\x120\n" +
+ "\x11connection_string\x18\x01 \x01(\tB\x03\xe0A\x02R\x10connectionString\"N\n" +
+ "\x17CreateConnectionRequest\x123\n" +
+ "\x04pool\x18\x01 \x01(\v2\x1a.google.spannerlib.v1.PoolB\x03\xe0A\x02R\x04pool\"\xb2\x01\n" +
+ "\x0eExecuteRequest\x12E\n" +
+ "\n" +
+ "connection\x18\x01 \x01(\v2 .google.spannerlib.v1.ConnectionB\x03\xe0A\x02R\n" +
+ "connection\x12Y\n" +
+ "\x13execute_sql_request\x18\x02 \x01(\v2$.google.spanner.v1.ExecuteSqlRequestB\x03\xe0A\x02R\x11executeSqlRequest\"\xc7\x01\n" +
+ "\x13ExecuteBatchRequest\x12E\n" +
+ "\n" +
+ "connection\x18\x01 \x01(\v2 .google.spannerlib.v1.ConnectionB\x03\xe0A\x02R\n" +
+ "connection\x12i\n" +
+ "\x19execute_batch_dml_request\x18\x02 \x01(\v2).google.spanner.v1.ExecuteBatchDmlRequestB\x03\xe0A\x02R\x16executeBatchDmlRequest\"\xbd\x01\n" +
+ "\x17BeginTransactionRequest\x12E\n" +
+ "\n" +
+ "connection\x18\x01 \x01(\v2 .google.spannerlib.v1.ConnectionB\x03\xe0A\x02R\n" +
+ "connection\x12[\n" +
+ "\x13transaction_options\x18\x02 \x01(\v2%.google.spanner.v1.TransactionOptionsB\x03\xe0A\x02R\x12transactionOptions\"\xb5\x01\n" +
+ "\x15WriteMutationsRequest\x12E\n" +
+ "\n" +
+ "connection\x18\x01 \x01(\v2 .google.spannerlib.v1.ConnectionB\x03\xe0A\x02R\n" +
+ "connection\x12U\n" +
+ "\tmutations\x18\x02 \x01(\v22.google.spanner.v1.BatchWriteRequest.MutationGroupB\x03\xe0A\x02R\tmutations\"\x1b\n" +
+ "\x04Pool\x12\x13\n" +
+ "\x02id\x18\x01 \x01(\x03B\x03\xe0A\x02R\x02id\"V\n" +
+ "\n" +
+ "Connection\x123\n" +
+ "\x04pool\x18\x01 \x01(\v2\x1a.google.spannerlib.v1.PoolB\x03\xe0A\x02R\x04pool\x12\x13\n" +
+ "\x02id\x18\x02 \x01(\x03B\x03\xe0A\x02R\x02id\"b\n" +
+ "\x04Rows\x12E\n" +
+ "\n" +
+ "connection\x18\x01 \x01(\v2 .google.spannerlib.v1.ConnectionB\x03\xe0A\x02R\n" +
+ "connection\x12\x13\n" +
+ "\x02id\x18\x02 \x01(\x03B\x03\xe0A\x02R\x02id\"\x83\x01\n" +
+ "\vNextRequest\x123\n" +
+ "\x04rows\x18\x01 \x01(\v2\x1a.google.spannerlib.v1.RowsB\x03\xe0A\x02R\x04rows\x12\x1e\n" +
+ "\bnum_rows\x18\x02 \x01(\x03B\x03\xe0A\x02R\anumRows\x12\x1f\n" +
+ "\bencoding\x18\x03 \x01(\x03B\x03\xe0A\x02R\bencoding\"\xee\x01\n" +
+ "\aRowData\x123\n" +
+ "\x04rows\x18\x01 \x01(\v2\x1a.google.spannerlib.v1.RowsB\x03\xe0A\x02R\x04rows\x12@\n" +
+ "\bmetadata\x18\x02 \x01(\v2$.google.spanner.v1.ResultSetMetadataR\bmetadata\x123\n" +
+ "\x04data\x18\x03 \x03(\v2\x1a.google.protobuf.ListValueB\x03\xe0A\x02R\x04data\x127\n" +
+ "\x05stats\x18\x04 \x01(\v2!.google.spanner.v1.ResultSetStatsR\x05stats\"F\n" +
+ "\x0fMetadataRequest\x123\n" +
+ "\x04rows\x18\x01 \x01(\v2\x1a.google.spannerlib.v1.RowsB\x03\xe0A\x02R\x04rows\"L\n" +
+ "\x15ResultSetStatsRequest\x123\n" +
+ "\x04rows\x18\x01 \x01(\v2\x1a.google.spannerlib.v1.RowsB\x03\xe0A\x02R\x04rows\"u\n" +
+ "\x17ConnectionStreamRequest\x12O\n" +
+ "\x0fexecute_request\x18\x01 \x01(\v2$.google.spannerlib.v1.ExecuteRequestH\x00R\x0eexecuteRequestB\t\n" +
+ "\arequest\"_\n" +
+ "\x18ConnectionStreamResponse\x127\n" +
+ "\x03row\x18\x01 \x01(\v2#.google.spanner.v1.PartialResultSetH\x00R\x03rowB\n" +
+ "\n" +
+ "\bresponse2\xc2\v\n" +
+ "\n" +
+ "SpannerLib\x12O\n" +
+ "\x04Info\x12!.google.spannerlib.v1.InfoRequest\x1a\".google.spannerlib.v1.InfoResponse\"\x00\x12S\n" +
+ "\n" +
+ "CreatePool\x12'.google.spannerlib.v1.CreatePoolRequest\x1a\x1a.google.spannerlib.v1.Pool\"\x00\x12A\n" +
+ "\tClosePool\x12\x1a.google.spannerlib.v1.Pool\x1a\x16.google.protobuf.Empty\"\x00\x12e\n" +
+ "\x10CreateConnection\x12-.google.spannerlib.v1.CreateConnectionRequest\x1a .google.spannerlib.v1.Connection\"\x00\x12M\n" +
+ "\x0fCloseConnection\x12 .google.spannerlib.v1.Connection\x1a\x16.google.protobuf.Empty\"\x00\x12M\n" +
+ "\aExecute\x12$.google.spannerlib.v1.ExecuteRequest\x1a\x1a.google.spannerlib.v1.Rows\"\x00\x12[\n" +
+ "\x10ExecuteStreaming\x12$.google.spannerlib.v1.ExecuteRequest\x1a\x1d.google.spannerlib.v1.RowData\"\x000\x01\x12g\n" +
+ "\fExecuteBatch\x12).google.spannerlib.v1.ExecuteBatchRequest\x1a*.google.spanner.v1.ExecuteBatchDmlResponse\"\x00\x12N\n" +
+ "\bMetadata\x12\x1a.google.spannerlib.v1.Rows\x1a$.google.spanner.v1.ResultSetMetadata\"\x00\x12G\n" +
+ "\x04Next\x12!.google.spannerlib.v1.NextRequest\x1a\x1a.google.protobuf.ListValue\"\x00\x12Q\n" +
+ "\x0eResultSetStats\x12\x1a.google.spannerlib.v1.Rows\x1a!.google.spanner.v1.ResultSetStats\"\x00\x12A\n" +
+ "\tCloseRows\x12\x1a.google.spannerlib.v1.Rows\x1a\x16.google.protobuf.Empty\"\x00\x12[\n" +
+ "\x10BeginTransaction\x12-.google.spannerlib.v1.BeginTransactionRequest\x1a\x16.google.protobuf.Empty\"\x00\x12O\n" +
+ "\x06Commit\x12 .google.spannerlib.v1.Connection\x1a!.google.spanner.v1.CommitResponse\"\x00\x12F\n" +
+ "\bRollback\x12 .google.spannerlib.v1.Connection\x1a\x16.google.protobuf.Empty\"\x00\x12b\n" +
+ "\x0eWriteMutations\x12+.google.spannerlib.v1.WriteMutationsRequest\x1a!.google.spanner.v1.CommitResponse\"\x00\x12w\n" +
+ "\x10ConnectionStream\x12-.google.spannerlib.v1.ConnectionStreamRequest\x1a..google.spannerlib.v1.ConnectionStreamResponse\"\x00(\x010\x01B\xcd\x01\n" +
+ "\x1ecom.google.cloud.spannerlib.v1B\x0fSpannerLibProtoP\x01Z>cloud.google.com/go/spannerlib/apiv1/spannerlibpb;spannerlibpb\xaa\x02\x1aGoogle.Cloud.SpannerLib.V1\xca\x02\x1aGoogle\\Cloud\\SpannerLib\\V1\xea\x02\x1dGoogle::Cloud::SpannerLib::V1b\x06proto3"
+
+var (
+ file_google_spannerlib_v1_spannerlib_proto_rawDescOnce sync.Once
+ file_google_spannerlib_v1_spannerlib_proto_rawDescData []byte
+)
+
+func file_google_spannerlib_v1_spannerlib_proto_rawDescGZIP() []byte {
+ file_google_spannerlib_v1_spannerlib_proto_rawDescOnce.Do(func() {
+ file_google_spannerlib_v1_spannerlib_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_spannerlib_v1_spannerlib_proto_rawDesc), len(file_google_spannerlib_v1_spannerlib_proto_rawDesc)))
+ })
+ return file_google_spannerlib_v1_spannerlib_proto_rawDescData
+}
+
+var file_google_spannerlib_v1_spannerlib_proto_msgTypes = make([]protoimpl.MessageInfo, 17)
+var file_google_spannerlib_v1_spannerlib_proto_goTypes = []any{
+ (*InfoRequest)(nil), // 0: google.spannerlib.v1.InfoRequest
+ (*InfoResponse)(nil), // 1: google.spannerlib.v1.InfoResponse
+ (*CreatePoolRequest)(nil), // 2: google.spannerlib.v1.CreatePoolRequest
+ (*CreateConnectionRequest)(nil), // 3: google.spannerlib.v1.CreateConnectionRequest
+ (*ExecuteRequest)(nil), // 4: google.spannerlib.v1.ExecuteRequest
+ (*ExecuteBatchRequest)(nil), // 5: google.spannerlib.v1.ExecuteBatchRequest
+ (*BeginTransactionRequest)(nil), // 6: google.spannerlib.v1.BeginTransactionRequest
+ (*WriteMutationsRequest)(nil), // 7: google.spannerlib.v1.WriteMutationsRequest
+ (*Pool)(nil), // 8: google.spannerlib.v1.Pool
+ (*Connection)(nil), // 9: google.spannerlib.v1.Connection
+ (*Rows)(nil), // 10: google.spannerlib.v1.Rows
+ (*NextRequest)(nil), // 11: google.spannerlib.v1.NextRequest
+ (*RowData)(nil), // 12: google.spannerlib.v1.RowData
+ (*MetadataRequest)(nil), // 13: google.spannerlib.v1.MetadataRequest
+ (*ResultSetStatsRequest)(nil), // 14: google.spannerlib.v1.ResultSetStatsRequest
+ (*ConnectionStreamRequest)(nil), // 15: google.spannerlib.v1.ConnectionStreamRequest
+ (*ConnectionStreamResponse)(nil), // 16: google.spannerlib.v1.ConnectionStreamResponse
+ (*spannerpb.ExecuteSqlRequest)(nil), // 17: google.spanner.v1.ExecuteSqlRequest
+ (*spannerpb.ExecuteBatchDmlRequest)(nil), // 18: google.spanner.v1.ExecuteBatchDmlRequest
+ (*spannerpb.TransactionOptions)(nil), // 19: google.spanner.v1.TransactionOptions
+ (*spannerpb.BatchWriteRequest_MutationGroup)(nil), // 20: google.spanner.v1.BatchWriteRequest.MutationGroup
+ (*spannerpb.ResultSetMetadata)(nil), // 21: google.spanner.v1.ResultSetMetadata
+ (*structpb.ListValue)(nil), // 22: google.protobuf.ListValue
+ (*spannerpb.ResultSetStats)(nil), // 23: google.spanner.v1.ResultSetStats
+ (*spannerpb.PartialResultSet)(nil), // 24: google.spanner.v1.PartialResultSet
+ (*emptypb.Empty)(nil), // 25: google.protobuf.Empty
+ (*spannerpb.ExecuteBatchDmlResponse)(nil), // 26: google.spanner.v1.ExecuteBatchDmlResponse
+ (*spannerpb.CommitResponse)(nil), // 27: google.spanner.v1.CommitResponse
+}
+var file_google_spannerlib_v1_spannerlib_proto_depIdxs = []int32{
+ 8, // 0: google.spannerlib.v1.CreateConnectionRequest.pool:type_name -> google.spannerlib.v1.Pool
+ 9, // 1: google.spannerlib.v1.ExecuteRequest.connection:type_name -> google.spannerlib.v1.Connection
+ 17, // 2: google.spannerlib.v1.ExecuteRequest.execute_sql_request:type_name -> google.spanner.v1.ExecuteSqlRequest
+ 9, // 3: google.spannerlib.v1.ExecuteBatchRequest.connection:type_name -> google.spannerlib.v1.Connection
+ 18, // 4: google.spannerlib.v1.ExecuteBatchRequest.execute_batch_dml_request:type_name -> google.spanner.v1.ExecuteBatchDmlRequest
+ 9, // 5: google.spannerlib.v1.BeginTransactionRequest.connection:type_name -> google.spannerlib.v1.Connection
+ 19, // 6: google.spannerlib.v1.BeginTransactionRequest.transaction_options:type_name -> google.spanner.v1.TransactionOptions
+ 9, // 7: google.spannerlib.v1.WriteMutationsRequest.connection:type_name -> google.spannerlib.v1.Connection
+ 20, // 8: google.spannerlib.v1.WriteMutationsRequest.mutations:type_name -> google.spanner.v1.BatchWriteRequest.MutationGroup
+ 8, // 9: google.spannerlib.v1.Connection.pool:type_name -> google.spannerlib.v1.Pool
+ 9, // 10: google.spannerlib.v1.Rows.connection:type_name -> google.spannerlib.v1.Connection
+ 10, // 11: google.spannerlib.v1.NextRequest.rows:type_name -> google.spannerlib.v1.Rows
+ 10, // 12: google.spannerlib.v1.RowData.rows:type_name -> google.spannerlib.v1.Rows
+ 21, // 13: google.spannerlib.v1.RowData.metadata:type_name -> google.spanner.v1.ResultSetMetadata
+ 22, // 14: google.spannerlib.v1.RowData.data:type_name -> google.protobuf.ListValue
+ 23, // 15: google.spannerlib.v1.RowData.stats:type_name -> google.spanner.v1.ResultSetStats
+ 10, // 16: google.spannerlib.v1.MetadataRequest.rows:type_name -> google.spannerlib.v1.Rows
+ 10, // 17: google.spannerlib.v1.ResultSetStatsRequest.rows:type_name -> google.spannerlib.v1.Rows
+ 4, // 18: google.spannerlib.v1.ConnectionStreamRequest.execute_request:type_name -> google.spannerlib.v1.ExecuteRequest
+ 24, // 19: google.spannerlib.v1.ConnectionStreamResponse.row:type_name -> google.spanner.v1.PartialResultSet
+ 0, // 20: google.spannerlib.v1.SpannerLib.Info:input_type -> google.spannerlib.v1.InfoRequest
+ 2, // 21: google.spannerlib.v1.SpannerLib.CreatePool:input_type -> google.spannerlib.v1.CreatePoolRequest
+ 8, // 22: google.spannerlib.v1.SpannerLib.ClosePool:input_type -> google.spannerlib.v1.Pool
+ 3, // 23: google.spannerlib.v1.SpannerLib.CreateConnection:input_type -> google.spannerlib.v1.CreateConnectionRequest
+ 9, // 24: google.spannerlib.v1.SpannerLib.CloseConnection:input_type -> google.spannerlib.v1.Connection
+ 4, // 25: google.spannerlib.v1.SpannerLib.Execute:input_type -> google.spannerlib.v1.ExecuteRequest
+ 4, // 26: google.spannerlib.v1.SpannerLib.ExecuteStreaming:input_type -> google.spannerlib.v1.ExecuteRequest
+ 5, // 27: google.spannerlib.v1.SpannerLib.ExecuteBatch:input_type -> google.spannerlib.v1.ExecuteBatchRequest
+ 10, // 28: google.spannerlib.v1.SpannerLib.Metadata:input_type -> google.spannerlib.v1.Rows
+ 11, // 29: google.spannerlib.v1.SpannerLib.Next:input_type -> google.spannerlib.v1.NextRequest
+ 10, // 30: google.spannerlib.v1.SpannerLib.ResultSetStats:input_type -> google.spannerlib.v1.Rows
+ 10, // 31: google.spannerlib.v1.SpannerLib.CloseRows:input_type -> google.spannerlib.v1.Rows
+ 6, // 32: google.spannerlib.v1.SpannerLib.BeginTransaction:input_type -> google.spannerlib.v1.BeginTransactionRequest
+ 9, // 33: google.spannerlib.v1.SpannerLib.Commit:input_type -> google.spannerlib.v1.Connection
+ 9, // 34: google.spannerlib.v1.SpannerLib.Rollback:input_type -> google.spannerlib.v1.Connection
+ 7, // 35: google.spannerlib.v1.SpannerLib.WriteMutations:input_type -> google.spannerlib.v1.WriteMutationsRequest
+ 15, // 36: google.spannerlib.v1.SpannerLib.ConnectionStream:input_type -> google.spannerlib.v1.ConnectionStreamRequest
+ 1, // 37: google.spannerlib.v1.SpannerLib.Info:output_type -> google.spannerlib.v1.InfoResponse
+ 8, // 38: google.spannerlib.v1.SpannerLib.CreatePool:output_type -> google.spannerlib.v1.Pool
+ 25, // 39: google.spannerlib.v1.SpannerLib.ClosePool:output_type -> google.protobuf.Empty
+ 9, // 40: google.spannerlib.v1.SpannerLib.CreateConnection:output_type -> google.spannerlib.v1.Connection
+ 25, // 41: google.spannerlib.v1.SpannerLib.CloseConnection:output_type -> google.protobuf.Empty
+ 10, // 42: google.spannerlib.v1.SpannerLib.Execute:output_type -> google.spannerlib.v1.Rows
+ 12, // 43: google.spannerlib.v1.SpannerLib.ExecuteStreaming:output_type -> google.spannerlib.v1.RowData
+ 26, // 44: google.spannerlib.v1.SpannerLib.ExecuteBatch:output_type -> google.spanner.v1.ExecuteBatchDmlResponse
+ 21, // 45: google.spannerlib.v1.SpannerLib.Metadata:output_type -> google.spanner.v1.ResultSetMetadata
+ 22, // 46: google.spannerlib.v1.SpannerLib.Next:output_type -> google.protobuf.ListValue
+ 23, // 47: google.spannerlib.v1.SpannerLib.ResultSetStats:output_type -> google.spanner.v1.ResultSetStats
+ 25, // 48: google.spannerlib.v1.SpannerLib.CloseRows:output_type -> google.protobuf.Empty
+ 25, // 49: google.spannerlib.v1.SpannerLib.BeginTransaction:output_type -> google.protobuf.Empty
+ 27, // 50: google.spannerlib.v1.SpannerLib.Commit:output_type -> google.spanner.v1.CommitResponse
+ 25, // 51: google.spannerlib.v1.SpannerLib.Rollback:output_type -> google.protobuf.Empty
+ 27, // 52: google.spannerlib.v1.SpannerLib.WriteMutations:output_type -> google.spanner.v1.CommitResponse
+ 16, // 53: google.spannerlib.v1.SpannerLib.ConnectionStream:output_type -> google.spannerlib.v1.ConnectionStreamResponse
+ 37, // [37:54] is the sub-list for method output_type
+ 20, // [20:37] is the sub-list for method input_type
+ 20, // [20:20] is the sub-list for extension type_name
+ 20, // [20:20] is the sub-list for extension extendee
+ 0, // [0:20] is the sub-list for field type_name
+}
+
+func init() { file_google_spannerlib_v1_spannerlib_proto_init() }
+func file_google_spannerlib_v1_spannerlib_proto_init() {
+ if File_google_spannerlib_v1_spannerlib_proto != nil {
+ return
+ }
+ file_google_spannerlib_v1_spannerlib_proto_msgTypes[15].OneofWrappers = []any{
+ (*ConnectionStreamRequest_ExecuteRequest)(nil),
+ }
+ file_google_spannerlib_v1_spannerlib_proto_msgTypes[16].OneofWrappers = []any{
+ (*ConnectionStreamResponse_Row)(nil),
+ }
+ type x struct{}
+ out := protoimpl.TypeBuilder{
+ File: protoimpl.DescBuilder{
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+ RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_spannerlib_v1_spannerlib_proto_rawDesc), len(file_google_spannerlib_v1_spannerlib_proto_rawDesc)),
+ NumEnums: 0,
+ NumMessages: 17,
+ NumExtensions: 0,
+ NumServices: 1,
+ },
+ GoTypes: file_google_spannerlib_v1_spannerlib_proto_goTypes,
+ DependencyIndexes: file_google_spannerlib_v1_spannerlib_proto_depIdxs,
+ MessageInfos: file_google_spannerlib_v1_spannerlib_proto_msgTypes,
+ }.Build()
+ File_google_spannerlib_v1_spannerlib_proto = out.File
+ file_google_spannerlib_v1_spannerlib_proto_goTypes = nil
+ file_google_spannerlib_v1_spannerlib_proto_depIdxs = nil
+}
diff --git a/spannerlib/grpc-server/google/spannerlib/v1/spannerlib.proto b/spannerlib/grpc-server/google/spannerlib/v1/spannerlib.proto
new file mode 100644
index 00000000..57d58b41
--- /dev/null
+++ b/spannerlib/grpc-server/google/spannerlib/v1/spannerlib.proto
@@ -0,0 +1,170 @@
+syntax = "proto3";
+
+package google.spannerlib.v1;
+
+import "google/api/field_behavior.proto";
+import "google/protobuf/empty.proto";
+import "google/protobuf/struct.proto";
+import "google/spanner/v1/result_set.proto";
+import "google/spanner/v1/spanner.proto";
+import "google/spanner/v1/transaction.proto";
+
+option csharp_namespace = "Google.Cloud.SpannerLib.V1";
+option go_package = "cloud.google.com/go/spannerlib/apiv1/spannerlibpb;spannerlibpb";
+option java_multiple_files = true;
+option java_outer_classname = "SpannerLibProto";
+option java_package = "com.google.cloud.spannerlib.v1";
+option php_namespace = "Google\\Cloud\\SpannerLib\\V1";
+option ruby_package = "Google::Cloud::SpannerLib::V1";
+
+service SpannerLib {
+ rpc Info(InfoRequest) returns (InfoResponse) {}
+
+ rpc CreatePool(CreatePoolRequest) returns (Pool) {}
+ rpc ClosePool(Pool) returns (google.protobuf.Empty) {}
+
+ rpc CreateConnection(CreateConnectionRequest) returns (Connection) {}
+ rpc CloseConnection(Connection) returns (google.protobuf.Empty) {}
+
+ rpc Execute(ExecuteRequest) returns (Rows) {}
+ rpc ExecuteStreaming(ExecuteRequest) returns (stream RowData) {}
+ rpc ExecuteBatch(ExecuteBatchRequest) returns (google.spanner.v1.ExecuteBatchDmlResponse) {}
+ rpc Metadata(Rows) returns (google.spanner.v1.ResultSetMetadata) {}
+ rpc Next(NextRequest) returns (google.protobuf.ListValue) {}
+ rpc ResultSetStats(Rows) returns (google.spanner.v1.ResultSetStats) {}
+ rpc CloseRows(Rows) returns (google.protobuf.Empty) {}
+
+ rpc BeginTransaction(BeginTransactionRequest) returns (google.protobuf.Empty) {}
+ rpc Commit(Connection) returns (google.spanner.v1.CommitResponse) {}
+ rpc Rollback(Connection) returns (google.protobuf.Empty) {}
+
+ rpc WriteMutations(WriteMutationsRequest) returns (google.spanner.v1.CommitResponse) {}
+
+ rpc ConnectionStream(stream ConnectionStreamRequest) returns (stream ConnectionStreamResponse) {}
+}
+
+message InfoRequest {
+}
+
+message InfoResponse {
+ string version = 1;
+}
+
+message CreatePoolRequest {
+ string connection_string = 1 [
+ (google.api.field_behavior) = REQUIRED
+ ];
+}
+
+message CreateConnectionRequest {
+ Pool pool = 1 [
+ (google.api.field_behavior) = REQUIRED
+ ];
+}
+
+message ExecuteRequest {
+ Connection connection = 1 [
+ (google.api.field_behavior) = REQUIRED
+ ];
+ google.spanner.v1.ExecuteSqlRequest execute_sql_request = 2 [
+ (google.api.field_behavior) = REQUIRED
+ ];
+}
+
+message ExecuteBatchRequest {
+ Connection connection = 1 [
+ (google.api.field_behavior) = REQUIRED
+ ];
+ google.spanner.v1.ExecuteBatchDmlRequest execute_batch_dml_request = 2 [
+ (google.api.field_behavior) = REQUIRED
+ ];
+}
+
+message BeginTransactionRequest {
+ Connection connection = 1 [
+ (google.api.field_behavior) = REQUIRED
+ ];
+ google.spanner.v1.TransactionOptions transaction_options = 2 [
+ (google.api.field_behavior) = REQUIRED
+ ];
+}
+
+message WriteMutationsRequest {
+ Connection connection = 1 [
+ (google.api.field_behavior) = REQUIRED
+ ];
+ google.spanner.v1.BatchWriteRequest.MutationGroup mutations = 2 [
+ (google.api.field_behavior) = REQUIRED
+ ];
+}
+
+message Pool {
+ int64 id = 1 [
+ (google.api.field_behavior) = REQUIRED
+ ];
+}
+
+message Connection {
+ Pool pool = 1 [
+ (google.api.field_behavior) = REQUIRED
+ ];
+ int64 id = 2 [
+ (google.api.field_behavior) = REQUIRED
+ ];
+}
+
+message Rows {
+ Connection connection = 1 [
+ (google.api.field_behavior) = REQUIRED
+ ];
+ int64 id = 2 [
+ (google.api.field_behavior) = REQUIRED
+ ];
+}
+
+message NextRequest {
+ Rows rows = 1 [
+ (google.api.field_behavior) = REQUIRED
+ ];
+ int64 num_rows = 2 [
+ (google.api.field_behavior) = REQUIRED
+ ];
+ int64 encoding = 3 [
+ (google.api.field_behavior) = REQUIRED
+ ];
+}
+
+message RowData {
+ Rows rows = 1 [
+ (google.api.field_behavior) = REQUIRED
+ ];
+ google.spanner.v1.ResultSetMetadata metadata = 2;
+ repeated google.protobuf.ListValue data = 3 [
+ (google.api.field_behavior) = REQUIRED
+ ];
+ google.spanner.v1.ResultSetStats stats = 4;
+}
+
+message MetadataRequest {
+ Rows rows = 1 [
+ (google.api.field_behavior) = REQUIRED
+ ];
+}
+
+message ResultSetStatsRequest {
+ Rows rows = 1 [
+ (google.api.field_behavior) = REQUIRED
+ ];
+}
+
+message ConnectionStreamRequest {
+ oneof request {
+ ExecuteRequest execute_request = 1;
+ }
+}
+
+message ConnectionStreamResponse {
+ oneof response {
+ google.spanner.v1.PartialResultSet row = 1;
+ }
+}
diff --git a/spannerlib/grpc-server/google/spannerlib/v1/spannerlib_grpc.pb.go b/spannerlib/grpc-server/google/spannerlib/v1/spannerlib_grpc.pb.go
new file mode 100644
index 00000000..b52dd75c
--- /dev/null
+++ b/spannerlib/grpc-server/google/spannerlib/v1/spannerlib_grpc.pb.go
@@ -0,0 +1,730 @@
+// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
+// versions:
+// - protoc-gen-go-grpc v1.5.1
+// - protoc v6.32.1
+// source: google/spannerlib/v1/spannerlib.proto
+
+package spannerlibpb
+
+import (
+ spannerpb "cloud.google.com/go/spanner/apiv1/spannerpb"
+ context "context"
+ grpc "google.golang.org/grpc"
+ codes "google.golang.org/grpc/codes"
+ status "google.golang.org/grpc/status"
+ emptypb "google.golang.org/protobuf/types/known/emptypb"
+ structpb "google.golang.org/protobuf/types/known/structpb"
+)
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the grpc package it is being compiled against.
+// Requires gRPC-Go v1.64.0 or later.
+const _ = grpc.SupportPackageIsVersion9
+
+const (
+ SpannerLib_Info_FullMethodName = "/google.spannerlib.v1.SpannerLib/Info"
+ SpannerLib_CreatePool_FullMethodName = "/google.spannerlib.v1.SpannerLib/CreatePool"
+ SpannerLib_ClosePool_FullMethodName = "/google.spannerlib.v1.SpannerLib/ClosePool"
+ SpannerLib_CreateConnection_FullMethodName = "/google.spannerlib.v1.SpannerLib/CreateConnection"
+ SpannerLib_CloseConnection_FullMethodName = "/google.spannerlib.v1.SpannerLib/CloseConnection"
+ SpannerLib_Execute_FullMethodName = "/google.spannerlib.v1.SpannerLib/Execute"
+ SpannerLib_ExecuteStreaming_FullMethodName = "/google.spannerlib.v1.SpannerLib/ExecuteStreaming"
+ SpannerLib_ExecuteBatch_FullMethodName = "/google.spannerlib.v1.SpannerLib/ExecuteBatch"
+ SpannerLib_Metadata_FullMethodName = "/google.spannerlib.v1.SpannerLib/Metadata"
+ SpannerLib_Next_FullMethodName = "/google.spannerlib.v1.SpannerLib/Next"
+ SpannerLib_ResultSetStats_FullMethodName = "/google.spannerlib.v1.SpannerLib/ResultSetStats"
+ SpannerLib_CloseRows_FullMethodName = "/google.spannerlib.v1.SpannerLib/CloseRows"
+ SpannerLib_BeginTransaction_FullMethodName = "/google.spannerlib.v1.SpannerLib/BeginTransaction"
+ SpannerLib_Commit_FullMethodName = "/google.spannerlib.v1.SpannerLib/Commit"
+ SpannerLib_Rollback_FullMethodName = "/google.spannerlib.v1.SpannerLib/Rollback"
+ SpannerLib_WriteMutations_FullMethodName = "/google.spannerlib.v1.SpannerLib/WriteMutations"
+ SpannerLib_ConnectionStream_FullMethodName = "/google.spannerlib.v1.SpannerLib/ConnectionStream"
+)
+
+// SpannerLibClient is the client API for SpannerLib service.
+//
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
+type SpannerLibClient interface {
+ Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error)
+ CreatePool(ctx context.Context, in *CreatePoolRequest, opts ...grpc.CallOption) (*Pool, error)
+ ClosePool(ctx context.Context, in *Pool, opts ...grpc.CallOption) (*emptypb.Empty, error)
+ CreateConnection(ctx context.Context, in *CreateConnectionRequest, opts ...grpc.CallOption) (*Connection, error)
+ CloseConnection(ctx context.Context, in *Connection, opts ...grpc.CallOption) (*emptypb.Empty, error)
+ Execute(ctx context.Context, in *ExecuteRequest, opts ...grpc.CallOption) (*Rows, error)
+ ExecuteStreaming(ctx context.Context, in *ExecuteRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[RowData], error)
+ ExecuteBatch(ctx context.Context, in *ExecuteBatchRequest, opts ...grpc.CallOption) (*spannerpb.ExecuteBatchDmlResponse, error)
+ Metadata(ctx context.Context, in *Rows, opts ...grpc.CallOption) (*spannerpb.ResultSetMetadata, error)
+ Next(ctx context.Context, in *NextRequest, opts ...grpc.CallOption) (*structpb.ListValue, error)
+ ResultSetStats(ctx context.Context, in *Rows, opts ...grpc.CallOption) (*spannerpb.ResultSetStats, error)
+ CloseRows(ctx context.Context, in *Rows, opts ...grpc.CallOption) (*emptypb.Empty, error)
+ BeginTransaction(ctx context.Context, in *BeginTransactionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
+ Commit(ctx context.Context, in *Connection, opts ...grpc.CallOption) (*spannerpb.CommitResponse, error)
+ Rollback(ctx context.Context, in *Connection, opts ...grpc.CallOption) (*emptypb.Empty, error)
+ WriteMutations(ctx context.Context, in *WriteMutationsRequest, opts ...grpc.CallOption) (*spannerpb.CommitResponse, error)
+ ConnectionStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[ConnectionStreamRequest, ConnectionStreamResponse], error)
+}
+
+type spannerLibClient struct {
+ cc grpc.ClientConnInterface
+}
+
+func NewSpannerLibClient(cc grpc.ClientConnInterface) SpannerLibClient {
+ return &spannerLibClient{cc}
+}
+
+func (c *spannerLibClient) Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error) {
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
+ out := new(InfoResponse)
+ err := c.cc.Invoke(ctx, SpannerLib_Info_FullMethodName, in, out, cOpts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *spannerLibClient) CreatePool(ctx context.Context, in *CreatePoolRequest, opts ...grpc.CallOption) (*Pool, error) {
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
+ out := new(Pool)
+ err := c.cc.Invoke(ctx, SpannerLib_CreatePool_FullMethodName, in, out, cOpts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *spannerLibClient) ClosePool(ctx context.Context, in *Pool, opts ...grpc.CallOption) (*emptypb.Empty, error) {
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
+ out := new(emptypb.Empty)
+ err := c.cc.Invoke(ctx, SpannerLib_ClosePool_FullMethodName, in, out, cOpts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *spannerLibClient) CreateConnection(ctx context.Context, in *CreateConnectionRequest, opts ...grpc.CallOption) (*Connection, error) {
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
+ out := new(Connection)
+ err := c.cc.Invoke(ctx, SpannerLib_CreateConnection_FullMethodName, in, out, cOpts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *spannerLibClient) CloseConnection(ctx context.Context, in *Connection, opts ...grpc.CallOption) (*emptypb.Empty, error) {
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
+ out := new(emptypb.Empty)
+ err := c.cc.Invoke(ctx, SpannerLib_CloseConnection_FullMethodName, in, out, cOpts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *spannerLibClient) Execute(ctx context.Context, in *ExecuteRequest, opts ...grpc.CallOption) (*Rows, error) {
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
+ out := new(Rows)
+ err := c.cc.Invoke(ctx, SpannerLib_Execute_FullMethodName, in, out, cOpts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *spannerLibClient) ExecuteStreaming(ctx context.Context, in *ExecuteRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[RowData], error) {
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
+ stream, err := c.cc.NewStream(ctx, &SpannerLib_ServiceDesc.Streams[0], SpannerLib_ExecuteStreaming_FullMethodName, cOpts...)
+ if err != nil {
+ return nil, err
+ }
+ x := &grpc.GenericClientStream[ExecuteRequest, RowData]{ClientStream: stream}
+ if err := x.ClientStream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err := x.ClientStream.CloseSend(); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
+type SpannerLib_ExecuteStreamingClient = grpc.ServerStreamingClient[RowData]
+
+func (c *spannerLibClient) ExecuteBatch(ctx context.Context, in *ExecuteBatchRequest, opts ...grpc.CallOption) (*spannerpb.ExecuteBatchDmlResponse, error) {
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
+ out := new(spannerpb.ExecuteBatchDmlResponse)
+ err := c.cc.Invoke(ctx, SpannerLib_ExecuteBatch_FullMethodName, in, out, cOpts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *spannerLibClient) Metadata(ctx context.Context, in *Rows, opts ...grpc.CallOption) (*spannerpb.ResultSetMetadata, error) {
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
+ out := new(spannerpb.ResultSetMetadata)
+ err := c.cc.Invoke(ctx, SpannerLib_Metadata_FullMethodName, in, out, cOpts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *spannerLibClient) Next(ctx context.Context, in *NextRequest, opts ...grpc.CallOption) (*structpb.ListValue, error) {
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
+ out := new(structpb.ListValue)
+ err := c.cc.Invoke(ctx, SpannerLib_Next_FullMethodName, in, out, cOpts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *spannerLibClient) ResultSetStats(ctx context.Context, in *Rows, opts ...grpc.CallOption) (*spannerpb.ResultSetStats, error) {
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
+ out := new(spannerpb.ResultSetStats)
+ err := c.cc.Invoke(ctx, SpannerLib_ResultSetStats_FullMethodName, in, out, cOpts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *spannerLibClient) CloseRows(ctx context.Context, in *Rows, opts ...grpc.CallOption) (*emptypb.Empty, error) {
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
+ out := new(emptypb.Empty)
+ err := c.cc.Invoke(ctx, SpannerLib_CloseRows_FullMethodName, in, out, cOpts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *spannerLibClient) BeginTransaction(ctx context.Context, in *BeginTransactionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
+ out := new(emptypb.Empty)
+ err := c.cc.Invoke(ctx, SpannerLib_BeginTransaction_FullMethodName, in, out, cOpts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *spannerLibClient) Commit(ctx context.Context, in *Connection, opts ...grpc.CallOption) (*spannerpb.CommitResponse, error) {
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
+ out := new(spannerpb.CommitResponse)
+ err := c.cc.Invoke(ctx, SpannerLib_Commit_FullMethodName, in, out, cOpts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *spannerLibClient) Rollback(ctx context.Context, in *Connection, opts ...grpc.CallOption) (*emptypb.Empty, error) {
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
+ out := new(emptypb.Empty)
+ err := c.cc.Invoke(ctx, SpannerLib_Rollback_FullMethodName, in, out, cOpts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *spannerLibClient) WriteMutations(ctx context.Context, in *WriteMutationsRequest, opts ...grpc.CallOption) (*spannerpb.CommitResponse, error) {
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
+ out := new(spannerpb.CommitResponse)
+ err := c.cc.Invoke(ctx, SpannerLib_WriteMutations_FullMethodName, in, out, cOpts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *spannerLibClient) ConnectionStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[ConnectionStreamRequest, ConnectionStreamResponse], error) {
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
+ stream, err := c.cc.NewStream(ctx, &SpannerLib_ServiceDesc.Streams[1], SpannerLib_ConnectionStream_FullMethodName, cOpts...)
+ if err != nil {
+ return nil, err
+ }
+ x := &grpc.GenericClientStream[ConnectionStreamRequest, ConnectionStreamResponse]{ClientStream: stream}
+ return x, nil
+}
+
+// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
+type SpannerLib_ConnectionStreamClient = grpc.BidiStreamingClient[ConnectionStreamRequest, ConnectionStreamResponse]
+
+// SpannerLibServer is the server API for SpannerLib service.
+// All implementations must embed UnimplementedSpannerLibServer
+// for forward compatibility.
+type SpannerLibServer interface {
+ Info(context.Context, *InfoRequest) (*InfoResponse, error)
+ CreatePool(context.Context, *CreatePoolRequest) (*Pool, error)
+ ClosePool(context.Context, *Pool) (*emptypb.Empty, error)
+ CreateConnection(context.Context, *CreateConnectionRequest) (*Connection, error)
+ CloseConnection(context.Context, *Connection) (*emptypb.Empty, error)
+ Execute(context.Context, *ExecuteRequest) (*Rows, error)
+ ExecuteStreaming(*ExecuteRequest, grpc.ServerStreamingServer[RowData]) error
+ ExecuteBatch(context.Context, *ExecuteBatchRequest) (*spannerpb.ExecuteBatchDmlResponse, error)
+ Metadata(context.Context, *Rows) (*spannerpb.ResultSetMetadata, error)
+ Next(context.Context, *NextRequest) (*structpb.ListValue, error)
+ ResultSetStats(context.Context, *Rows) (*spannerpb.ResultSetStats, error)
+ CloseRows(context.Context, *Rows) (*emptypb.Empty, error)
+ BeginTransaction(context.Context, *BeginTransactionRequest) (*emptypb.Empty, error)
+ Commit(context.Context, *Connection) (*spannerpb.CommitResponse, error)
+ Rollback(context.Context, *Connection) (*emptypb.Empty, error)
+ WriteMutations(context.Context, *WriteMutationsRequest) (*spannerpb.CommitResponse, error)
+ ConnectionStream(grpc.BidiStreamingServer[ConnectionStreamRequest, ConnectionStreamResponse]) error
+ mustEmbedUnimplementedSpannerLibServer()
+}
+
+// UnimplementedSpannerLibServer must be embedded to have
+// forward compatible implementations.
+//
+// NOTE: this should be embedded by value instead of pointer to avoid a nil
+// pointer dereference when methods are called.
+type UnimplementedSpannerLibServer struct{}
+
+func (UnimplementedSpannerLibServer) Info(context.Context, *InfoRequest) (*InfoResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method Info not implemented")
+}
+func (UnimplementedSpannerLibServer) CreatePool(context.Context, *CreatePoolRequest) (*Pool, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method CreatePool not implemented")
+}
+func (UnimplementedSpannerLibServer) ClosePool(context.Context, *Pool) (*emptypb.Empty, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method ClosePool not implemented")
+}
+func (UnimplementedSpannerLibServer) CreateConnection(context.Context, *CreateConnectionRequest) (*Connection, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method CreateConnection not implemented")
+}
+func (UnimplementedSpannerLibServer) CloseConnection(context.Context, *Connection) (*emptypb.Empty, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method CloseConnection not implemented")
+}
+func (UnimplementedSpannerLibServer) Execute(context.Context, *ExecuteRequest) (*Rows, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method Execute not implemented")
+}
+func (UnimplementedSpannerLibServer) ExecuteStreaming(*ExecuteRequest, grpc.ServerStreamingServer[RowData]) error {
+ return status.Errorf(codes.Unimplemented, "method ExecuteStreaming not implemented")
+}
+func (UnimplementedSpannerLibServer) ExecuteBatch(context.Context, *ExecuteBatchRequest) (*spannerpb.ExecuteBatchDmlResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method ExecuteBatch not implemented")
+}
+func (UnimplementedSpannerLibServer) Metadata(context.Context, *Rows) (*spannerpb.ResultSetMetadata, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method Metadata not implemented")
+}
+func (UnimplementedSpannerLibServer) Next(context.Context, *NextRequest) (*structpb.ListValue, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method Next not implemented")
+}
+func (UnimplementedSpannerLibServer) ResultSetStats(context.Context, *Rows) (*spannerpb.ResultSetStats, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method ResultSetStats not implemented")
+}
+func (UnimplementedSpannerLibServer) CloseRows(context.Context, *Rows) (*emptypb.Empty, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method CloseRows not implemented")
+}
+func (UnimplementedSpannerLibServer) BeginTransaction(context.Context, *BeginTransactionRequest) (*emptypb.Empty, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method BeginTransaction not implemented")
+}
+func (UnimplementedSpannerLibServer) Commit(context.Context, *Connection) (*spannerpb.CommitResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method Commit not implemented")
+}
+func (UnimplementedSpannerLibServer) Rollback(context.Context, *Connection) (*emptypb.Empty, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method Rollback not implemented")
+}
+func (UnimplementedSpannerLibServer) WriteMutations(context.Context, *WriteMutationsRequest) (*spannerpb.CommitResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method WriteMutations not implemented")
+}
+func (UnimplementedSpannerLibServer) ConnectionStream(grpc.BidiStreamingServer[ConnectionStreamRequest, ConnectionStreamResponse]) error {
+ return status.Errorf(codes.Unimplemented, "method ConnectionStream not implemented")
+}
+func (UnimplementedSpannerLibServer) mustEmbedUnimplementedSpannerLibServer() {}
+func (UnimplementedSpannerLibServer) testEmbeddedByValue() {}
+
+// UnsafeSpannerLibServer may be embedded to opt out of forward compatibility for this service.
+// Use of this interface is not recommended, as added methods to SpannerLibServer will
+// result in compilation errors.
+type UnsafeSpannerLibServer interface {
+ mustEmbedUnimplementedSpannerLibServer()
+}
+
+func RegisterSpannerLibServer(s grpc.ServiceRegistrar, srv SpannerLibServer) {
+ // If the following call pancis, it indicates UnimplementedSpannerLibServer was
+ // embedded by pointer and is nil. This will cause panics if an
+ // unimplemented method is ever invoked, so we test this at initialization
+ // time to prevent it from happening at runtime later due to I/O.
+ if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
+ t.testEmbeddedByValue()
+ }
+ s.RegisterService(&SpannerLib_ServiceDesc, srv)
+}
+
+func _SpannerLib_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(InfoRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(SpannerLibServer).Info(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: SpannerLib_Info_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(SpannerLibServer).Info(ctx, req.(*InfoRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _SpannerLib_CreatePool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(CreatePoolRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(SpannerLibServer).CreatePool(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: SpannerLib_CreatePool_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(SpannerLibServer).CreatePool(ctx, req.(*CreatePoolRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _SpannerLib_ClosePool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(Pool)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(SpannerLibServer).ClosePool(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: SpannerLib_ClosePool_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(SpannerLibServer).ClosePool(ctx, req.(*Pool))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _SpannerLib_CreateConnection_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(CreateConnectionRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(SpannerLibServer).CreateConnection(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: SpannerLib_CreateConnection_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(SpannerLibServer).CreateConnection(ctx, req.(*CreateConnectionRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _SpannerLib_CloseConnection_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(Connection)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(SpannerLibServer).CloseConnection(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: SpannerLib_CloseConnection_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(SpannerLibServer).CloseConnection(ctx, req.(*Connection))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _SpannerLib_Execute_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(ExecuteRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(SpannerLibServer).Execute(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: SpannerLib_Execute_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(SpannerLibServer).Execute(ctx, req.(*ExecuteRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _SpannerLib_ExecuteStreaming_Handler(srv interface{}, stream grpc.ServerStream) error {
+ m := new(ExecuteRequest)
+ if err := stream.RecvMsg(m); err != nil {
+ return err
+ }
+ return srv.(SpannerLibServer).ExecuteStreaming(m, &grpc.GenericServerStream[ExecuteRequest, RowData]{ServerStream: stream})
+}
+
+// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
+type SpannerLib_ExecuteStreamingServer = grpc.ServerStreamingServer[RowData]
+
+func _SpannerLib_ExecuteBatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(ExecuteBatchRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(SpannerLibServer).ExecuteBatch(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: SpannerLib_ExecuteBatch_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(SpannerLibServer).ExecuteBatch(ctx, req.(*ExecuteBatchRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _SpannerLib_Metadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(Rows)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(SpannerLibServer).Metadata(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: SpannerLib_Metadata_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(SpannerLibServer).Metadata(ctx, req.(*Rows))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _SpannerLib_Next_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(NextRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(SpannerLibServer).Next(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: SpannerLib_Next_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(SpannerLibServer).Next(ctx, req.(*NextRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _SpannerLib_ResultSetStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(Rows)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(SpannerLibServer).ResultSetStats(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: SpannerLib_ResultSetStats_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(SpannerLibServer).ResultSetStats(ctx, req.(*Rows))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _SpannerLib_CloseRows_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(Rows)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(SpannerLibServer).CloseRows(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: SpannerLib_CloseRows_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(SpannerLibServer).CloseRows(ctx, req.(*Rows))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _SpannerLib_BeginTransaction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(BeginTransactionRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(SpannerLibServer).BeginTransaction(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: SpannerLib_BeginTransaction_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(SpannerLibServer).BeginTransaction(ctx, req.(*BeginTransactionRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _SpannerLib_Commit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(Connection)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(SpannerLibServer).Commit(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: SpannerLib_Commit_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(SpannerLibServer).Commit(ctx, req.(*Connection))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _SpannerLib_Rollback_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(Connection)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(SpannerLibServer).Rollback(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: SpannerLib_Rollback_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(SpannerLibServer).Rollback(ctx, req.(*Connection))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _SpannerLib_WriteMutations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(WriteMutationsRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(SpannerLibServer).WriteMutations(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: SpannerLib_WriteMutations_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(SpannerLibServer).WriteMutations(ctx, req.(*WriteMutationsRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _SpannerLib_ConnectionStream_Handler(srv interface{}, stream grpc.ServerStream) error {
+ return srv.(SpannerLibServer).ConnectionStream(&grpc.GenericServerStream[ConnectionStreamRequest, ConnectionStreamResponse]{ServerStream: stream})
+}
+
+// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
+type SpannerLib_ConnectionStreamServer = grpc.BidiStreamingServer[ConnectionStreamRequest, ConnectionStreamResponse]
+
+// SpannerLib_ServiceDesc is the grpc.ServiceDesc for SpannerLib service.
+// It's only intended for direct use with grpc.RegisterService,
+// and not to be introspected or modified (even as a copy)
+var SpannerLib_ServiceDesc = grpc.ServiceDesc{
+ ServiceName: "google.spannerlib.v1.SpannerLib",
+ HandlerType: (*SpannerLibServer)(nil),
+ Methods: []grpc.MethodDesc{
+ {
+ MethodName: "Info",
+ Handler: _SpannerLib_Info_Handler,
+ },
+ {
+ MethodName: "CreatePool",
+ Handler: _SpannerLib_CreatePool_Handler,
+ },
+ {
+ MethodName: "ClosePool",
+ Handler: _SpannerLib_ClosePool_Handler,
+ },
+ {
+ MethodName: "CreateConnection",
+ Handler: _SpannerLib_CreateConnection_Handler,
+ },
+ {
+ MethodName: "CloseConnection",
+ Handler: _SpannerLib_CloseConnection_Handler,
+ },
+ {
+ MethodName: "Execute",
+ Handler: _SpannerLib_Execute_Handler,
+ },
+ {
+ MethodName: "ExecuteBatch",
+ Handler: _SpannerLib_ExecuteBatch_Handler,
+ },
+ {
+ MethodName: "Metadata",
+ Handler: _SpannerLib_Metadata_Handler,
+ },
+ {
+ MethodName: "Next",
+ Handler: _SpannerLib_Next_Handler,
+ },
+ {
+ MethodName: "ResultSetStats",
+ Handler: _SpannerLib_ResultSetStats_Handler,
+ },
+ {
+ MethodName: "CloseRows",
+ Handler: _SpannerLib_CloseRows_Handler,
+ },
+ {
+ MethodName: "BeginTransaction",
+ Handler: _SpannerLib_BeginTransaction_Handler,
+ },
+ {
+ MethodName: "Commit",
+ Handler: _SpannerLib_Commit_Handler,
+ },
+ {
+ MethodName: "Rollback",
+ Handler: _SpannerLib_Rollback_Handler,
+ },
+ {
+ MethodName: "WriteMutations",
+ Handler: _SpannerLib_WriteMutations_Handler,
+ },
+ },
+ Streams: []grpc.StreamDesc{
+ {
+ StreamName: "ExecuteStreaming",
+ Handler: _SpannerLib_ExecuteStreaming_Handler,
+ ServerStreams: true,
+ },
+ {
+ StreamName: "ConnectionStream",
+ Handler: _SpannerLib_ConnectionStream_Handler,
+ ServerStreams: true,
+ ClientStreams: true,
+ },
+ },
+ Metadata: "google/spannerlib/v1/spannerlib.proto",
+}
diff --git a/spannerlib/grpc-server/googleapis b/spannerlib/grpc-server/googleapis
new file mode 160000
index 00000000..e9078581
--- /dev/null
+++ b/spannerlib/grpc-server/googleapis
@@ -0,0 +1 @@
+Subproject commit e9078581209139d142aad60322b6e09f565eae41
diff --git a/spannerlib/grpc-server/server.go b/spannerlib/grpc-server/server.go
new file mode 100644
index 00000000..fee05d7b
--- /dev/null
+++ b/spannerlib/grpc-server/server.go
@@ -0,0 +1,234 @@
+package main
+
+import (
+ "context"
+ "log"
+ "math"
+ "net"
+ "os"
+
+ "cloud.google.com/go/spanner/apiv1/spannerpb"
+ "google.golang.org/grpc"
+ "google.golang.org/protobuf/types/known/emptypb"
+ "google.golang.org/protobuf/types/known/structpb"
+ "spannerlib/api"
+ pb "spannerlib/grpc-server/google/spannerlib/v1"
+)
+
+func main() {
+ if len(os.Args) < 2 {
+ log.Fatalf("Missing gRPC server address\n")
+ }
+ name := os.Args[1]
+ tp := "unix"
+ if len(os.Args) > 2 {
+ tp = os.Args[2]
+ }
+ if tp == "unix" {
+ defer func() { _ = os.Remove(name) }()
+ }
+ lis, err := net.Listen(tp, name)
+ if err != nil {
+ log.Fatalf("failed to listen: %v\n", err)
+ }
+ grpcServer := grpc.NewServer(grpc.MaxRecvMsgSize(math.MaxInt32))
+
+ server := spannerLibServer{}
+ pb.RegisterSpannerLibServer(grpcServer, &server)
+ log.Printf("Starting gRPC server on %s\n", lis.Addr().String())
+ err = grpcServer.Serve(lis)
+ if err != nil {
+ log.Printf("failed to serve: %v\n", err)
+ }
+}
+
+var _ pb.SpannerLibServer = &spannerLibServer{}
+
+type spannerLibServer struct {
+ pb.UnimplementedSpannerLibServer
+}
+
+func (s *spannerLibServer) Info(_ context.Context, _ *pb.InfoRequest) (*pb.InfoResponse, error) {
+ return &pb.InfoResponse{}, nil
+}
+
+func (s *spannerLibServer) CreatePool(ctx context.Context, request *pb.CreatePoolRequest) (*pb.Pool, error) {
+ id, err := api.CreatePool(ctx, request.ConnectionString)
+ if err != nil {
+ return nil, err
+ }
+ return &pb.Pool{Id: id}, nil
+}
+
+func (s *spannerLibServer) ClosePool(ctx context.Context, pool *pb.Pool) (*emptypb.Empty, error) {
+ err := api.ClosePool(ctx, pool.Id)
+ if err != nil {
+ return nil, err
+ }
+ return &emptypb.Empty{}, nil
+}
+
+func (s *spannerLibServer) CreateConnection(ctx context.Context, request *pb.CreateConnectionRequest) (*pb.Connection, error) {
+ id, err := api.CreateConnection(ctx, request.Pool.Id)
+ if err != nil {
+ return nil, err
+ }
+ return &pb.Connection{Pool: request.Pool, Id: id}, nil
+}
+
+func (s *spannerLibServer) CloseConnection(ctx context.Context, connection *pb.Connection) (*emptypb.Empty, error) {
+ err := api.CloseConnection(ctx, connection.Pool.Id, connection.Id)
+ if err != nil {
+ return nil, err
+ }
+ return &emptypb.Empty{}, nil
+}
+
+func contextWithSameDeadline(ctx context.Context) context.Context {
+ newContext := context.Background()
+ if deadline, ok := ctx.Deadline(); ok {
+ // Ignore the returned cancel function here, as the context will be closed when the Rows object is closed.
+ //goland:noinspection GoVetLostCancel
+ newContext, _ = context.WithDeadline(newContext, deadline)
+ }
+ return newContext
+}
+
+func (s *spannerLibServer) Execute(ctx context.Context, request *pb.ExecuteRequest) (*pb.Rows, error) {
+ // Create a new context that is used for the query. We need to do this, because the context that is passed in to
+ // this function will be cancelled once the RPC call finishes. That again would cause further calls to Next on the
+ // underlying rows object to fail with a 'Context cancelled' error.
+ queryContext := contextWithSameDeadline(ctx)
+ id, err := api.Execute(queryContext, request.Connection.Pool.Id, request.Connection.Id, request.ExecuteSqlRequest)
+ if err != nil {
+ return nil, err
+ }
+ return &pb.Rows{Connection: request.Connection, Id: id}, nil
+}
+
+func (s *spannerLibServer) ExecuteStreaming(request *pb.ExecuteRequest, stream grpc.ServerStreamingServer[pb.RowData]) error {
+ queryContext := contextWithSameDeadline(stream.Context())
+ id, err := api.Execute(queryContext, request.Connection.Pool.Id, request.Connection.Id, request.ExecuteSqlRequest)
+ if err != nil {
+ return err
+ }
+ defer func() { _ = api.CloseRows(queryContext, request.Connection.Pool.Id, request.Connection.Id, id) }()
+ rows := &pb.Rows{Connection: request.Connection, Id: id}
+ metadata, err := api.Metadata(queryContext, request.Connection.Pool.Id, request.Connection.Id, id)
+ if err != nil {
+ return err
+ }
+ first := true
+ for {
+ if row, err := api.Next(queryContext, request.Connection.Pool.Id, request.Connection.Id, id); err != nil {
+ return err
+ } else {
+ if row == nil {
+ stats, err := api.ResultSetStats(queryContext, request.Connection.Pool.Id, request.Connection.Id, id)
+ if err != nil {
+ return err
+ }
+ res := &pb.RowData{Rows: rows, Stats: stats}
+ if first {
+ res.Metadata = metadata
+ first = false
+ }
+ if err := stream.Send(res); err != nil {
+ return err
+ }
+ break
+ }
+ res := &pb.RowData{Rows: rows, Data: []*structpb.ListValue{row}}
+ if first {
+ res.Metadata = metadata
+ first = false
+ }
+ if err := stream.Send(res); err != nil {
+ return err
+ }
+ }
+ }
+ return nil
+}
+
+func (s *spannerLibServer) ExecuteBatch(ctx context.Context, request *pb.ExecuteBatchRequest) (*spannerpb.ExecuteBatchDmlResponse, error) {
+ resp, err := api.ExecuteBatch(ctx, request.Connection.Pool.Id, request.Connection.Id, request.ExecuteBatchDmlRequest)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (s *spannerLibServer) Metadata(ctx context.Context, rows *pb.Rows) (*spannerpb.ResultSetMetadata, error) {
+ metadata, err := api.Metadata(ctx, rows.Connection.Pool.Id, rows.Connection.Id, rows.Id)
+ if err != nil {
+ return nil, err
+ }
+ return metadata, nil
+}
+
+func (s *spannerLibServer) Next(ctx context.Context, request *pb.NextRequest) (*structpb.ListValue, error) {
+ // TODO: Pass in numRows and encoding option.
+ values, err := api.Next(ctx, request.Rows.Connection.Pool.Id, request.Rows.Connection.Id, request.Rows.Id)
+ if err != nil {
+ return nil, err
+ }
+ return values, nil
+}
+
+func (s *spannerLibServer) ResultSetStats(ctx context.Context, rows *pb.Rows) (*spannerpb.ResultSetStats, error) {
+ stats, err := api.ResultSetStats(ctx, rows.Connection.Pool.Id, rows.Connection.Id, rows.Id)
+ if err != nil {
+ return nil, err
+ }
+ return stats, nil
+}
+
+func (s *spannerLibServer) CloseRows(ctx context.Context, rows *pb.Rows) (*emptypb.Empty, error) {
+ err := api.CloseRows(ctx, rows.Connection.Pool.Id, rows.Connection.Id, rows.Id)
+ if err != nil {
+ return nil, err
+ }
+ return &emptypb.Empty{}, nil
+}
+
+func (s *spannerLibServer) BeginTransaction(ctx context.Context, request *pb.BeginTransactionRequest) (*emptypb.Empty, error) {
+ // Create a new context that is used for the transaction. We need to do this, because the context that is passed in
+ // to this function will be cancelled once the RPC call finishes. That again would cause further calls on
+ // the underlying transaction to fail with a 'Context cancelled' error.
+ txContext := context.Background()
+ if deadline, ok := ctx.Deadline(); ok {
+ // Ignore the returned cancel function here, as the context will be closed when the transaction is closed.
+ //goland:noinspection GoVetLostCancel
+ txContext, _ = context.WithDeadline(txContext, deadline)
+ }
+ err := api.BeginTransaction(txContext, request.Connection.Pool.Id, request.Connection.Id, request.TransactionOptions)
+ if err != nil {
+ return nil, err
+ }
+ return &emptypb.Empty{}, nil
+}
+
+func (s *spannerLibServer) Commit(ctx context.Context, connection *pb.Connection) (*spannerpb.CommitResponse, error) {
+ resp, err := api.Commit(ctx, connection.Pool.Id, connection.Id)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (s *spannerLibServer) Rollback(ctx context.Context, connection *pb.Connection) (*emptypb.Empty, error) {
+ err := api.Rollback(ctx, connection.Pool.Id, connection.Id)
+ if err != nil {
+ return nil, err
+ }
+ return &emptypb.Empty{}, nil
+}
+
+func (s *spannerLibServer) WriteMutations(ctx context.Context, request *pb.WriteMutationsRequest) (*spannerpb.CommitResponse, error) {
+ resp, err := api.WriteMutations(ctx, request.Connection.Pool.Id, request.Connection.Id, request.Mutations)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
diff --git a/spannerlib/grpc-server/server_test.go b/spannerlib/grpc-server/server_test.go
new file mode 100644
index 00000000..1b8faf48
--- /dev/null
+++ b/spannerlib/grpc-server/server_test.go
@@ -0,0 +1,526 @@
+package main
+
+import (
+ "context"
+ "fmt"
+ "net"
+ "os"
+ "path/filepath"
+ "reflect"
+ "runtime"
+ "testing"
+
+ "cloud.google.com/go/spanner/admin/database/apiv1/databasepb"
+ sppb "cloud.google.com/go/spanner/apiv1/spannerpb"
+ "github.com/google/uuid"
+ "github.com/googleapis/go-sql-spanner/testutil"
+ "google.golang.org/grpc"
+ "google.golang.org/grpc/credentials/insecure"
+ "google.golang.org/protobuf/types/known/structpb"
+ pb "spannerlib/grpc-server/google/spannerlib/v1"
+)
+
+func TestCreatePool(t *testing.T) {
+ t.Parallel()
+ ctx := context.Background()
+
+ server, teardown := setupMockSpannerServer(t)
+ defer teardown()
+ dsn := fmt.Sprintf("%s/projects/p/instances/i/databases/d?useplaintext=true", server.Address)
+
+ client, cleanup := startTestSpannerLibServer(t)
+ defer cleanup()
+
+ pool, err := client.CreatePool(ctx, &pb.CreatePoolRequest{ConnectionString: dsn})
+ if err != nil {
+ t.Fatalf("failed to create pool: %v", err)
+ }
+ if pool.Id <= 0 {
+ t.Fatalf("pool id should be greater than zero")
+ }
+
+ if _, err := client.ClosePool(ctx, pool); err != nil {
+ t.Fatalf("failed to close pool: %v", err)
+ }
+}
+
+func TestCreateConnection(t *testing.T) {
+ t.Parallel()
+ ctx := context.Background()
+
+ server, teardown := setupMockSpannerServer(t)
+ defer teardown()
+ dsn := fmt.Sprintf("%s/projects/p/instances/i/databases/d?useplaintext=true", server.Address)
+
+ client, cleanup := startTestSpannerLibServer(t)
+ defer cleanup()
+
+ pool, err := client.CreatePool(ctx, &pb.CreatePoolRequest{ConnectionString: dsn})
+ if err != nil {
+ t.Fatalf("failed to create pool: %v", err)
+ }
+ connection, err := client.CreateConnection(ctx, &pb.CreateConnectionRequest{Pool: pool})
+ if err != nil {
+ t.Fatalf("failed to create connection: %v", err)
+ }
+ if connection.Id <= 0 {
+ t.Fatalf("connection id should be greater than zero")
+ }
+
+ if _, err := client.CloseConnection(ctx, connection); err != nil {
+ t.Fatalf("failed to close connection: %v", err)
+ }
+ if _, err := client.ClosePool(ctx, pool); err != nil {
+ t.Fatalf("failed to close pool: %v", err)
+ }
+}
+
+func TestExecute(t *testing.T) {
+ t.Parallel()
+ ctx := context.Background()
+
+ server, teardown := setupMockSpannerServer(t)
+ defer teardown()
+ dsn := fmt.Sprintf("%s/projects/p/instances/i/databases/d?useplaintext=true", server.Address)
+
+ client, cleanup := startTestSpannerLibServer(t)
+ defer cleanup()
+
+ pool, err := client.CreatePool(ctx, &pb.CreatePoolRequest{ConnectionString: dsn})
+ if err != nil {
+ t.Fatalf("failed to create pool: %v", err)
+ }
+ connection, err := client.CreateConnection(ctx, &pb.CreateConnectionRequest{Pool: pool})
+ if err != nil {
+ t.Fatalf("failed to create connection: %v", err)
+ }
+ rows, err := client.Execute(ctx, &pb.ExecuteRequest{
+ Connection: connection,
+ ExecuteSqlRequest: &sppb.ExecuteSqlRequest{Sql: testutil.SelectFooFromBar},
+ })
+ if err != nil {
+ t.Fatalf("failed to execute: %v", err)
+ }
+ metadata, err := client.Metadata(ctx, rows)
+ if err != nil {
+ t.Fatalf("failed to get metadata: %v", err)
+ }
+ if g, w := len(metadata.RowType.Fields), 1; g != w {
+ t.Fatalf("num fields mismatch\n Got: %d\nWant: %d", g, w)
+ }
+
+ numRows := 0
+ for {
+ row, err := client.Next(ctx, &pb.NextRequest{Rows: rows, NumRows: 1})
+ if err != nil {
+ t.Fatalf("failed to fetch next row: %v", err)
+ }
+ if row.Values == nil {
+ break
+ }
+ if g, w := len(row.Values), 1; g != w {
+ t.Fatalf("num values mismatch\n Got: %v\nWant: %v", g, w)
+ }
+ numRows++
+ }
+ if g, w := numRows, 2; g != w {
+ t.Fatalf("num rows mismatch\n Got: %v\nWant: %v", g, w)
+ }
+ stats, err := client.ResultSetStats(ctx, rows)
+ if err != nil {
+ t.Fatalf("failed to get stats: %v", err)
+ }
+ if g, w := stats.GetRowCountExact(), int64(0); g != w {
+ t.Fatalf("row count mismatch\n Got: %v\nWant: %v", g, w)
+ }
+ if _, err := client.CloseRows(ctx, rows); err != nil {
+ t.Fatalf("failed to close rows: %v", err)
+ }
+
+ if _, err := client.ClosePool(ctx, pool); err != nil {
+ t.Fatalf("failed to close pool: %v", err)
+ }
+}
+
+func TestExecuteStreaming(t *testing.T) {
+ t.Parallel()
+ ctx := context.Background()
+
+ server, teardown := setupMockSpannerServer(t)
+ defer teardown()
+ dsn := fmt.Sprintf("%s/projects/p/instances/i/databases/d?useplaintext=true", server.Address)
+
+ client, cleanup := startTestSpannerLibServer(t)
+ defer cleanup()
+
+ pool, err := client.CreatePool(ctx, &pb.CreatePoolRequest{ConnectionString: dsn})
+ if err != nil {
+ t.Fatalf("failed to create pool: %v", err)
+ }
+ connection, err := client.CreateConnection(ctx, &pb.CreateConnectionRequest{Pool: pool})
+ if err != nil {
+ t.Fatalf("failed to create connection: %v", err)
+ }
+ stream, err := client.ExecuteStreaming(ctx, &pb.ExecuteRequest{
+ Connection: connection,
+ ExecuteSqlRequest: &sppb.ExecuteSqlRequest{Sql: testutil.SelectFooFromBar},
+ })
+ if err != nil {
+ t.Fatalf("failed to execute: %v", err)
+ }
+ numRows := 0
+ for {
+ row, err := stream.Recv()
+ if err != nil {
+ t.Fatalf("failed to receive row: %v", err)
+ }
+ if len(row.Data) == 0 {
+ break
+ }
+ if g, w := len(row.Data), 1; g != w {
+ t.Fatalf("num rows mismatch\n Got: %v\nWant: %v", g, w)
+ }
+ if g, w := len(row.Data[0].Values), 1; g != w {
+ t.Fatalf("num values mismatch\n Got: %v\nWant: %v", g, w)
+ }
+ numRows++
+ }
+ if g, w := numRows, 2; g != w {
+ t.Fatalf("num rows mismatch\n Got: %v\nWant: %v", g, w)
+ }
+
+ if _, err := client.ClosePool(ctx, pool); err != nil {
+ t.Fatalf("failed to close pool: %v", err)
+ }
+}
+
+func TestExecuteStreamingClientSideStatement(t *testing.T) {
+ t.Parallel()
+ ctx := context.Background()
+
+ server, teardown := setupMockSpannerServer(t)
+ defer teardown()
+ dsn := fmt.Sprintf("%s/projects/p/instances/i/databases/d?useplaintext=true", server.Address)
+
+ client, cleanup := startTestSpannerLibServer(t)
+ defer cleanup()
+
+ pool, err := client.CreatePool(ctx, &pb.CreatePoolRequest{ConnectionString: dsn})
+ if err != nil {
+ t.Fatalf("failed to create pool: %v", err)
+ }
+ connection, err := client.CreateConnection(ctx, &pb.CreateConnectionRequest{Pool: pool})
+ if err != nil {
+ t.Fatalf("failed to create connection: %v", err)
+ }
+ stream, err := client.ExecuteStreaming(ctx, &pb.ExecuteRequest{
+ Connection: connection,
+ ExecuteSqlRequest: &sppb.ExecuteSqlRequest{Sql: "begin"},
+ })
+ if err != nil {
+ t.Fatalf("failed to execute: %v", err)
+ }
+ for {
+ row, err := stream.Recv()
+ if err != nil {
+ t.Fatalf("failed to receive row: %v", err)
+ }
+ if len(row.Data) == 0 {
+ break
+ }
+ }
+ stream, err = client.ExecuteStreaming(context.Background(), &pb.ExecuteRequest{
+ Connection: connection,
+ ExecuteSqlRequest: &sppb.ExecuteSqlRequest{Sql: "commit"},
+ })
+ if err != nil {
+ t.Fatalf("failed to execute: %v", err)
+ }
+ for {
+ row, err := stream.Recv()
+ if err != nil {
+ t.Fatalf("failed to receive row: %v", err)
+ }
+ if len(row.Data) == 0 {
+ break
+ }
+ }
+
+ if _, err := client.ClosePool(ctx, pool); err != nil {
+ t.Fatalf("failed to close pool: %v", err)
+ }
+}
+
+func TestExecuteBatch(t *testing.T) {
+ t.Parallel()
+ ctx := context.Background()
+
+ server, teardown := setupMockSpannerServer(t)
+ defer teardown()
+ dsn := fmt.Sprintf("%s/projects/p/instances/i/databases/d?useplaintext=true;retryAbortsInternally=false", server.Address)
+
+ client, cleanup := startTestSpannerLibServer(t)
+ defer cleanup()
+
+ pool, err := client.CreatePool(ctx, &pb.CreatePoolRequest{ConnectionString: dsn})
+ if err != nil {
+ t.Fatalf("failed to create pool: %v", err)
+ }
+ connection, err := client.CreateConnection(ctx, &pb.CreateConnectionRequest{Pool: pool})
+ if err != nil {
+ t.Fatalf("failed to create connection: %v", err)
+ }
+ if _, err := client.BeginTransaction(ctx, &pb.BeginTransactionRequest{Connection: connection}); err != nil {
+ t.Fatalf("failed to begin transaction: %v", err)
+ }
+
+ resp, err := client.ExecuteBatch(ctx, &pb.ExecuteBatchRequest{
+ Connection: connection,
+ ExecuteBatchDmlRequest: &sppb.ExecuteBatchDmlRequest{
+ Statements: []*sppb.ExecuteBatchDmlRequest_Statement{
+ {Sql: testutil.UpdateBarSetFoo},
+ {Sql: testutil.UpdateBarSetFoo},
+ },
+ },
+ })
+ if err != nil {
+ t.Fatalf("failed to execute batch: %v", err)
+ }
+ if g, w := len(resp.ResultSets), 2; g != w {
+ t.Fatalf("num results mismatch\n Got: %v\nWant: %v", g, w)
+ }
+ if _, err := client.Commit(ctx, connection); err != nil {
+ t.Fatalf("failed to commit: %v", err)
+ }
+
+ if _, err := client.ClosePool(ctx, pool); err != nil {
+ t.Fatalf("failed to close pool: %v", err)
+ }
+}
+
+func TestTransaction(t *testing.T) {
+ t.Parallel()
+ ctx := context.Background()
+
+ server, teardown := setupMockSpannerServer(t)
+ defer teardown()
+ dsn := fmt.Sprintf("%s/projects/p/instances/i/databases/d?useplaintext=true", server.Address)
+
+ client, cleanup := startTestSpannerLibServer(t)
+ defer cleanup()
+
+ pool, err := client.CreatePool(ctx, &pb.CreatePoolRequest{ConnectionString: dsn})
+ if err != nil {
+ t.Fatalf("failed to create pool: %v", err)
+ }
+ connection, err := client.CreateConnection(ctx, &pb.CreateConnectionRequest{Pool: pool})
+ if err != nil {
+ t.Fatalf("failed to create connection: %v", err)
+ }
+ if _, err := client.Execute(ctx, &pb.ExecuteRequest{
+ Connection: connection,
+ ExecuteSqlRequest: &sppb.ExecuteSqlRequest{Sql: "set transaction_tag='test_tag'"},
+ }); err != nil {
+ t.Fatalf("failed to set transaction_tag: %v", err)
+ }
+ if _, err := client.BeginTransaction(ctx, &pb.BeginTransactionRequest{
+ Connection: connection,
+ TransactionOptions: &sppb.TransactionOptions{},
+ }); err != nil {
+ t.Fatalf("failed to begin transaction: %v", err)
+ }
+ rows, err := client.Execute(ctx, &pb.ExecuteRequest{
+ Connection: connection,
+ ExecuteSqlRequest: &sppb.ExecuteSqlRequest{Sql: testutil.UpdateBarSetFoo},
+ })
+ if err != nil {
+ t.Fatalf("failed to execute: %v", err)
+ }
+ row, err := client.Next(ctx, &pb.NextRequest{Rows: rows, NumRows: 1})
+ if err != nil {
+ t.Fatalf("failed to fetch next row: %v", err)
+ }
+ if row.Values != nil {
+ t.Fatalf("row values should be nil: %v", row.Values)
+ }
+ stats, err := client.ResultSetStats(ctx, rows)
+ if err != nil {
+ t.Fatalf("failed to get stats: %v", err)
+ }
+ if g, w := stats.GetRowCountExact(), int64(testutil.UpdateBarSetFooRowCount); g != w {
+ t.Fatalf("row count mismatch\n Got: %v\nWant: %v", g, w)
+ }
+ if _, err := client.CloseRows(ctx, rows); err != nil {
+ t.Fatalf("failed to close rows: %v", err)
+ }
+ if _, err := client.Commit(ctx, connection); err != nil {
+ t.Fatalf("failed to commit: %v", err)
+ }
+
+ if _, err := client.ClosePool(ctx, pool); err != nil {
+ t.Fatalf("failed to close pool: %v", err)
+ }
+
+ requests := server.TestSpanner.DrainRequestsFromServer()
+ executeRequests := testutil.RequestsOfType(requests, reflect.TypeOf(&sppb.ExecuteSqlRequest{}))
+ if g, w := len(executeRequests), 1; g != w {
+ t.Fatalf("num execute requests mismatch\n Got: %v\nWant: %v", g, w)
+ }
+ request := executeRequests[0].(*sppb.ExecuteSqlRequest)
+ if g, w := request.RequestOptions.TransactionTag, "test_tag"; g != w {
+ t.Fatalf("transaction tag mismatch\n Got: %v\nWant: %v", g, w)
+ }
+}
+
+func TestRollback(t *testing.T) {
+ t.Parallel()
+ ctx := context.Background()
+
+ server, teardown := setupMockSpannerServer(t)
+ defer teardown()
+ dsn := fmt.Sprintf("%s/projects/p/instances/i/databases/d?useplaintext=true", server.Address)
+
+ client, cleanup := startTestSpannerLibServer(t)
+ defer cleanup()
+
+ pool, err := client.CreatePool(ctx, &pb.CreatePoolRequest{ConnectionString: dsn})
+ if err != nil {
+ t.Fatalf("failed to create pool: %v", err)
+ }
+ connection, err := client.CreateConnection(ctx, &pb.CreateConnectionRequest{Pool: pool})
+ if err != nil {
+ t.Fatalf("failed to create connection: %v", err)
+ }
+ if _, err := client.BeginTransaction(ctx, &pb.BeginTransactionRequest{
+ Connection: connection,
+ TransactionOptions: &sppb.TransactionOptions{},
+ }); err != nil {
+ t.Fatalf("failed to begin transaction: %v", err)
+ }
+ rows, err := client.Execute(ctx, &pb.ExecuteRequest{
+ Connection: connection,
+ ExecuteSqlRequest: &sppb.ExecuteSqlRequest{Sql: testutil.UpdateBarSetFoo},
+ })
+ if err != nil {
+ t.Fatalf("failed to execute: %v", err)
+ }
+ if _, err := client.CloseRows(ctx, rows); err != nil {
+ t.Fatalf("failed to close rows: %v", err)
+ }
+ if _, err := client.Rollback(ctx, connection); err != nil {
+ t.Fatalf("failed to rollback: %v", err)
+ }
+
+ if _, err := client.ClosePool(ctx, pool); err != nil {
+ t.Fatalf("failed to close pool: %v", err)
+ }
+}
+
+func TestWriteMutations(t *testing.T) {
+ t.Parallel()
+ ctx := context.Background()
+
+ server, teardown := setupMockSpannerServer(t)
+ defer teardown()
+ dsn := fmt.Sprintf("%s/projects/p/instances/i/databases/d?useplaintext=true", server.Address)
+
+ client, cleanup := startTestSpannerLibServer(t)
+ defer cleanup()
+
+ pool, err := client.CreatePool(ctx, &pb.CreatePoolRequest{ConnectionString: dsn})
+ if err != nil {
+ t.Fatalf("failed to create pool: %v", err)
+ }
+ connection, err := client.CreateConnection(ctx, &pb.CreateConnectionRequest{Pool: pool})
+ if err != nil {
+ t.Fatalf("failed to create connection: %v", err)
+ }
+ resp, err := client.WriteMutations(ctx, &pb.WriteMutationsRequest{
+ Connection: connection,
+ Mutations: &sppb.BatchWriteRequest_MutationGroup{
+ Mutations: []*sppb.Mutation{
+ {Operation: &sppb.Mutation_Update{
+ Update: &sppb.Mutation_Write{
+ Table: "my_table",
+ Columns: []string{"id", "value"},
+ Values: []*structpb.ListValue{
+ {Values: []*structpb.Value{
+ {Kind: &structpb.Value_StringValue{StringValue: "1"}},
+ {Kind: &structpb.Value_StringValue{StringValue: "One"}},
+ }},
+ {Values: []*structpb.Value{
+ {Kind: &structpb.Value_StringValue{StringValue: "2"}},
+ {Kind: &structpb.Value_StringValue{StringValue: "Two"}},
+ }},
+ },
+ },
+ }},
+ },
+ },
+ })
+ if err != nil {
+ t.Fatalf("failed to write mutations: %v", err)
+ }
+ if resp == nil {
+ t.Fatalf("response should not be nil")
+ }
+ if resp.CommitTimestamp == nil {
+ t.Fatalf("commit timestamp should not be nil")
+ }
+
+ if _, err := client.ClosePool(ctx, pool); err != nil {
+ t.Fatalf("failed to close pool: %v", err)
+ }
+}
+
+func startTestSpannerLibServer(t *testing.T) (client pb.SpannerLibClient, cleanup func()) {
+ var tp string
+ var name string
+ var protocol string
+ if runtime.GOOS == "windows" {
+ tp = "tcp"
+ name = "localhost:0"
+ protocol = ""
+ } else {
+ tp = "unix"
+ protocol = "unix://"
+ name = filepath.Join(os.TempDir(), fmt.Sprintf("spannerlib-%s", uuid.NewString()))
+ }
+ lis, err := net.Listen(tp, name)
+ if err != nil {
+ t.Fatalf("failed to listen: %v\n", err)
+ }
+ addr := lis.Addr().String()
+ var opts []grpc.ServerOption
+ grpcServer := grpc.NewServer(opts...)
+
+ server := spannerLibServer{}
+ pb.RegisterSpannerLibServer(grpcServer, &server)
+ go func() { _ = grpcServer.Serve(lis) }()
+
+ conn, err := grpc.NewClient(
+ fmt.Sprintf("%s%s", protocol, addr),
+ grpc.WithTransportCredentials(insecure.NewCredentials()))
+ if err != nil {
+ t.Fatalf("failed to create client connection: %v", err)
+ }
+ client = pb.NewSpannerLibClient(conn)
+
+ cleanup = func() {
+ _ = conn.Close()
+ grpcServer.GracefulStop()
+ _ = os.Remove(name)
+ }
+
+ return
+}
+
+func setupMockSpannerServer(t *testing.T) (server *testutil.MockedSpannerInMemTestServer, teardown func()) {
+ return setupMockSpannerServerWithDialect(t, databasepb.DatabaseDialect_GOOGLE_STANDARD_SQL)
+}
+
+func setupMockSpannerServerWithDialect(t *testing.T, dialect databasepb.DatabaseDialect) (server *testutil.MockedSpannerInMemTestServer, teardown func()) {
+ server, _, serverTeardown := testutil.NewMockedSpannerInMemTestServer(t)
+ server.SetupSelectDialectResult(dialect)
+ return server, serverTeardown
+}
diff --git a/spannerlib/shared/build-dotnet.sh b/spannerlib/shared/build-dotnet.sh
new file mode 100755
index 00000000..f001e7c8
--- /dev/null
+++ b/spannerlib/shared/build-dotnet.sh
@@ -0,0 +1,17 @@
+mkdir -p ../wrappers/spannerlib-dotnet/spannerlib-dotnet-native/binaries/any
+rm ../wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-server/binaries/any/spannerlib
+
+GOOS=darwin GOARCH=arm64 CGO_ENABLED=1 go build -o spannerlib.so -buildmode=c-shared shared_lib.go
+mkdir -p ../wrappers/spannerlib-dotnet/spannerlib-dotnet-native/binaries/osx-arm64
+cp spannerlib.so ../wrappers/spannerlib-dotnet/spannerlib-dotnet-native/binaries/osx-arm64/spannerlib.so
+
+#brew tap SergioBenitez/osxct
+#brew install x86_64-unknown-linux-gnu
+CC=x86_64-unknown-linux-gnu-gcc GOOS=linux GOARCH=amd64 CGO_ENABLED=1 go build -o spannerlib.so -buildmode=c-shared shared_lib.go
+mkdir -p ../wrappers/spannerlib-dotnet/spannerlib-dotnet-native/binaries/linux-x64
+cp spannerlib.so ../wrappers/spannerlib-dotnet/spannerlib-dotnet-native/binaries/linux-x64/spannerlib.so
+
+# brew install mingw-w64
+CC=x86_64-w64-mingw32-gcc GOOS=windows GOARCH=amd64 CGO_ENABLED=1 go build -o spannerlib.dll -buildmode=c-shared shared_lib.go
+mkdir -p ../wrappers/spannerlib-dotnet/spannerlib-dotnet-native/binaries/win-x64
+cp spannerlib.dll ../wrappers/spannerlib-dotnet/spannerlib-dotnet-native/binaries/win-x64/spannerlib.dll
diff --git a/spannerlib/shared/shared_lib.go b/spannerlib/shared/shared_lib.go
index 8645f219..cef869d0 100644
--- a/spannerlib/shared/shared_lib.go
+++ b/spannerlib/shared/shared_lib.go
@@ -132,6 +132,8 @@ func WriteMutations(poolId, connectionId int64, mutationsBytes []byte) (int64, i
// call the functions Metadata and Next to get respectively the metadata of the result
// and the next row of results.
//
+// TODO: This function should also be able to return a ResultSet containing the first N rows, the metadata, and the stats.
+//
//export Execute
func Execute(poolId, connectionId int64, statement []byte) (int64, int32, int64, int32, unsafe.Pointer) {
ctx := context.Background()
diff --git a/spannerlib/wrappers/spannerlib-dotnet/.gitignore b/spannerlib/wrappers/spannerlib-dotnet/.gitignore
new file mode 100644
index 00000000..808112cd
--- /dev/null
+++ b/spannerlib/wrappers/spannerlib-dotnet/.gitignore
@@ -0,0 +1,4 @@
+.idea
+obj
+bin
+*DotSettings.user
diff --git a/spannerlib/wrappers/spannerlib-dotnet/global.json b/spannerlib/wrappers/spannerlib-dotnet/global.json
new file mode 100644
index 00000000..93681ff8
--- /dev/null
+++ b/spannerlib/wrappers/spannerlib-dotnet/global.json
@@ -0,0 +1,7 @@
+{
+ "sdk": {
+ "version": "9.0.0",
+ "rollForward": "latestMinor",
+ "allowPrerelease": false
+ }
+}
\ No newline at end of file
diff --git a/spannerlib/wrappers/spannerlib-dotnet/publish.sh b/spannerlib/wrappers/spannerlib-dotnet/publish.sh
new file mode 100755
index 00000000..602d1471
--- /dev/null
+++ b/spannerlib/wrappers/spannerlib-dotnet/publish.sh
@@ -0,0 +1,41 @@
+# NUGET_API_KEY=secret
+
+# Build gRPC server
+echo "Building gRPC server..."
+cd ../../grpc-server || exit 1
+./build-dotnet.sh
+
+# Build shared library
+
+echo "Building shared library..."
+cd ../shared || exit 1
+./build-dotnet.sh
+
+# Build and publish nuget packages
+cd ../wrappers/spannerlib-dotnet || exit 1
+
+echo "Building .NET packages..."
+VERSION=$(date -u +"1.0.0-alpha.%Y%m%d%H%M%S")
+
+echo "Publishing as version $VERSION"
+find ./ -type f -name "*.csproj" -exec sed -i "" "s|.*|$VERSION|g" {} \;
+find ./ -type f -name "*.csproj" -exec sed -i "" "s|||g" {} \;
+
+dotnet nuget remove source local-native-build 2>/dev/null
+dotnet nuget add source "$PWD"/spannerlib-dotnet-native/bin/Release --name local-native-build
+dotnet nuget remove source local-grpc-server-build 2>/dev/null
+dotnet nuget add source "$PWD"/spannerlib-dotnet-grpc-server/bin/Release --name local-grpc-server-build
+
+find ./**/bin/Release -type f -name "Alpha*.nupkg" -exec rm {} \;
+cd spannerlib-dotnet-native || exit 1
+dotnet pack
+cd .. || exit 1
+cd spannerlib-dotnet-grpc-server || exit 1
+dotnet pack
+cd .. || exit 1
+dotnet pack
+find ./**/bin/Release -type f -name "Alpha*.nupkg" -exec \
+ dotnet nuget push \
+ {} \
+ --api-key $NUGET_API_KEY \
+ --source https://api.nuget.org/v3/index.json \;
diff --git a/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-impl/GrpcLibSpanner.cs b/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-impl/GrpcLibSpanner.cs
new file mode 100644
index 00000000..d52184a3
--- /dev/null
+++ b/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-impl/GrpcLibSpanner.cs
@@ -0,0 +1,421 @@
+// Copyright 2025 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+using System;
+using System.Net.Http;
+using System.Net.Sockets;
+using System.Threading;
+using System.Threading.Tasks;
+using Google.Cloud.Spanner.V1;
+using Google.Cloud.SpannerLib.V1;
+using Google.Protobuf.WellKnownTypes;
+using Grpc.Core;
+using Grpc.Net.Client;
+using BeginTransactionRequest = Google.Cloud.SpannerLib.V1.BeginTransactionRequest;
+using Status = Google.Rpc.Status;
+
+namespace Google.Cloud.SpannerLib.Grpc;
+
+public class GrpcLibSpanner : ISpannerLib
+{
+ public static GrpcChannel ForUnixSocket(string fileName)
+ {
+ var endpoint = new UnixDomainSocketEndPoint(fileName);
+ return GrpcChannel.ForAddress("http://localhost", new GrpcChannelOptions {
+ HttpHandler = new SocketsHttpHandler {
+ EnableMultipleHttp2Connections = true,
+ ConnectCallback = async (_, cancellationToken) => {
+ var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
+ try {
+ await socket.ConnectAsync(endpoint, cancellationToken).ConfigureAwait(false);
+ return new NetworkStream(socket, true);
+ } catch {
+ socket.Dispose();
+ throw;
+ }
+ }
+ }
+ });
+ }
+
+ public static GrpcChannel ForTcpSocket(string address)
+ {
+ return GrpcChannel.ForAddress($"http://{address}", new GrpcChannelOptions
+ {
+ HttpHandler = new SocketsHttpHandler
+ {
+ EnableMultipleHttp2Connections = true,
+ }
+ });
+ }
+
+ private readonly Server _server;
+ private readonly V1.SpannerLib.SpannerLibClient _client;
+ private readonly GrpcChannel _channel;
+ private readonly V1.SpannerLib.SpannerLibClient[] _clients;
+ private readonly GrpcChannel[] _channels;
+ private readonly bool _useStreamingRows;
+ private bool _disposed;
+
+ public GrpcLibSpanner(bool useStreamingRows = true, Server.AddressType addressType = Server.AddressType.UnixDomainSocket)
+ {
+ _server = new Server();
+ var file = _server.Start(addressType: addressType);
+ _channel = addressType == Server.AddressType.Tcp ? ForTcpSocket(file) : ForUnixSocket(file);
+ _client = new V1.SpannerLib.SpannerLibClient(_channel);
+ _useStreamingRows = useStreamingRows;
+
+ var numChannels = 1;
+ _channels = new GrpcChannel[numChannels];
+ _clients = new V1.SpannerLib.SpannerLibClient[numChannels];
+ for (var i = 0; i < numChannels; i++)
+ {
+ _channels[i] = addressType == Server.AddressType.Tcp ? ForTcpSocket(file) : ForUnixSocket(file);
+ _clients[i] = new V1.SpannerLib.SpannerLibClient(_channels[i]);
+ }
+ }
+
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ protected virtual void Dispose(bool disposing)
+ {
+ if (_disposed)
+ {
+ return;
+ }
+ try
+ {
+ _channel.Dispose();
+ foreach (var channel in _channels)
+ {
+ channel.Dispose();
+ }
+ _server.Dispose();
+ }
+ finally
+ {
+ _disposed = true;
+ }
+ }
+
+ T TranslateException(Func f)
+ {
+ try
+ {
+ return f.Invoke();
+ }
+ catch (RpcException exception)
+ {
+ throw SpannerException.ToSpannerException(exception);
+ }
+ }
+
+ public Pool CreatePool(string connectionString)
+ {
+ return FromProto(TranslateException(() => _client.CreatePool(new CreatePoolRequest
+ {
+ ConnectionString = connectionString,
+ })));
+ }
+
+ public void ClosePool(Pool pool)
+ {
+ TranslateException(() => _client.ClosePool(ToProto(pool)));
+ }
+
+ public Connection CreateConnection(Pool pool)
+ {
+ return FromProto(pool, TranslateException(() => _client.CreateConnection(new CreateConnectionRequest
+ {
+ Pool = ToProto(pool),
+ })));
+ }
+
+ public void CloseConnection(Connection connection)
+ {
+ TranslateException(() => _client.CloseConnection(ToProto(connection)));
+ }
+
+ public async Task CloseConnectionAsync(Connection connection, CancellationToken cancellationToken = default)
+ {
+ try
+ {
+ await _client.CloseConnectionAsync(ToProto(connection), cancellationToken: cancellationToken);
+ }
+ catch (RpcException exception)
+ {
+ throw SpannerException.ToSpannerException(exception);
+ }
+ }
+
+ public CommitResponse? WriteMutations(Connection connection, BatchWriteRequest.Types.MutationGroup mutations)
+ {
+ var response = TranslateException(() => _client.WriteMutations(new WriteMutationsRequest
+ {
+ Connection = ToProto(connection),
+ Mutations = mutations,
+ }));
+ return response.CommitTimestamp == null ? null : response;
+ }
+
+ public async Task WriteMutationsAsync(Connection connection,
+ BatchWriteRequest.Types.MutationGroup mutations, CancellationToken cancellationToken = default)
+ {
+ try
+ {
+ var response = await _client.WriteMutationsAsync(new WriteMutationsRequest
+ {
+ Connection = ToProto(connection),
+ Mutations = mutations,
+ });
+ return response.CommitTimestamp == null ? null : response;
+ }
+ catch (RpcException exception)
+ {
+ throw SpannerException.ToSpannerException(exception);
+ }
+ }
+
+ public Rows Execute(Connection connection, ExecuteSqlRequest statement)
+ {
+ if (_useStreamingRows)
+ {
+ return ExecuteStreaming(connection, statement);
+ }
+ return FromProto(connection, TranslateException(() => _client.Execute(new ExecuteRequest
+ {
+ Connection = ToProto(connection),
+ ExecuteSqlRequest = statement,
+ })));
+ }
+
+ private StreamingRows ExecuteStreaming(Connection connection, ExecuteSqlRequest statement)
+ {
+ var client = _clients[Random.Shared.Next(_clients.Length)];
+ var stream = TranslateException(() => client.ExecuteStreaming(new ExecuteRequest
+ {
+ Connection = ToProto(connection),
+ ExecuteSqlRequest = statement,
+ }));
+ return StreamingRows.Create(connection, stream);
+ }
+
+ public async Task ExecuteAsync(Connection connection, ExecuteSqlRequest statement, CancellationToken cancellationToken = default)
+ {
+ try
+ {
+ if (_useStreamingRows)
+ {
+ return await ExecuteStreamingAsync(connection, statement, cancellationToken);
+ }
+ var rows = await _client.ExecuteAsync(new ExecuteRequest
+ {
+ Connection = ToProto(connection),
+ ExecuteSqlRequest = statement,
+ }, cancellationToken: cancellationToken);
+ return FromProto(connection, rows);
+ }
+ catch (RpcException exception)
+ {
+ throw SpannerException.ToSpannerException(exception);
+ }
+ }
+
+ private async Task ExecuteStreamingAsync(Connection connection, ExecuteSqlRequest statement, CancellationToken cancellationToken = default)
+ {
+ var client = _clients[Random.Shared.Next(_clients.Length)];
+ var stream = TranslateException(() => client.ExecuteStreaming(new ExecuteRequest
+ {
+ Connection = ToProto(connection),
+ ExecuteSqlRequest = statement,
+ }));
+ return await StreamingRows.CreateAsync(connection, stream, cancellationToken);
+ }
+
+ public long[] ExecuteBatch(Connection connection, ExecuteBatchDmlRequest statements)
+ {
+ var response = TranslateException(() => _client.ExecuteBatch(new ExecuteBatchRequest
+ {
+ Connection = ToProto(connection),
+ ExecuteBatchDmlRequest = statements,
+ }));
+ var result = new long[response.ResultSets.Count];
+ for (var i = 0; i < result.Length; i++)
+ {
+ if (response.ResultSets[i].Stats.HasRowCountExact)
+ {
+ result[i] = response.ResultSets[i].Stats.RowCountExact;
+ }
+ else if (response.ResultSets[i].Stats.HasRowCountLowerBound)
+ {
+ result[i] = response.ResultSets[i].Stats.RowCountLowerBound;
+ }
+ else
+ {
+ result[i] = -1;
+ }
+ }
+ return result;
+ }
+
+ public async Task ExecuteBatchAsync(Connection connection, ExecuteBatchDmlRequest statements, CancellationToken cancellationToken = default)
+ {
+ try
+ {
+ var stats = await _client.ExecuteBatchAsync(new ExecuteBatchRequest
+ {
+ Connection = ToProto(connection),
+ ExecuteBatchDmlRequest = statements,
+ }, cancellationToken: cancellationToken);
+ var result = new long[stats.ResultSets.Count];
+ for (var i = 0; i < result.Length; i++)
+ {
+ result[i] = stats.ResultSets[i].Stats.RowCountExact;
+ }
+ return result;
+ }
+ catch (RpcException exception)
+ {
+ throw SpannerException.ToSpannerException(exception);
+ }
+ }
+
+ public ResultSetMetadata? Metadata(Rows rows)
+ {
+ return TranslateException(() => _client.Metadata(ToProto(rows)));
+ }
+
+ public async Task MetadataAsync(Rows rows, CancellationToken cancellationToken = default)
+ {
+ try
+ {
+ return await _client.MetadataAsync(ToProto(rows), cancellationToken: cancellationToken);
+ }
+ catch (RpcException exception)
+ {
+ throw SpannerException.ToSpannerException(exception);
+ }
+ }
+
+ public ResultSetStats? Stats(Rows rows)
+ {
+ return TranslateException(() => _client.ResultSetStats(ToProto(rows)));
+ }
+
+ public ListValue? Next(Rows rows, int numRows, ISpannerLib.RowEncoding encoding)
+ {
+ var row = TranslateException(() =>_client.Next(new NextRequest
+ {
+ Rows = ToProto(rows),
+ NumRows = numRows,
+ Encoding = (long) encoding,
+ }));
+ return row.Values.Count == 0 ? null : row;
+ }
+
+ public async Task NextAsync(Rows rows, int numRows, ISpannerLib.RowEncoding encoding, CancellationToken cancellationToken = default)
+ {
+ try
+ {
+ return await _client.NextAsync(new NextRequest
+ {
+ Rows = ToProto(rows),
+ NumRows = numRows,
+ Encoding = (long)encoding,
+ }, cancellationToken: cancellationToken);
+ }
+ catch (RpcException exception)
+ {
+ throw SpannerException.ToSpannerException(exception);
+ }
+ }
+
+ public void CloseRows(Rows rows)
+ {
+ TranslateException(() => _client.CloseRows(ToProto(rows)));
+ }
+
+ public async Task CloseRowsAsync(Rows rows, CancellationToken cancellationToken = default)
+ {
+ try
+ {
+ await _client.CloseRowsAsync(ToProto(rows), cancellationToken: cancellationToken);
+ }
+ catch (RpcException exception)
+ {
+ throw SpannerException.ToSpannerException(exception);
+ }
+ }
+
+ public void BeginTransaction(Connection connection, TransactionOptions transactionOptions)
+ {
+ TranslateException(() => _client.BeginTransaction(new BeginTransactionRequest
+ {
+ Connection = ToProto(connection),
+ TransactionOptions = transactionOptions,
+ }));
+ }
+
+ public CommitResponse? Commit(Connection connection)
+ {
+ var response = TranslateException(() => _client.Commit(ToProto(connection)));
+ return response.CommitTimestamp == null ? null : response;
+ }
+
+ public async Task CommitAsync(Connection connection, CancellationToken cancellationToken = default)
+ {
+ try
+ {
+ var response = await _client.CommitAsync(ToProto(connection), cancellationToken: cancellationToken);
+ return response.CommitTimestamp == null ? null : response;
+ }
+ catch (RpcException exception)
+ {
+ throw new SpannerException(new Status { Code = (int) exception.Status.StatusCode, Message = exception.Status.Detail });
+ }
+ }
+
+ public void Rollback(Connection connection)
+ {
+ TranslateException(() => _client.Rollback(ToProto(connection)));
+ }
+
+ public async Task RollbackAsync(Connection connection, CancellationToken cancellationToken = default)
+ {
+ try
+ {
+ await _client.RollbackAsync(ToProto(connection), cancellationToken: cancellationToken);
+ }
+ catch (RpcException exception)
+ {
+ throw SpannerException.ToSpannerException(exception);
+ }
+ }
+
+ Pool FromProto(V1.Pool pool) => new(this, pool.Id);
+
+ V1.Pool ToProto(Pool pool) => new() { Id = pool.Id };
+
+ Connection FromProto(Pool pool, V1.Connection proto) => new(pool, proto.Id);
+
+ V1.Connection ToProto(Connection connection) => new() { Id = connection.Id, Pool = ToProto(connection.Pool), };
+
+ Rows FromProto(Connection connection, V1.Rows proto) => new(connection, proto.Id);
+
+ V1.Rows ToProto(Rows rows) => new() { Id = rows.Id, Connection = ToProto(rows.SpannerConnection), };
+}
\ No newline at end of file
diff --git a/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-impl/StreamingRows.cs b/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-impl/StreamingRows.cs
new file mode 100644
index 00000000..1d0c21bf
--- /dev/null
+++ b/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-impl/StreamingRows.cs
@@ -0,0 +1,131 @@
+using System.Threading;
+using System.Threading.Tasks;
+using Google.Api.Gax;
+using Google.Cloud.Spanner.V1;
+using Google.Cloud.SpannerLib.V1;
+using Google.Protobuf.WellKnownTypes;
+using Grpc.Core;
+using Status = Google.Rpc.Status;
+
+namespace Google.Cloud.SpannerLib.Grpc;
+
+public class StreamingRows : Rows
+{
+ private readonly AsyncServerStreamingCall _stream;
+ private ListValue? _pendingRow;
+ private ResultSetMetadata? _metadata;
+ private ResultSetStats? _stats;
+ private bool _done;
+
+ protected override ResultSetStats? Stats => _stats;
+
+ public override ResultSetMetadata? Metadata => _metadata;
+
+ public static StreamingRows Create(Connection connection, AsyncServerStreamingCall stream)
+ {
+ var rows = new StreamingRows(connection, stream);
+ rows._pendingRow = rows.Next();
+ return rows;
+ }
+
+ public static async Task CreateAsync(Connection connection, AsyncServerStreamingCall stream, CancellationToken cancellationToken = default)
+ {
+ var rows = new StreamingRows(connection, stream);
+ rows._pendingRow = await rows.NextAsync(cancellationToken);
+ return rows;
+ }
+
+ private StreamingRows(Connection connection, AsyncServerStreamingCall stream) : base(connection, 0, initMetadata: false)
+ {
+ _stream = stream;
+ }
+
+ protected override void Dispose(bool disposing)
+ {
+ if (!_done)
+ {
+ MarkDone();
+ }
+ _stream.Dispose();
+ base.Dispose(disposing);
+ }
+
+ private void MarkDone()
+ {
+ _done = true;
+ }
+
+ public override ListValue? Next()
+ {
+ if (_pendingRow != null) {
+ var row = _pendingRow;
+ _pendingRow = null;
+ return row;
+ }
+ try
+ {
+ var hasNext = Task.Run(() => _stream.ResponseStream.MoveNext()).ResultWithUnwrappedExceptions();
+ if (!hasNext)
+ {
+ MarkDone();
+ return null;
+ }
+ var rowData = _stream.ResponseStream.Current;
+ if (rowData.Metadata != null)
+ {
+ _metadata = rowData.Metadata;
+ }
+ if (rowData.Stats != null)
+ {
+ _stats = rowData.Stats;
+ }
+ if (rowData.Data.Count == 0)
+ {
+ MarkDone();
+ return null;
+ }
+ return rowData.Data[0];
+ }
+ catch (RpcException exception)
+ {
+ throw new SpannerException(new Status { Code = (int) exception.Status.StatusCode, Message = exception.Status.Detail });
+ }
+ }
+
+ public override async Task NextAsync(CancellationToken cancellationToken = default)
+ {
+ if (_pendingRow != null) {
+ var row = _pendingRow;
+ _pendingRow = null;
+ return row;
+ }
+ try
+ {
+ var hasNext = await _stream.ResponseStream.MoveNext(cancellationToken);
+ if (!hasNext)
+ {
+ MarkDone();
+ return null;
+ }
+ var rowData = _stream.ResponseStream.Current;
+ if (rowData.Metadata != null)
+ {
+ _metadata = rowData.Metadata;
+ }
+ if (rowData.Stats != null)
+ {
+ _stats = rowData.Stats;
+ }
+ if (rowData.Data.Count == 0)
+ {
+ MarkDone();
+ return null;
+ }
+ return rowData.Data[0];
+ }
+ catch (RpcException exception)
+ {
+ throw SpannerException.ToSpannerException(exception);
+ }
+ }
+}
\ No newline at end of file
diff --git a/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-impl/spannerlib-dotnet-grpc-impl.csproj b/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-impl/spannerlib-dotnet-grpc-impl.csproj
new file mode 100644
index 00000000..dd364459
--- /dev/null
+++ b/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-impl/spannerlib-dotnet-grpc-impl.csproj
@@ -0,0 +1,22 @@
+
+
+
+ net8.0
+ Google.Cloud.SpannerLib.Grpc
+ enable
+ default
+ Alpha.Google.Cloud.SpannerLib.GrpcImpl
+ 1.0.0-alpha.20251009140944
+ Google
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-server/Server.cs b/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-server/Server.cs
new file mode 100644
index 00000000..436869da
--- /dev/null
+++ b/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-server/Server.cs
@@ -0,0 +1,191 @@
+// Copyright 2025 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+using System;
+using System.Diagnostics;
+using System.IO;
+using System.Runtime.InteropServices;
+using System.Threading;
+
+namespace Google.Cloud.SpannerLib.Grpc;
+
+public class Server : IDisposable
+{
+ public enum AddressType
+ {
+ UnixDomainSocket,
+ Tcp,
+ }
+
+ private Process? _process;
+ private string? _host;
+ private bool _disposed;
+
+ public bool IsRunning => _process is { HasExited: false };
+
+ public Server()
+ {
+ }
+
+ public string Start(AddressType addressType = AddressType.UnixDomainSocket)
+ {
+ if (_disposed)
+ {
+ throw new ObjectDisposedException(nameof(Server));
+ }
+ if (IsRunning)
+ {
+ throw new InvalidOperationException("The server is already started.");
+ }
+ (_host, _process) = StartGrpcServer(addressType);
+ return _host;
+ }
+
+ private static Tuple StartGrpcServer(AddressType addressType)
+ {
+ string arguments;
+ if (addressType == AddressType.UnixDomainSocket)
+ {
+ // Generate a random temp file name that will be used for the Unix domain socket communication.
+ arguments = Path.GetTempPath() + Guid.NewGuid();
+ }
+ else if (addressType == AddressType.Tcp)
+ {
+ arguments = "localhost:0 tcp";
+ }
+ else
+ {
+ arguments = "localhost:0 tcp";
+ }
+
+ var binaryFileName = GetBinaryFileName().Replace('/', Path.DirectorySeparatorChar);
+ var info = new ProcessStartInfo
+ {
+ Arguments = arguments,
+ UseShellExecute = false,
+ FileName = binaryFileName,
+ RedirectStandardOutput = true,
+ RedirectStandardError = true,
+ };
+ // Start the process as a child process. The process will automatically stop when the
+ // parent process stops.
+ var process = Process.Start(info);
+ if (process == null)
+ {
+ throw new InvalidOperationException("Failed to start spanner");
+ }
+ if (addressType == AddressType.UnixDomainSocket)
+ {
+ while (!File.Exists(arguments))
+ {
+ Thread.Sleep(1);
+ }
+ }
+ if (addressType == AddressType.UnixDomainSocket)
+ {
+ // Return the name of the Unix domain socket.
+ return Tuple.Create(arguments, process);
+ }
+ // Read the dynamically assigned port.
+ var address = process.StandardError.ReadLine();
+ if (address?.Contains("Starting gRPC server on") ?? false)
+ {
+ var lastSpace = address.LastIndexOf(" ", StringComparison.Ordinal);
+ return Tuple.Create(address.Substring(lastSpace + 1), process);
+ }
+ throw new InvalidOperationException("Failed to read gRPC address");
+ }
+
+ private static string GetBinaryFileName()
+ {
+ string? fileName = null;
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+ {
+ switch (RuntimeInformation.OSArchitecture)
+ {
+ case Architecture.X64:
+ fileName = "runtimes/win-x64/native/grpc_server.exe";
+ break;
+ }
+ }
+ else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
+ {
+ switch (RuntimeInformation.OSArchitecture)
+ {
+ case Architecture.X64:
+ fileName = "runtimes/linux-x64/native/grpc_server";
+ break;
+ }
+ }
+ else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
+ {
+ switch (RuntimeInformation.ProcessArchitecture)
+ {
+ case Architecture.Arm64:
+ fileName = "runtimes/osx-arm64/native/grpc_server";
+ break;
+ }
+ }
+ if (fileName != null && File.Exists(fileName))
+ {
+ return fileName;
+ }
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+ {
+ if (File.Exists("runtimes/any/native/grpc_server.exe"))
+ {
+ return "runtimes/any/native/grpc_server.exe";
+ }
+ }
+ if (File.Exists("runtimes/any/native/grpc_server"))
+ {
+ return "runtimes/any/native/grpc_server";
+ }
+
+ throw new PlatformNotSupportedException();
+ }
+
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ public void Stop()
+ {
+ if (_process == null || _process.HasExited)
+ {
+ return;
+ }
+ _process.Kill();
+ _process.WaitForExit();
+ }
+
+ protected virtual void Dispose(bool disposing)
+ {
+ if (_disposed)
+ {
+ return;
+ }
+ try
+ {
+ Stop();
+ _process?.Dispose();
+ }
+ finally
+ {
+ _disposed = true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-server/build.sh b/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-server/build.sh
new file mode 100755
index 00000000..e183be01
--- /dev/null
+++ b/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-server/build.sh
@@ -0,0 +1,19 @@
+# Builds the gRPC server and the binary .NET wrapper and install the latter in a local nuget repository.
+
+# Determine OS + Arch
+mkdir -p binaries/any
+mkdir -p binaries/osx-arm64
+mkdir -p binaries/linux-x64
+
+# Clear all local nuget cache
+rm binaries/any/grpc_server
+dotnet nuget locals --clear all
+GOOS=darwin GOARCH=arm64 go build -o ../../../grpc-server/grpc_server ../../../grpc-server/server.go
+cp ../../../grpc-server/grpc_server binaries/osx-arm64/grpc_server
+GOOS=linux GOARCH=amd64 go build -o ../../../grpc-server/grpc_server ../../../grpc-server/server.go
+cp ../../../grpc-server/grpc_server binaries/linux-x64/grpc_server
+
+dotnet pack
+dotnet nuget remove source local_grpc_server 2>/dev/null
+dotnet nuget add source "$PWD"/bin/Release --name local_grpc_server
+dotnet restore ../spannerlib-dotnet-grpc-impl
diff --git a/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-server/publish.sh b/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-server/publish.sh
new file mode 100755
index 00000000..8c3d0e4b
--- /dev/null
+++ b/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-server/publish.sh
@@ -0,0 +1,13 @@
+# NUGET_API_KEY=secret
+
+VERSION=$(date -u +"1.0.0-alpha.%Y%m%d%H%M%S")
+
+echo "Publishing as version $VERSION"
+sed -i "" "s|.*|$VERSION|g" spannerlib-dotnet-grpc-server.csproj
+
+rm -rf bin/Release
+dotnet pack
+dotnet nuget push \
+ bin/Release/Alpha.Google.Cloud.SpannerLib.GrpcServer.*.nupkg \
+ --api-key $NUGET_API_KEY \
+ --source https://api.nuget.org/v3/index.json
diff --git a/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-server/spannerlib-dotnet-grpc-server.csproj b/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-server/spannerlib-dotnet-grpc-server.csproj
new file mode 100644
index 00000000..d70ba22c
--- /dev/null
+++ b/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-server/spannerlib-dotnet-grpc-server.csproj
@@ -0,0 +1,20 @@
+
+
+
+ netstandard2.1
+ Google.Cloud.SpannerLib.Grpc
+ enable
+ default
+ Alpha.Google.Cloud.SpannerLib.GrpcServer
+ SpannerLib Grpc Server
+ Google
+ 1.0.0-alpha.20251009140944
+
+
+
+
+
+
+
+
+
diff --git a/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-tests/ServerTests.cs b/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-tests/ServerTests.cs
new file mode 100644
index 00000000..ff243f47
--- /dev/null
+++ b/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-tests/ServerTests.cs
@@ -0,0 +1,50 @@
+// Copyright 2025 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+using Google.Cloud.SpannerLib.V1;
+
+namespace Google.Cloud.SpannerLib.Grpc;
+
+public class Tests
+{
+ private Server _server;
+
+ [SetUp]
+ public void Setup()
+ {
+ _server = new Server();
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ _server.Dispose();
+ }
+
+ [Test]
+ public void TestStartStop()
+ {
+ Assert.That(_server.IsRunning, Is.False);
+ var file = _server.Start();
+ Assert.That(_server.IsRunning, Is.True);
+
+ using var channel = GrpcLibSpanner.ForUnixSocket(file);
+ var client = new V1.SpannerLib.SpannerLibClient(channel);
+ var info = client.Info(new InfoRequest());
+ Assert.That(info, Is.Not.Null);
+
+ _server.Stop();
+ Assert.That(_server.IsRunning, Is.False);
+ }
+}
\ No newline at end of file
diff --git a/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-tests/spannerlib-dotnet-grpc-tests.csproj b/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-tests/spannerlib-dotnet-grpc-tests.csproj
new file mode 100644
index 00000000..a6788ee9
--- /dev/null
+++ b/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-tests/spannerlib-dotnet-grpc-tests.csproj
@@ -0,0 +1,28 @@
+
+
+
+ net8.0
+ Google.Cloud.SpannerLib.Grpc
+ latest
+ enable
+ enable
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-v1/Spannerlib.g.cs b/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-v1/Spannerlib.g.cs
new file mode 100644
index 00000000..14132a1d
--- /dev/null
+++ b/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-v1/Spannerlib.g.cs
@@ -0,0 +1,4102 @@
+//
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/spannerlib/v1/spannerlib.proto
+//
+#pragma warning disable 1591, 0612, 3021, 8981
+#region Designer generated code
+
+using pb = global::Google.Protobuf;
+using pbc = global::Google.Protobuf.Collections;
+using pbr = global::Google.Protobuf.Reflection;
+using scg = global::System.Collections.Generic;
+namespace Google.Cloud.SpannerLib.V1 {
+
+ /// Holder for reflection information generated from google/spannerlib/v1/spannerlib.proto
+ public static partial class SpannerlibReflection {
+
+ #region Descriptor
+ /// File descriptor for google/spannerlib/v1/spannerlib.proto
+ public static pbr::FileDescriptor Descriptor {
+ get { return descriptor; }
+ }
+ private static pbr::FileDescriptor descriptor;
+
+ static SpannerlibReflection() {
+ byte[] descriptorData = global::System.Convert.FromBase64String(
+ string.Concat(
+ "CiVnb29nbGUvc3Bhbm5lcmxpYi92MS9zcGFubmVybGliLnByb3RvEhRnb29n",
+ "bGUuc3Bhbm5lcmxpYi52MRofZ29vZ2xlL2FwaS9maWVsZF9iZWhhdmlvci5w",
+ "cm90bxobZ29vZ2xlL3Byb3RvYnVmL2VtcHR5LnByb3RvGhxnb29nbGUvcHJv",
+ "dG9idWYvc3RydWN0LnByb3RvGiJnb29nbGUvc3Bhbm5lci92MS9yZXN1bHRf",
+ "c2V0LnByb3RvGh9nb29nbGUvc3Bhbm5lci92MS9zcGFubmVyLnByb3RvGiNn",
+ "b29nbGUvc3Bhbm5lci92MS90cmFuc2FjdGlvbi5wcm90byINCgtJbmZvUmVx",
+ "dWVzdCIfCgxJbmZvUmVzcG9uc2USDwoHdmVyc2lvbhgBIAEoCSIzChFDcmVh",
+ "dGVQb29sUmVxdWVzdBIeChFjb25uZWN0aW9uX3N0cmluZxgBIAEoCUID4EEC",
+ "IkgKF0NyZWF0ZUNvbm5lY3Rpb25SZXF1ZXN0Ei0KBHBvb2wYASABKAsyGi5n",
+ "b29nbGUuc3Bhbm5lcmxpYi52MS5Qb29sQgPgQQIikwEKDkV4ZWN1dGVSZXF1",
+ "ZXN0EjkKCmNvbm5lY3Rpb24YASABKAsyIC5nb29nbGUuc3Bhbm5lcmxpYi52",
+ "MS5Db25uZWN0aW9uQgPgQQISRgoTZXhlY3V0ZV9zcWxfcmVxdWVzdBgCIAEo",
+ "CzIkLmdvb2dsZS5zcGFubmVyLnYxLkV4ZWN1dGVTcWxSZXF1ZXN0QgPgQQIi",
+ "owEKE0V4ZWN1dGVCYXRjaFJlcXVlc3QSOQoKY29ubmVjdGlvbhgBIAEoCzIg",
+ "Lmdvb2dsZS5zcGFubmVybGliLnYxLkNvbm5lY3Rpb25CA+BBAhJRChlleGVj",
+ "dXRlX2JhdGNoX2RtbF9yZXF1ZXN0GAIgASgLMikuZ29vZ2xlLnNwYW5uZXIu",
+ "djEuRXhlY3V0ZUJhdGNoRG1sUmVxdWVzdEID4EECIp0BChdCZWdpblRyYW5z",
+ "YWN0aW9uUmVxdWVzdBI5Cgpjb25uZWN0aW9uGAEgASgLMiAuZ29vZ2xlLnNw",
+ "YW5uZXJsaWIudjEuQ29ubmVjdGlvbkID4EECEkcKE3RyYW5zYWN0aW9uX29w",
+ "dGlvbnMYAiABKAsyJS5nb29nbGUuc3Bhbm5lci52MS5UcmFuc2FjdGlvbk9w",
+ "dGlvbnNCA+BBAiKeAQoVV3JpdGVNdXRhdGlvbnNSZXF1ZXN0EjkKCmNvbm5l",
+ "Y3Rpb24YASABKAsyIC5nb29nbGUuc3Bhbm5lcmxpYi52MS5Db25uZWN0aW9u",
+ "QgPgQQISSgoJbXV0YXRpb25zGAIgASgLMjIuZ29vZ2xlLnNwYW5uZXIudjEu",
+ "QmF0Y2hXcml0ZVJlcXVlc3QuTXV0YXRpb25Hcm91cEID4EECIhcKBFBvb2wS",
+ "DwoCaWQYASABKANCA+BBAiJMCgpDb25uZWN0aW9uEi0KBHBvb2wYASABKAsy",
+ "Gi5nb29nbGUuc3Bhbm5lcmxpYi52MS5Qb29sQgPgQQISDwoCaWQYAiABKANC",
+ "A+BBAiJSCgRSb3dzEjkKCmNvbm5lY3Rpb24YASABKAsyIC5nb29nbGUuc3Bh",
+ "bm5lcmxpYi52MS5Db25uZWN0aW9uQgPgQQISDwoCaWQYAiABKANCA+BBAiJq",
+ "CgtOZXh0UmVxdWVzdBItCgRyb3dzGAEgASgLMhouZ29vZ2xlLnNwYW5uZXJs",
+ "aWIudjEuUm93c0ID4EECEhUKCG51bV9yb3dzGAIgASgDQgPgQQISFQoIZW5j",
+ "b2RpbmcYAyABKANCA+BBAiLRAQoHUm93RGF0YRItCgRyb3dzGAEgASgLMhou",
+ "Z29vZ2xlLnNwYW5uZXJsaWIudjEuUm93c0ID4EECEjYKCG1ldGFkYXRhGAIg",
+ "ASgLMiQuZ29vZ2xlLnNwYW5uZXIudjEuUmVzdWx0U2V0TWV0YWRhdGESLQoE",
+ "ZGF0YRgDIAMoCzIaLmdvb2dsZS5wcm90b2J1Zi5MaXN0VmFsdWVCA+BBAhIw",
+ "CgVzdGF0cxgEIAEoCzIhLmdvb2dsZS5zcGFubmVyLnYxLlJlc3VsdFNldFN0",
+ "YXRzIkAKD01ldGFkYXRhUmVxdWVzdBItCgRyb3dzGAEgASgLMhouZ29vZ2xl",
+ "LnNwYW5uZXJsaWIudjEuUm93c0ID4EECIkYKFVJlc3VsdFNldFN0YXRzUmVx",
+ "dWVzdBItCgRyb3dzGAEgASgLMhouZ29vZ2xlLnNwYW5uZXJsaWIudjEuUm93",
+ "c0ID4EECImUKF0Nvbm5lY3Rpb25TdHJlYW1SZXF1ZXN0Ej8KD2V4ZWN1dGVf",
+ "cmVxdWVzdBgBIAEoCzIkLmdvb2dsZS5zcGFubmVybGliLnYxLkV4ZWN1dGVS",
+ "ZXF1ZXN0SABCCQoHcmVxdWVzdCJaChhDb25uZWN0aW9uU3RyZWFtUmVzcG9u",
+ "c2USMgoDcm93GAEgASgLMiMuZ29vZ2xlLnNwYW5uZXIudjEuUGFydGlhbFJl",
+ "c3VsdFNldEgAQgoKCHJlc3BvbnNlMsILCgpTcGFubmVyTGliEk8KBEluZm8S",
+ "IS5nb29nbGUuc3Bhbm5lcmxpYi52MS5JbmZvUmVxdWVzdBoiLmdvb2dsZS5z",
+ "cGFubmVybGliLnYxLkluZm9SZXNwb25zZSIAElMKCkNyZWF0ZVBvb2wSJy5n",
+ "b29nbGUuc3Bhbm5lcmxpYi52MS5DcmVhdGVQb29sUmVxdWVzdBoaLmdvb2ds",
+ "ZS5zcGFubmVybGliLnYxLlBvb2wiABJBCglDbG9zZVBvb2wSGi5nb29nbGUu",
+ "c3Bhbm5lcmxpYi52MS5Qb29sGhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IgAS",
+ "ZQoQQ3JlYXRlQ29ubmVjdGlvbhItLmdvb2dsZS5zcGFubmVybGliLnYxLkNy",
+ "ZWF0ZUNvbm5lY3Rpb25SZXF1ZXN0GiAuZ29vZ2xlLnNwYW5uZXJsaWIudjEu",
+ "Q29ubmVjdGlvbiIAEk0KD0Nsb3NlQ29ubmVjdGlvbhIgLmdvb2dsZS5zcGFu",
+ "bmVybGliLnYxLkNvbm5lY3Rpb24aFi5nb29nbGUucHJvdG9idWYuRW1wdHki",
+ "ABJNCgdFeGVjdXRlEiQuZ29vZ2xlLnNwYW5uZXJsaWIudjEuRXhlY3V0ZVJl",
+ "cXVlc3QaGi5nb29nbGUuc3Bhbm5lcmxpYi52MS5Sb3dzIgASWwoQRXhlY3V0",
+ "ZVN0cmVhbWluZxIkLmdvb2dsZS5zcGFubmVybGliLnYxLkV4ZWN1dGVSZXF1",
+ "ZXN0Gh0uZ29vZ2xlLnNwYW5uZXJsaWIudjEuUm93RGF0YSIAMAESZwoMRXhl",
+ "Y3V0ZUJhdGNoEikuZ29vZ2xlLnNwYW5uZXJsaWIudjEuRXhlY3V0ZUJhdGNo",
+ "UmVxdWVzdBoqLmdvb2dsZS5zcGFubmVyLnYxLkV4ZWN1dGVCYXRjaERtbFJl",
+ "c3BvbnNlIgASTgoITWV0YWRhdGESGi5nb29nbGUuc3Bhbm5lcmxpYi52MS5S",
+ "b3dzGiQuZ29vZ2xlLnNwYW5uZXIudjEuUmVzdWx0U2V0TWV0YWRhdGEiABJH",
+ "CgROZXh0EiEuZ29vZ2xlLnNwYW5uZXJsaWIudjEuTmV4dFJlcXVlc3QaGi5n",
+ "b29nbGUucHJvdG9idWYuTGlzdFZhbHVlIgASUQoOUmVzdWx0U2V0U3RhdHMS",
+ "Gi5nb29nbGUuc3Bhbm5lcmxpYi52MS5Sb3dzGiEuZ29vZ2xlLnNwYW5uZXIu",
+ "djEuUmVzdWx0U2V0U3RhdHMiABJBCglDbG9zZVJvd3MSGi5nb29nbGUuc3Bh",
+ "bm5lcmxpYi52MS5Sb3dzGhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IgASWwoQ",
+ "QmVnaW5UcmFuc2FjdGlvbhItLmdvb2dsZS5zcGFubmVybGliLnYxLkJlZ2lu",
+ "VHJhbnNhY3Rpb25SZXF1ZXN0GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IgAS",
+ "TwoGQ29tbWl0EiAuZ29vZ2xlLnNwYW5uZXJsaWIudjEuQ29ubmVjdGlvbhoh",
+ "Lmdvb2dsZS5zcGFubmVyLnYxLkNvbW1pdFJlc3BvbnNlIgASRgoIUm9sbGJh",
+ "Y2sSIC5nb29nbGUuc3Bhbm5lcmxpYi52MS5Db25uZWN0aW9uGhYuZ29vZ2xl",
+ "LnByb3RvYnVmLkVtcHR5IgASYgoOV3JpdGVNdXRhdGlvbnMSKy5nb29nbGUu",
+ "c3Bhbm5lcmxpYi52MS5Xcml0ZU11dGF0aW9uc1JlcXVlc3QaIS5nb29nbGUu",
+ "c3Bhbm5lci52MS5Db21taXRSZXNwb25zZSIAEncKEENvbm5lY3Rpb25TdHJl",
+ "YW0SLS5nb29nbGUuc3Bhbm5lcmxpYi52MS5Db25uZWN0aW9uU3RyZWFtUmVx",
+ "dWVzdBouLmdvb2dsZS5zcGFubmVybGliLnYxLkNvbm5lY3Rpb25TdHJlYW1S",
+ "ZXNwb25zZSIAKAEwAULNAQoeY29tLmdvb2dsZS5jbG91ZC5zcGFubmVybGli",
+ "LnYxQg9TcGFubmVyTGliUHJvdG9QAVo+Y2xvdWQuZ29vZ2xlLmNvbS9nby9z",
+ "cGFubmVybGliL2FwaXYxL3NwYW5uZXJsaWJwYjtzcGFubmVybGlicGKqAhpH",
+ "b29nbGUuQ2xvdWQuU3Bhbm5lckxpYi5WMcoCGkdvb2dsZVxDbG91ZFxTcGFu",
+ "bmVyTGliXFYx6gIdR29vZ2xlOjpDbG91ZDo6U3Bhbm5lckxpYjo6VjFiBnBy",
+ "b3RvMw=="));
+ descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
+ new pbr::FileDescriptor[] { global::Google.Api.FieldBehaviorReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.EmptyReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.StructReflection.Descriptor, global::Google.Cloud.Spanner.V1.ResultSetReflection.Descriptor, global::Google.Cloud.Spanner.V1.SpannerReflection.Descriptor, global::Google.Cloud.Spanner.V1.TransactionReflection.Descriptor, },
+ new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
+ new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.SpannerLib.V1.InfoRequest), global::Google.Cloud.SpannerLib.V1.InfoRequest.Parser, null, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.SpannerLib.V1.InfoResponse), global::Google.Cloud.SpannerLib.V1.InfoResponse.Parser, new[]{ "Version" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.SpannerLib.V1.CreatePoolRequest), global::Google.Cloud.SpannerLib.V1.CreatePoolRequest.Parser, new[]{ "ConnectionString" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.SpannerLib.V1.CreateConnectionRequest), global::Google.Cloud.SpannerLib.V1.CreateConnectionRequest.Parser, new[]{ "Pool" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.SpannerLib.V1.ExecuteRequest), global::Google.Cloud.SpannerLib.V1.ExecuteRequest.Parser, new[]{ "Connection", "ExecuteSqlRequest" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.SpannerLib.V1.ExecuteBatchRequest), global::Google.Cloud.SpannerLib.V1.ExecuteBatchRequest.Parser, new[]{ "Connection", "ExecuteBatchDmlRequest" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.SpannerLib.V1.BeginTransactionRequest), global::Google.Cloud.SpannerLib.V1.BeginTransactionRequest.Parser, new[]{ "Connection", "TransactionOptions" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.SpannerLib.V1.WriteMutationsRequest), global::Google.Cloud.SpannerLib.V1.WriteMutationsRequest.Parser, new[]{ "Connection", "Mutations" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.SpannerLib.V1.Pool), global::Google.Cloud.SpannerLib.V1.Pool.Parser, new[]{ "Id" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.SpannerLib.V1.Connection), global::Google.Cloud.SpannerLib.V1.Connection.Parser, new[]{ "Pool", "Id" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.SpannerLib.V1.Rows), global::Google.Cloud.SpannerLib.V1.Rows.Parser, new[]{ "Connection", "Id" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.SpannerLib.V1.NextRequest), global::Google.Cloud.SpannerLib.V1.NextRequest.Parser, new[]{ "Rows", "NumRows", "Encoding" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.SpannerLib.V1.RowData), global::Google.Cloud.SpannerLib.V1.RowData.Parser, new[]{ "Rows", "Metadata", "Data", "Stats" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.SpannerLib.V1.MetadataRequest), global::Google.Cloud.SpannerLib.V1.MetadataRequest.Parser, new[]{ "Rows" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.SpannerLib.V1.ResultSetStatsRequest), global::Google.Cloud.SpannerLib.V1.ResultSetStatsRequest.Parser, new[]{ "Rows" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.SpannerLib.V1.ConnectionStreamRequest), global::Google.Cloud.SpannerLib.V1.ConnectionStreamRequest.Parser, new[]{ "ExecuteRequest" }, new[]{ "Request" }, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.SpannerLib.V1.ConnectionStreamResponse), global::Google.Cloud.SpannerLib.V1.ConnectionStreamResponse.Parser, new[]{ "Row" }, new[]{ "Response" }, null, null, null)
+ }));
+ }
+ #endregion
+
+ }
+ #region Messages
+ [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
+ public sealed partial class InfoRequest : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new InfoRequest());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Google.Cloud.SpannerLib.V1.SpannerlibReflection.Descriptor.MessageTypes[0]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public InfoRequest() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public InfoRequest(InfoRequest other) : this() {
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public InfoRequest Clone() {
+ return new InfoRequest(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as InfoRequest);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(InfoRequest other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(InfoRequest other) {
+ if (other == null) {
+ return;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ if ((tag & 7) == 4) {
+ // Abort on any end group tag.
+ return;
+ }
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ if ((tag & 7) == 4) {
+ // Abort on any end group tag.
+ return;
+ }
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ break;
+ }
+ }
+ }
+ #endif
+
+ }
+
+ [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
+ public sealed partial class InfoResponse : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new InfoResponse());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Google.Cloud.SpannerLib.V1.SpannerlibReflection.Descriptor.MessageTypes[1]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public InfoResponse() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public InfoResponse(InfoResponse other) : this() {
+ version_ = other.version_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public InfoResponse Clone() {
+ return new InfoResponse(this);
+ }
+
+ /// Field number for the "version" field.
+ public const int VersionFieldNumber = 1;
+ private string version_ = "";
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public string Version {
+ get { return version_; }
+ set {
+ version_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as InfoResponse);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(InfoResponse other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (Version != other.Version) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (Version.Length != 0) hash ^= Version.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (Version.Length != 0) {
+ output.WriteRawTag(10);
+ output.WriteString(Version);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (Version.Length != 0) {
+ output.WriteRawTag(10);
+ output.WriteString(Version);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (Version.Length != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeStringSize(Version);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(InfoResponse other) {
+ if (other == null) {
+ return;
+ }
+ if (other.Version.Length != 0) {
+ Version = other.Version;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ if ((tag & 7) == 4) {
+ // Abort on any end group tag.
+ return;
+ }
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ Version = input.ReadString();
+ break;
+ }
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ if ((tag & 7) == 4) {
+ // Abort on any end group tag.
+ return;
+ }
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ break;
+ case 10: {
+ Version = input.ReadString();
+ break;
+ }
+ }
+ }
+ }
+ #endif
+
+ }
+
+ [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
+ public sealed partial class CreatePoolRequest : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CreatePoolRequest());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Google.Cloud.SpannerLib.V1.SpannerlibReflection.Descriptor.MessageTypes[2]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public CreatePoolRequest() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public CreatePoolRequest(CreatePoolRequest other) : this() {
+ connectionString_ = other.connectionString_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public CreatePoolRequest Clone() {
+ return new CreatePoolRequest(this);
+ }
+
+ /// Field number for the "connection_string" field.
+ public const int ConnectionStringFieldNumber = 1;
+ private string connectionString_ = "";
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public string ConnectionString {
+ get { return connectionString_; }
+ set {
+ connectionString_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as CreatePoolRequest);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(CreatePoolRequest other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (ConnectionString != other.ConnectionString) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (ConnectionString.Length != 0) hash ^= ConnectionString.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (ConnectionString.Length != 0) {
+ output.WriteRawTag(10);
+ output.WriteString(ConnectionString);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (ConnectionString.Length != 0) {
+ output.WriteRawTag(10);
+ output.WriteString(ConnectionString);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (ConnectionString.Length != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeStringSize(ConnectionString);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(CreatePoolRequest other) {
+ if (other == null) {
+ return;
+ }
+ if (other.ConnectionString.Length != 0) {
+ ConnectionString = other.ConnectionString;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ if ((tag & 7) == 4) {
+ // Abort on any end group tag.
+ return;
+ }
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ ConnectionString = input.ReadString();
+ break;
+ }
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ if ((tag & 7) == 4) {
+ // Abort on any end group tag.
+ return;
+ }
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ break;
+ case 10: {
+ ConnectionString = input.ReadString();
+ break;
+ }
+ }
+ }
+ }
+ #endif
+
+ }
+
+ [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
+ public sealed partial class CreateConnectionRequest : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CreateConnectionRequest());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Google.Cloud.SpannerLib.V1.SpannerlibReflection.Descriptor.MessageTypes[3]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public CreateConnectionRequest() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public CreateConnectionRequest(CreateConnectionRequest other) : this() {
+ pool_ = other.pool_ != null ? other.pool_.Clone() : null;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public CreateConnectionRequest Clone() {
+ return new CreateConnectionRequest(this);
+ }
+
+ /// Field number for the "pool" field.
+ public const int PoolFieldNumber = 1;
+ private global::Google.Cloud.SpannerLib.V1.Pool pool_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public global::Google.Cloud.SpannerLib.V1.Pool Pool {
+ get { return pool_; }
+ set {
+ pool_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as CreateConnectionRequest);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(CreateConnectionRequest other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!object.Equals(Pool, other.Pool)) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (pool_ != null) hash ^= Pool.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (pool_ != null) {
+ output.WriteRawTag(10);
+ output.WriteMessage(Pool);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (pool_ != null) {
+ output.WriteRawTag(10);
+ output.WriteMessage(Pool);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (pool_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(Pool);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(CreateConnectionRequest other) {
+ if (other == null) {
+ return;
+ }
+ if (other.pool_ != null) {
+ if (pool_ == null) {
+ Pool = new global::Google.Cloud.SpannerLib.V1.Pool();
+ }
+ Pool.MergeFrom(other.Pool);
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ if ((tag & 7) == 4) {
+ // Abort on any end group tag.
+ return;
+ }
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ if (pool_ == null) {
+ Pool = new global::Google.Cloud.SpannerLib.V1.Pool();
+ }
+ input.ReadMessage(Pool);
+ break;
+ }
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ if ((tag & 7) == 4) {
+ // Abort on any end group tag.
+ return;
+ }
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ break;
+ case 10: {
+ if (pool_ == null) {
+ Pool = new global::Google.Cloud.SpannerLib.V1.Pool();
+ }
+ input.ReadMessage(Pool);
+ break;
+ }
+ }
+ }
+ }
+ #endif
+
+ }
+
+ [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
+ public sealed partial class ExecuteRequest : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ExecuteRequest());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Google.Cloud.SpannerLib.V1.SpannerlibReflection.Descriptor.MessageTypes[4]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public ExecuteRequest() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public ExecuteRequest(ExecuteRequest other) : this() {
+ connection_ = other.connection_ != null ? other.connection_.Clone() : null;
+ executeSqlRequest_ = other.executeSqlRequest_ != null ? other.executeSqlRequest_.Clone() : null;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public ExecuteRequest Clone() {
+ return new ExecuteRequest(this);
+ }
+
+ /// Field number for the "connection" field.
+ public const int ConnectionFieldNumber = 1;
+ private global::Google.Cloud.SpannerLib.V1.Connection connection_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public global::Google.Cloud.SpannerLib.V1.Connection Connection {
+ get { return connection_; }
+ set {
+ connection_ = value;
+ }
+ }
+
+ /// Field number for the "execute_sql_request" field.
+ public const int ExecuteSqlRequestFieldNumber = 2;
+ private global::Google.Cloud.Spanner.V1.ExecuteSqlRequest executeSqlRequest_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public global::Google.Cloud.Spanner.V1.ExecuteSqlRequest ExecuteSqlRequest {
+ get { return executeSqlRequest_; }
+ set {
+ executeSqlRequest_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as ExecuteRequest);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(ExecuteRequest other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!object.Equals(Connection, other.Connection)) return false;
+ if (!object.Equals(ExecuteSqlRequest, other.ExecuteSqlRequest)) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (connection_ != null) hash ^= Connection.GetHashCode();
+ if (executeSqlRequest_ != null) hash ^= ExecuteSqlRequest.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (connection_ != null) {
+ output.WriteRawTag(10);
+ output.WriteMessage(Connection);
+ }
+ if (executeSqlRequest_ != null) {
+ output.WriteRawTag(18);
+ output.WriteMessage(ExecuteSqlRequest);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (connection_ != null) {
+ output.WriteRawTag(10);
+ output.WriteMessage(Connection);
+ }
+ if (executeSqlRequest_ != null) {
+ output.WriteRawTag(18);
+ output.WriteMessage(ExecuteSqlRequest);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (connection_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(Connection);
+ }
+ if (executeSqlRequest_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(ExecuteSqlRequest);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(ExecuteRequest other) {
+ if (other == null) {
+ return;
+ }
+ if (other.connection_ != null) {
+ if (connection_ == null) {
+ Connection = new global::Google.Cloud.SpannerLib.V1.Connection();
+ }
+ Connection.MergeFrom(other.Connection);
+ }
+ if (other.executeSqlRequest_ != null) {
+ if (executeSqlRequest_ == null) {
+ ExecuteSqlRequest = new global::Google.Cloud.Spanner.V1.ExecuteSqlRequest();
+ }
+ ExecuteSqlRequest.MergeFrom(other.ExecuteSqlRequest);
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ if ((tag & 7) == 4) {
+ // Abort on any end group tag.
+ return;
+ }
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ if (connection_ == null) {
+ Connection = new global::Google.Cloud.SpannerLib.V1.Connection();
+ }
+ input.ReadMessage(Connection);
+ break;
+ }
+ case 18: {
+ if (executeSqlRequest_ == null) {
+ ExecuteSqlRequest = new global::Google.Cloud.Spanner.V1.ExecuteSqlRequest();
+ }
+ input.ReadMessage(ExecuteSqlRequest);
+ break;
+ }
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ if ((tag & 7) == 4) {
+ // Abort on any end group tag.
+ return;
+ }
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ break;
+ case 10: {
+ if (connection_ == null) {
+ Connection = new global::Google.Cloud.SpannerLib.V1.Connection();
+ }
+ input.ReadMessage(Connection);
+ break;
+ }
+ case 18: {
+ if (executeSqlRequest_ == null) {
+ ExecuteSqlRequest = new global::Google.Cloud.Spanner.V1.ExecuteSqlRequest();
+ }
+ input.ReadMessage(ExecuteSqlRequest);
+ break;
+ }
+ }
+ }
+ }
+ #endif
+
+ }
+
+ [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
+ public sealed partial class ExecuteBatchRequest : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ExecuteBatchRequest());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Google.Cloud.SpannerLib.V1.SpannerlibReflection.Descriptor.MessageTypes[5]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public ExecuteBatchRequest() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public ExecuteBatchRequest(ExecuteBatchRequest other) : this() {
+ connection_ = other.connection_ != null ? other.connection_.Clone() : null;
+ executeBatchDmlRequest_ = other.executeBatchDmlRequest_ != null ? other.executeBatchDmlRequest_.Clone() : null;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public ExecuteBatchRequest Clone() {
+ return new ExecuteBatchRequest(this);
+ }
+
+ /// Field number for the "connection" field.
+ public const int ConnectionFieldNumber = 1;
+ private global::Google.Cloud.SpannerLib.V1.Connection connection_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public global::Google.Cloud.SpannerLib.V1.Connection Connection {
+ get { return connection_; }
+ set {
+ connection_ = value;
+ }
+ }
+
+ /// Field number for the "execute_batch_dml_request" field.
+ public const int ExecuteBatchDmlRequestFieldNumber = 2;
+ private global::Google.Cloud.Spanner.V1.ExecuteBatchDmlRequest executeBatchDmlRequest_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public global::Google.Cloud.Spanner.V1.ExecuteBatchDmlRequest ExecuteBatchDmlRequest {
+ get { return executeBatchDmlRequest_; }
+ set {
+ executeBatchDmlRequest_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as ExecuteBatchRequest);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(ExecuteBatchRequest other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!object.Equals(Connection, other.Connection)) return false;
+ if (!object.Equals(ExecuteBatchDmlRequest, other.ExecuteBatchDmlRequest)) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (connection_ != null) hash ^= Connection.GetHashCode();
+ if (executeBatchDmlRequest_ != null) hash ^= ExecuteBatchDmlRequest.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (connection_ != null) {
+ output.WriteRawTag(10);
+ output.WriteMessage(Connection);
+ }
+ if (executeBatchDmlRequest_ != null) {
+ output.WriteRawTag(18);
+ output.WriteMessage(ExecuteBatchDmlRequest);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (connection_ != null) {
+ output.WriteRawTag(10);
+ output.WriteMessage(Connection);
+ }
+ if (executeBatchDmlRequest_ != null) {
+ output.WriteRawTag(18);
+ output.WriteMessage(ExecuteBatchDmlRequest);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (connection_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(Connection);
+ }
+ if (executeBatchDmlRequest_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(ExecuteBatchDmlRequest);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(ExecuteBatchRequest other) {
+ if (other == null) {
+ return;
+ }
+ if (other.connection_ != null) {
+ if (connection_ == null) {
+ Connection = new global::Google.Cloud.SpannerLib.V1.Connection();
+ }
+ Connection.MergeFrom(other.Connection);
+ }
+ if (other.executeBatchDmlRequest_ != null) {
+ if (executeBatchDmlRequest_ == null) {
+ ExecuteBatchDmlRequest = new global::Google.Cloud.Spanner.V1.ExecuteBatchDmlRequest();
+ }
+ ExecuteBatchDmlRequest.MergeFrom(other.ExecuteBatchDmlRequest);
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ if ((tag & 7) == 4) {
+ // Abort on any end group tag.
+ return;
+ }
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ if (connection_ == null) {
+ Connection = new global::Google.Cloud.SpannerLib.V1.Connection();
+ }
+ input.ReadMessage(Connection);
+ break;
+ }
+ case 18: {
+ if (executeBatchDmlRequest_ == null) {
+ ExecuteBatchDmlRequest = new global::Google.Cloud.Spanner.V1.ExecuteBatchDmlRequest();
+ }
+ input.ReadMessage(ExecuteBatchDmlRequest);
+ break;
+ }
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ if ((tag & 7) == 4) {
+ // Abort on any end group tag.
+ return;
+ }
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ break;
+ case 10: {
+ if (connection_ == null) {
+ Connection = new global::Google.Cloud.SpannerLib.V1.Connection();
+ }
+ input.ReadMessage(Connection);
+ break;
+ }
+ case 18: {
+ if (executeBatchDmlRequest_ == null) {
+ ExecuteBatchDmlRequest = new global::Google.Cloud.Spanner.V1.ExecuteBatchDmlRequest();
+ }
+ input.ReadMessage(ExecuteBatchDmlRequest);
+ break;
+ }
+ }
+ }
+ }
+ #endif
+
+ }
+
+ [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
+ public sealed partial class BeginTransactionRequest : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BeginTransactionRequest());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Google.Cloud.SpannerLib.V1.SpannerlibReflection.Descriptor.MessageTypes[6]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public BeginTransactionRequest() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public BeginTransactionRequest(BeginTransactionRequest other) : this() {
+ connection_ = other.connection_ != null ? other.connection_.Clone() : null;
+ transactionOptions_ = other.transactionOptions_ != null ? other.transactionOptions_.Clone() : null;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public BeginTransactionRequest Clone() {
+ return new BeginTransactionRequest(this);
+ }
+
+ /// Field number for the "connection" field.
+ public const int ConnectionFieldNumber = 1;
+ private global::Google.Cloud.SpannerLib.V1.Connection connection_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public global::Google.Cloud.SpannerLib.V1.Connection Connection {
+ get { return connection_; }
+ set {
+ connection_ = value;
+ }
+ }
+
+ /// Field number for the "transaction_options" field.
+ public const int TransactionOptionsFieldNumber = 2;
+ private global::Google.Cloud.Spanner.V1.TransactionOptions transactionOptions_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public global::Google.Cloud.Spanner.V1.TransactionOptions TransactionOptions {
+ get { return transactionOptions_; }
+ set {
+ transactionOptions_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as BeginTransactionRequest);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(BeginTransactionRequest other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!object.Equals(Connection, other.Connection)) return false;
+ if (!object.Equals(TransactionOptions, other.TransactionOptions)) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (connection_ != null) hash ^= Connection.GetHashCode();
+ if (transactionOptions_ != null) hash ^= TransactionOptions.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (connection_ != null) {
+ output.WriteRawTag(10);
+ output.WriteMessage(Connection);
+ }
+ if (transactionOptions_ != null) {
+ output.WriteRawTag(18);
+ output.WriteMessage(TransactionOptions);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (connection_ != null) {
+ output.WriteRawTag(10);
+ output.WriteMessage(Connection);
+ }
+ if (transactionOptions_ != null) {
+ output.WriteRawTag(18);
+ output.WriteMessage(TransactionOptions);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (connection_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(Connection);
+ }
+ if (transactionOptions_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(TransactionOptions);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(BeginTransactionRequest other) {
+ if (other == null) {
+ return;
+ }
+ if (other.connection_ != null) {
+ if (connection_ == null) {
+ Connection = new global::Google.Cloud.SpannerLib.V1.Connection();
+ }
+ Connection.MergeFrom(other.Connection);
+ }
+ if (other.transactionOptions_ != null) {
+ if (transactionOptions_ == null) {
+ TransactionOptions = new global::Google.Cloud.Spanner.V1.TransactionOptions();
+ }
+ TransactionOptions.MergeFrom(other.TransactionOptions);
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ if ((tag & 7) == 4) {
+ // Abort on any end group tag.
+ return;
+ }
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ if (connection_ == null) {
+ Connection = new global::Google.Cloud.SpannerLib.V1.Connection();
+ }
+ input.ReadMessage(Connection);
+ break;
+ }
+ case 18: {
+ if (transactionOptions_ == null) {
+ TransactionOptions = new global::Google.Cloud.Spanner.V1.TransactionOptions();
+ }
+ input.ReadMessage(TransactionOptions);
+ break;
+ }
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ if ((tag & 7) == 4) {
+ // Abort on any end group tag.
+ return;
+ }
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ break;
+ case 10: {
+ if (connection_ == null) {
+ Connection = new global::Google.Cloud.SpannerLib.V1.Connection();
+ }
+ input.ReadMessage(Connection);
+ break;
+ }
+ case 18: {
+ if (transactionOptions_ == null) {
+ TransactionOptions = new global::Google.Cloud.Spanner.V1.TransactionOptions();
+ }
+ input.ReadMessage(TransactionOptions);
+ break;
+ }
+ }
+ }
+ }
+ #endif
+
+ }
+
+ [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
+ public sealed partial class WriteMutationsRequest : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WriteMutationsRequest());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Google.Cloud.SpannerLib.V1.SpannerlibReflection.Descriptor.MessageTypes[7]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public WriteMutationsRequest() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public WriteMutationsRequest(WriteMutationsRequest other) : this() {
+ connection_ = other.connection_ != null ? other.connection_.Clone() : null;
+ mutations_ = other.mutations_ != null ? other.mutations_.Clone() : null;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public WriteMutationsRequest Clone() {
+ return new WriteMutationsRequest(this);
+ }
+
+ /// Field number for the "connection" field.
+ public const int ConnectionFieldNumber = 1;
+ private global::Google.Cloud.SpannerLib.V1.Connection connection_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public global::Google.Cloud.SpannerLib.V1.Connection Connection {
+ get { return connection_; }
+ set {
+ connection_ = value;
+ }
+ }
+
+ /// Field number for the "mutations" field.
+ public const int MutationsFieldNumber = 2;
+ private global::Google.Cloud.Spanner.V1.BatchWriteRequest.Types.MutationGroup mutations_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public global::Google.Cloud.Spanner.V1.BatchWriteRequest.Types.MutationGroup Mutations {
+ get { return mutations_; }
+ set {
+ mutations_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as WriteMutationsRequest);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(WriteMutationsRequest other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!object.Equals(Connection, other.Connection)) return false;
+ if (!object.Equals(Mutations, other.Mutations)) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (connection_ != null) hash ^= Connection.GetHashCode();
+ if (mutations_ != null) hash ^= Mutations.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (connection_ != null) {
+ output.WriteRawTag(10);
+ output.WriteMessage(Connection);
+ }
+ if (mutations_ != null) {
+ output.WriteRawTag(18);
+ output.WriteMessage(Mutations);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (connection_ != null) {
+ output.WriteRawTag(10);
+ output.WriteMessage(Connection);
+ }
+ if (mutations_ != null) {
+ output.WriteRawTag(18);
+ output.WriteMessage(Mutations);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (connection_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(Connection);
+ }
+ if (mutations_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(Mutations);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(WriteMutationsRequest other) {
+ if (other == null) {
+ return;
+ }
+ if (other.connection_ != null) {
+ if (connection_ == null) {
+ Connection = new global::Google.Cloud.SpannerLib.V1.Connection();
+ }
+ Connection.MergeFrom(other.Connection);
+ }
+ if (other.mutations_ != null) {
+ if (mutations_ == null) {
+ Mutations = new global::Google.Cloud.Spanner.V1.BatchWriteRequest.Types.MutationGroup();
+ }
+ Mutations.MergeFrom(other.Mutations);
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ if ((tag & 7) == 4) {
+ // Abort on any end group tag.
+ return;
+ }
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ if (connection_ == null) {
+ Connection = new global::Google.Cloud.SpannerLib.V1.Connection();
+ }
+ input.ReadMessage(Connection);
+ break;
+ }
+ case 18: {
+ if (mutations_ == null) {
+ Mutations = new global::Google.Cloud.Spanner.V1.BatchWriteRequest.Types.MutationGroup();
+ }
+ input.ReadMessage(Mutations);
+ break;
+ }
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ if ((tag & 7) == 4) {
+ // Abort on any end group tag.
+ return;
+ }
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ break;
+ case 10: {
+ if (connection_ == null) {
+ Connection = new global::Google.Cloud.SpannerLib.V1.Connection();
+ }
+ input.ReadMessage(Connection);
+ break;
+ }
+ case 18: {
+ if (mutations_ == null) {
+ Mutations = new global::Google.Cloud.Spanner.V1.BatchWriteRequest.Types.MutationGroup();
+ }
+ input.ReadMessage(Mutations);
+ break;
+ }
+ }
+ }
+ }
+ #endif
+
+ }
+
+ [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
+ public sealed partial class Pool : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Pool());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Google.Cloud.SpannerLib.V1.SpannerlibReflection.Descriptor.MessageTypes[8]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public Pool() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public Pool(Pool other) : this() {
+ id_ = other.id_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public Pool Clone() {
+ return new Pool(this);
+ }
+
+ /// Field number for the "id" field.
+ public const int IdFieldNumber = 1;
+ private long id_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public long Id {
+ get { return id_; }
+ set {
+ id_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as Pool);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(Pool other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (Id != other.Id) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (Id != 0L) hash ^= Id.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (Id != 0L) {
+ output.WriteRawTag(8);
+ output.WriteInt64(Id);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (Id != 0L) {
+ output.WriteRawTag(8);
+ output.WriteInt64(Id);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (Id != 0L) {
+ size += 1 + pb::CodedOutputStream.ComputeInt64Size(Id);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(Pool other) {
+ if (other == null) {
+ return;
+ }
+ if (other.Id != 0L) {
+ Id = other.Id;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ if ((tag & 7) == 4) {
+ // Abort on any end group tag.
+ return;
+ }
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 8: {
+ Id = input.ReadInt64();
+ break;
+ }
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ if ((tag & 7) == 4) {
+ // Abort on any end group tag.
+ return;
+ }
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ break;
+ case 8: {
+ Id = input.ReadInt64();
+ break;
+ }
+ }
+ }
+ }
+ #endif
+
+ }
+
+ [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
+ public sealed partial class Connection : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Connection());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Google.Cloud.SpannerLib.V1.SpannerlibReflection.Descriptor.MessageTypes[9]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public Connection() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public Connection(Connection other) : this() {
+ pool_ = other.pool_ != null ? other.pool_.Clone() : null;
+ id_ = other.id_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public Connection Clone() {
+ return new Connection(this);
+ }
+
+ /// Field number for the "pool" field.
+ public const int PoolFieldNumber = 1;
+ private global::Google.Cloud.SpannerLib.V1.Pool pool_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public global::Google.Cloud.SpannerLib.V1.Pool Pool {
+ get { return pool_; }
+ set {
+ pool_ = value;
+ }
+ }
+
+ /// Field number for the "id" field.
+ public const int IdFieldNumber = 2;
+ private long id_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public long Id {
+ get { return id_; }
+ set {
+ id_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as Connection);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(Connection other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!object.Equals(Pool, other.Pool)) return false;
+ if (Id != other.Id) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (pool_ != null) hash ^= Pool.GetHashCode();
+ if (Id != 0L) hash ^= Id.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (pool_ != null) {
+ output.WriteRawTag(10);
+ output.WriteMessage(Pool);
+ }
+ if (Id != 0L) {
+ output.WriteRawTag(16);
+ output.WriteInt64(Id);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (pool_ != null) {
+ output.WriteRawTag(10);
+ output.WriteMessage(Pool);
+ }
+ if (Id != 0L) {
+ output.WriteRawTag(16);
+ output.WriteInt64(Id);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (pool_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(Pool);
+ }
+ if (Id != 0L) {
+ size += 1 + pb::CodedOutputStream.ComputeInt64Size(Id);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(Connection other) {
+ if (other == null) {
+ return;
+ }
+ if (other.pool_ != null) {
+ if (pool_ == null) {
+ Pool = new global::Google.Cloud.SpannerLib.V1.Pool();
+ }
+ Pool.MergeFrom(other.Pool);
+ }
+ if (other.Id != 0L) {
+ Id = other.Id;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ if ((tag & 7) == 4) {
+ // Abort on any end group tag.
+ return;
+ }
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ if (pool_ == null) {
+ Pool = new global::Google.Cloud.SpannerLib.V1.Pool();
+ }
+ input.ReadMessage(Pool);
+ break;
+ }
+ case 16: {
+ Id = input.ReadInt64();
+ break;
+ }
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ if ((tag & 7) == 4) {
+ // Abort on any end group tag.
+ return;
+ }
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ break;
+ case 10: {
+ if (pool_ == null) {
+ Pool = new global::Google.Cloud.SpannerLib.V1.Pool();
+ }
+ input.ReadMessage(Pool);
+ break;
+ }
+ case 16: {
+ Id = input.ReadInt64();
+ break;
+ }
+ }
+ }
+ }
+ #endif
+
+ }
+
+ [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
+ public sealed partial class Rows : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Rows());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Google.Cloud.SpannerLib.V1.SpannerlibReflection.Descriptor.MessageTypes[10]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public Rows() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public Rows(Rows other) : this() {
+ connection_ = other.connection_ != null ? other.connection_.Clone() : null;
+ id_ = other.id_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public Rows Clone() {
+ return new Rows(this);
+ }
+
+ /// Field number for the "connection" field.
+ public const int ConnectionFieldNumber = 1;
+ private global::Google.Cloud.SpannerLib.V1.Connection connection_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public global::Google.Cloud.SpannerLib.V1.Connection Connection {
+ get { return connection_; }
+ set {
+ connection_ = value;
+ }
+ }
+
+ /// Field number for the "id" field.
+ public const int IdFieldNumber = 2;
+ private long id_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public long Id {
+ get { return id_; }
+ set {
+ id_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as Rows);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(Rows other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!object.Equals(Connection, other.Connection)) return false;
+ if (Id != other.Id) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (connection_ != null) hash ^= Connection.GetHashCode();
+ if (Id != 0L) hash ^= Id.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (connection_ != null) {
+ output.WriteRawTag(10);
+ output.WriteMessage(Connection);
+ }
+ if (Id != 0L) {
+ output.WriteRawTag(16);
+ output.WriteInt64(Id);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (connection_ != null) {
+ output.WriteRawTag(10);
+ output.WriteMessage(Connection);
+ }
+ if (Id != 0L) {
+ output.WriteRawTag(16);
+ output.WriteInt64(Id);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (connection_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(Connection);
+ }
+ if (Id != 0L) {
+ size += 1 + pb::CodedOutputStream.ComputeInt64Size(Id);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(Rows other) {
+ if (other == null) {
+ return;
+ }
+ if (other.connection_ != null) {
+ if (connection_ == null) {
+ Connection = new global::Google.Cloud.SpannerLib.V1.Connection();
+ }
+ Connection.MergeFrom(other.Connection);
+ }
+ if (other.Id != 0L) {
+ Id = other.Id;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ if ((tag & 7) == 4) {
+ // Abort on any end group tag.
+ return;
+ }
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ if (connection_ == null) {
+ Connection = new global::Google.Cloud.SpannerLib.V1.Connection();
+ }
+ input.ReadMessage(Connection);
+ break;
+ }
+ case 16: {
+ Id = input.ReadInt64();
+ break;
+ }
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ if ((tag & 7) == 4) {
+ // Abort on any end group tag.
+ return;
+ }
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ break;
+ case 10: {
+ if (connection_ == null) {
+ Connection = new global::Google.Cloud.SpannerLib.V1.Connection();
+ }
+ input.ReadMessage(Connection);
+ break;
+ }
+ case 16: {
+ Id = input.ReadInt64();
+ break;
+ }
+ }
+ }
+ }
+ #endif
+
+ }
+
+ [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
+ public sealed partial class NextRequest : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NextRequest());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Google.Cloud.SpannerLib.V1.SpannerlibReflection.Descriptor.MessageTypes[11]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public NextRequest() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public NextRequest(NextRequest other) : this() {
+ rows_ = other.rows_ != null ? other.rows_.Clone() : null;
+ numRows_ = other.numRows_;
+ encoding_ = other.encoding_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public NextRequest Clone() {
+ return new NextRequest(this);
+ }
+
+ /// Field number for the "rows" field.
+ public const int RowsFieldNumber = 1;
+ private global::Google.Cloud.SpannerLib.V1.Rows rows_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public global::Google.Cloud.SpannerLib.V1.Rows Rows {
+ get { return rows_; }
+ set {
+ rows_ = value;
+ }
+ }
+
+ /// Field number for the "num_rows" field.
+ public const int NumRowsFieldNumber = 2;
+ private long numRows_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public long NumRows {
+ get { return numRows_; }
+ set {
+ numRows_ = value;
+ }
+ }
+
+ /// Field number for the "encoding" field.
+ public const int EncodingFieldNumber = 3;
+ private long encoding_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public long Encoding {
+ get { return encoding_; }
+ set {
+ encoding_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as NextRequest);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(NextRequest other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!object.Equals(Rows, other.Rows)) return false;
+ if (NumRows != other.NumRows) return false;
+ if (Encoding != other.Encoding) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (rows_ != null) hash ^= Rows.GetHashCode();
+ if (NumRows != 0L) hash ^= NumRows.GetHashCode();
+ if (Encoding != 0L) hash ^= Encoding.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (rows_ != null) {
+ output.WriteRawTag(10);
+ output.WriteMessage(Rows);
+ }
+ if (NumRows != 0L) {
+ output.WriteRawTag(16);
+ output.WriteInt64(NumRows);
+ }
+ if (Encoding != 0L) {
+ output.WriteRawTag(24);
+ output.WriteInt64(Encoding);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (rows_ != null) {
+ output.WriteRawTag(10);
+ output.WriteMessage(Rows);
+ }
+ if (NumRows != 0L) {
+ output.WriteRawTag(16);
+ output.WriteInt64(NumRows);
+ }
+ if (Encoding != 0L) {
+ output.WriteRawTag(24);
+ output.WriteInt64(Encoding);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (rows_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(Rows);
+ }
+ if (NumRows != 0L) {
+ size += 1 + pb::CodedOutputStream.ComputeInt64Size(NumRows);
+ }
+ if (Encoding != 0L) {
+ size += 1 + pb::CodedOutputStream.ComputeInt64Size(Encoding);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(NextRequest other) {
+ if (other == null) {
+ return;
+ }
+ if (other.rows_ != null) {
+ if (rows_ == null) {
+ Rows = new global::Google.Cloud.SpannerLib.V1.Rows();
+ }
+ Rows.MergeFrom(other.Rows);
+ }
+ if (other.NumRows != 0L) {
+ NumRows = other.NumRows;
+ }
+ if (other.Encoding != 0L) {
+ Encoding = other.Encoding;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ if ((tag & 7) == 4) {
+ // Abort on any end group tag.
+ return;
+ }
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ if (rows_ == null) {
+ Rows = new global::Google.Cloud.SpannerLib.V1.Rows();
+ }
+ input.ReadMessage(Rows);
+ break;
+ }
+ case 16: {
+ NumRows = input.ReadInt64();
+ break;
+ }
+ case 24: {
+ Encoding = input.ReadInt64();
+ break;
+ }
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ if ((tag & 7) == 4) {
+ // Abort on any end group tag.
+ return;
+ }
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ break;
+ case 10: {
+ if (rows_ == null) {
+ Rows = new global::Google.Cloud.SpannerLib.V1.Rows();
+ }
+ input.ReadMessage(Rows);
+ break;
+ }
+ case 16: {
+ NumRows = input.ReadInt64();
+ break;
+ }
+ case 24: {
+ Encoding = input.ReadInt64();
+ break;
+ }
+ }
+ }
+ }
+ #endif
+
+ }
+
+ [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
+ public sealed partial class RowData : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RowData());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Google.Cloud.SpannerLib.V1.SpannerlibReflection.Descriptor.MessageTypes[12]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public RowData() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public RowData(RowData other) : this() {
+ rows_ = other.rows_ != null ? other.rows_.Clone() : null;
+ metadata_ = other.metadata_ != null ? other.metadata_.Clone() : null;
+ data_ = other.data_.Clone();
+ stats_ = other.stats_ != null ? other.stats_.Clone() : null;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public RowData Clone() {
+ return new RowData(this);
+ }
+
+ /// Field number for the "rows" field.
+ public const int RowsFieldNumber = 1;
+ private global::Google.Cloud.SpannerLib.V1.Rows rows_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public global::Google.Cloud.SpannerLib.V1.Rows Rows {
+ get { return rows_; }
+ set {
+ rows_ = value;
+ }
+ }
+
+ /// Field number for the "metadata" field.
+ public const int MetadataFieldNumber = 2;
+ private global::Google.Cloud.Spanner.V1.ResultSetMetadata metadata_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public global::Google.Cloud.Spanner.V1.ResultSetMetadata Metadata {
+ get { return metadata_; }
+ set {
+ metadata_ = value;
+ }
+ }
+
+ /// Field number for the "data" field.
+ public const int DataFieldNumber = 3;
+ private static readonly pb::FieldCodec _repeated_data_codec
+ = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.WellKnownTypes.ListValue.Parser);
+ private readonly pbc::RepeatedField data_ = new pbc::RepeatedField();
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public pbc::RepeatedField Data {
+ get { return data_; }
+ }
+
+ /// Field number for the "stats" field.
+ public const int StatsFieldNumber = 4;
+ private global::Google.Cloud.Spanner.V1.ResultSetStats stats_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public global::Google.Cloud.Spanner.V1.ResultSetStats Stats {
+ get { return stats_; }
+ set {
+ stats_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as RowData);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(RowData other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!object.Equals(Rows, other.Rows)) return false;
+ if (!object.Equals(Metadata, other.Metadata)) return false;
+ if(!data_.Equals(other.data_)) return false;
+ if (!object.Equals(Stats, other.Stats)) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (rows_ != null) hash ^= Rows.GetHashCode();
+ if (metadata_ != null) hash ^= Metadata.GetHashCode();
+ hash ^= data_.GetHashCode();
+ if (stats_ != null) hash ^= Stats.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (rows_ != null) {
+ output.WriteRawTag(10);
+ output.WriteMessage(Rows);
+ }
+ if (metadata_ != null) {
+ output.WriteRawTag(18);
+ output.WriteMessage(Metadata);
+ }
+ data_.WriteTo(output, _repeated_data_codec);
+ if (stats_ != null) {
+ output.WriteRawTag(34);
+ output.WriteMessage(Stats);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (rows_ != null) {
+ output.WriteRawTag(10);
+ output.WriteMessage(Rows);
+ }
+ if (metadata_ != null) {
+ output.WriteRawTag(18);
+ output.WriteMessage(Metadata);
+ }
+ data_.WriteTo(ref output, _repeated_data_codec);
+ if (stats_ != null) {
+ output.WriteRawTag(34);
+ output.WriteMessage(Stats);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (rows_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(Rows);
+ }
+ if (metadata_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(Metadata);
+ }
+ size += data_.CalculateSize(_repeated_data_codec);
+ if (stats_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(Stats);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(RowData other) {
+ if (other == null) {
+ return;
+ }
+ if (other.rows_ != null) {
+ if (rows_ == null) {
+ Rows = new global::Google.Cloud.SpannerLib.V1.Rows();
+ }
+ Rows.MergeFrom(other.Rows);
+ }
+ if (other.metadata_ != null) {
+ if (metadata_ == null) {
+ Metadata = new global::Google.Cloud.Spanner.V1.ResultSetMetadata();
+ }
+ Metadata.MergeFrom(other.Metadata);
+ }
+ data_.Add(other.data_);
+ if (other.stats_ != null) {
+ if (stats_ == null) {
+ Stats = new global::Google.Cloud.Spanner.V1.ResultSetStats();
+ }
+ Stats.MergeFrom(other.Stats);
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ if ((tag & 7) == 4) {
+ // Abort on any end group tag.
+ return;
+ }
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ if (rows_ == null) {
+ Rows = new global::Google.Cloud.SpannerLib.V1.Rows();
+ }
+ input.ReadMessage(Rows);
+ break;
+ }
+ case 18: {
+ if (metadata_ == null) {
+ Metadata = new global::Google.Cloud.Spanner.V1.ResultSetMetadata();
+ }
+ input.ReadMessage(Metadata);
+ break;
+ }
+ case 26: {
+ data_.AddEntriesFrom(input, _repeated_data_codec);
+ break;
+ }
+ case 34: {
+ if (stats_ == null) {
+ Stats = new global::Google.Cloud.Spanner.V1.ResultSetStats();
+ }
+ input.ReadMessage(Stats);
+ break;
+ }
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ if ((tag & 7) == 4) {
+ // Abort on any end group tag.
+ return;
+ }
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ break;
+ case 10: {
+ if (rows_ == null) {
+ Rows = new global::Google.Cloud.SpannerLib.V1.Rows();
+ }
+ input.ReadMessage(Rows);
+ break;
+ }
+ case 18: {
+ if (metadata_ == null) {
+ Metadata = new global::Google.Cloud.Spanner.V1.ResultSetMetadata();
+ }
+ input.ReadMessage(Metadata);
+ break;
+ }
+ case 26: {
+ data_.AddEntriesFrom(ref input, _repeated_data_codec);
+ break;
+ }
+ case 34: {
+ if (stats_ == null) {
+ Stats = new global::Google.Cloud.Spanner.V1.ResultSetStats();
+ }
+ input.ReadMessage(Stats);
+ break;
+ }
+ }
+ }
+ }
+ #endif
+
+ }
+
+ [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
+ public sealed partial class MetadataRequest : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MetadataRequest());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Google.Cloud.SpannerLib.V1.SpannerlibReflection.Descriptor.MessageTypes[13]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public MetadataRequest() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public MetadataRequest(MetadataRequest other) : this() {
+ rows_ = other.rows_ != null ? other.rows_.Clone() : null;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public MetadataRequest Clone() {
+ return new MetadataRequest(this);
+ }
+
+ /// Field number for the "rows" field.
+ public const int RowsFieldNumber = 1;
+ private global::Google.Cloud.SpannerLib.V1.Rows rows_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public global::Google.Cloud.SpannerLib.V1.Rows Rows {
+ get { return rows_; }
+ set {
+ rows_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as MetadataRequest);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(MetadataRequest other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!object.Equals(Rows, other.Rows)) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (rows_ != null) hash ^= Rows.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (rows_ != null) {
+ output.WriteRawTag(10);
+ output.WriteMessage(Rows);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (rows_ != null) {
+ output.WriteRawTag(10);
+ output.WriteMessage(Rows);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (rows_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(Rows);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(MetadataRequest other) {
+ if (other == null) {
+ return;
+ }
+ if (other.rows_ != null) {
+ if (rows_ == null) {
+ Rows = new global::Google.Cloud.SpannerLib.V1.Rows();
+ }
+ Rows.MergeFrom(other.Rows);
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ if ((tag & 7) == 4) {
+ // Abort on any end group tag.
+ return;
+ }
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ if (rows_ == null) {
+ Rows = new global::Google.Cloud.SpannerLib.V1.Rows();
+ }
+ input.ReadMessage(Rows);
+ break;
+ }
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ if ((tag & 7) == 4) {
+ // Abort on any end group tag.
+ return;
+ }
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ break;
+ case 10: {
+ if (rows_ == null) {
+ Rows = new global::Google.Cloud.SpannerLib.V1.Rows();
+ }
+ input.ReadMessage(Rows);
+ break;
+ }
+ }
+ }
+ }
+ #endif
+
+ }
+
+ [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
+ public sealed partial class ResultSetStatsRequest : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ResultSetStatsRequest());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Google.Cloud.SpannerLib.V1.SpannerlibReflection.Descriptor.MessageTypes[14]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public ResultSetStatsRequest() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public ResultSetStatsRequest(ResultSetStatsRequest other) : this() {
+ rows_ = other.rows_ != null ? other.rows_.Clone() : null;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public ResultSetStatsRequest Clone() {
+ return new ResultSetStatsRequest(this);
+ }
+
+ /// Field number for the "rows" field.
+ public const int RowsFieldNumber = 1;
+ private global::Google.Cloud.SpannerLib.V1.Rows rows_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public global::Google.Cloud.SpannerLib.V1.Rows Rows {
+ get { return rows_; }
+ set {
+ rows_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as ResultSetStatsRequest);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(ResultSetStatsRequest other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!object.Equals(Rows, other.Rows)) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (rows_ != null) hash ^= Rows.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (rows_ != null) {
+ output.WriteRawTag(10);
+ output.WriteMessage(Rows);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (rows_ != null) {
+ output.WriteRawTag(10);
+ output.WriteMessage(Rows);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (rows_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(Rows);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(ResultSetStatsRequest other) {
+ if (other == null) {
+ return;
+ }
+ if (other.rows_ != null) {
+ if (rows_ == null) {
+ Rows = new global::Google.Cloud.SpannerLib.V1.Rows();
+ }
+ Rows.MergeFrom(other.Rows);
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ if ((tag & 7) == 4) {
+ // Abort on any end group tag.
+ return;
+ }
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ if (rows_ == null) {
+ Rows = new global::Google.Cloud.SpannerLib.V1.Rows();
+ }
+ input.ReadMessage(Rows);
+ break;
+ }
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ if ((tag & 7) == 4) {
+ // Abort on any end group tag.
+ return;
+ }
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ break;
+ case 10: {
+ if (rows_ == null) {
+ Rows = new global::Google.Cloud.SpannerLib.V1.Rows();
+ }
+ input.ReadMessage(Rows);
+ break;
+ }
+ }
+ }
+ }
+ #endif
+
+ }
+
+ [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
+ public sealed partial class ConnectionStreamRequest : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ConnectionStreamRequest());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Google.Cloud.SpannerLib.V1.SpannerlibReflection.Descriptor.MessageTypes[15]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public ConnectionStreamRequest() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public ConnectionStreamRequest(ConnectionStreamRequest other) : this() {
+ switch (other.RequestCase) {
+ case RequestOneofCase.ExecuteRequest:
+ ExecuteRequest = other.ExecuteRequest.Clone();
+ break;
+ }
+
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public ConnectionStreamRequest Clone() {
+ return new ConnectionStreamRequest(this);
+ }
+
+ /// Field number for the "execute_request" field.
+ public const int ExecuteRequestFieldNumber = 1;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public global::Google.Cloud.SpannerLib.V1.ExecuteRequest ExecuteRequest {
+ get { return requestCase_ == RequestOneofCase.ExecuteRequest ? (global::Google.Cloud.SpannerLib.V1.ExecuteRequest) request_ : null; }
+ set {
+ request_ = value;
+ requestCase_ = value == null ? RequestOneofCase.None : RequestOneofCase.ExecuteRequest;
+ }
+ }
+
+ private object request_;
+ /// Enum of possible cases for the "request" oneof.
+ public enum RequestOneofCase {
+ None = 0,
+ ExecuteRequest = 1,
+ }
+ private RequestOneofCase requestCase_ = RequestOneofCase.None;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public RequestOneofCase RequestCase {
+ get { return requestCase_; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void ClearRequest() {
+ requestCase_ = RequestOneofCase.None;
+ request_ = null;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as ConnectionStreamRequest);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(ConnectionStreamRequest other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!object.Equals(ExecuteRequest, other.ExecuteRequest)) return false;
+ if (RequestCase != other.RequestCase) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (requestCase_ == RequestOneofCase.ExecuteRequest) hash ^= ExecuteRequest.GetHashCode();
+ hash ^= (int) requestCase_;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (requestCase_ == RequestOneofCase.ExecuteRequest) {
+ output.WriteRawTag(10);
+ output.WriteMessage(ExecuteRequest);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (requestCase_ == RequestOneofCase.ExecuteRequest) {
+ output.WriteRawTag(10);
+ output.WriteMessage(ExecuteRequest);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (requestCase_ == RequestOneofCase.ExecuteRequest) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(ExecuteRequest);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(ConnectionStreamRequest other) {
+ if (other == null) {
+ return;
+ }
+ switch (other.RequestCase) {
+ case RequestOneofCase.ExecuteRequest:
+ if (ExecuteRequest == null) {
+ ExecuteRequest = new global::Google.Cloud.SpannerLib.V1.ExecuteRequest();
+ }
+ ExecuteRequest.MergeFrom(other.ExecuteRequest);
+ break;
+ }
+
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ if ((tag & 7) == 4) {
+ // Abort on any end group tag.
+ return;
+ }
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ global::Google.Cloud.SpannerLib.V1.ExecuteRequest subBuilder = new global::Google.Cloud.SpannerLib.V1.ExecuteRequest();
+ if (requestCase_ == RequestOneofCase.ExecuteRequest) {
+ subBuilder.MergeFrom(ExecuteRequest);
+ }
+ input.ReadMessage(subBuilder);
+ ExecuteRequest = subBuilder;
+ break;
+ }
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ if ((tag & 7) == 4) {
+ // Abort on any end group tag.
+ return;
+ }
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ break;
+ case 10: {
+ global::Google.Cloud.SpannerLib.V1.ExecuteRequest subBuilder = new global::Google.Cloud.SpannerLib.V1.ExecuteRequest();
+ if (requestCase_ == RequestOneofCase.ExecuteRequest) {
+ subBuilder.MergeFrom(ExecuteRequest);
+ }
+ input.ReadMessage(subBuilder);
+ ExecuteRequest = subBuilder;
+ break;
+ }
+ }
+ }
+ }
+ #endif
+
+ }
+
+ [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
+ public sealed partial class ConnectionStreamResponse : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ConnectionStreamResponse());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Google.Cloud.SpannerLib.V1.SpannerlibReflection.Descriptor.MessageTypes[16]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public ConnectionStreamResponse() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public ConnectionStreamResponse(ConnectionStreamResponse other) : this() {
+ switch (other.ResponseCase) {
+ case ResponseOneofCase.Row:
+ Row = other.Row.Clone();
+ break;
+ }
+
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public ConnectionStreamResponse Clone() {
+ return new ConnectionStreamResponse(this);
+ }
+
+ /// Field number for the "row" field.
+ public const int RowFieldNumber = 1;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public global::Google.Cloud.Spanner.V1.PartialResultSet Row {
+ get { return responseCase_ == ResponseOneofCase.Row ? (global::Google.Cloud.Spanner.V1.PartialResultSet) response_ : null; }
+ set {
+ response_ = value;
+ responseCase_ = value == null ? ResponseOneofCase.None : ResponseOneofCase.Row;
+ }
+ }
+
+ private object response_;
+ /// Enum of possible cases for the "response" oneof.
+ public enum ResponseOneofCase {
+ None = 0,
+ Row = 1,
+ }
+ private ResponseOneofCase responseCase_ = ResponseOneofCase.None;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public ResponseOneofCase ResponseCase {
+ get { return responseCase_; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void ClearResponse() {
+ responseCase_ = ResponseOneofCase.None;
+ response_ = null;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as ConnectionStreamResponse);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(ConnectionStreamResponse other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!object.Equals(Row, other.Row)) return false;
+ if (ResponseCase != other.ResponseCase) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (responseCase_ == ResponseOneofCase.Row) hash ^= Row.GetHashCode();
+ hash ^= (int) responseCase_;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (responseCase_ == ResponseOneofCase.Row) {
+ output.WriteRawTag(10);
+ output.WriteMessage(Row);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (responseCase_ == ResponseOneofCase.Row) {
+ output.WriteRawTag(10);
+ output.WriteMessage(Row);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (responseCase_ == ResponseOneofCase.Row) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(Row);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(ConnectionStreamResponse other) {
+ if (other == null) {
+ return;
+ }
+ switch (other.ResponseCase) {
+ case ResponseOneofCase.Row:
+ if (Row == null) {
+ Row = new global::Google.Cloud.Spanner.V1.PartialResultSet();
+ }
+ Row.MergeFrom(other.Row);
+ break;
+ }
+
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ if ((tag & 7) == 4) {
+ // Abort on any end group tag.
+ return;
+ }
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ global::Google.Cloud.Spanner.V1.PartialResultSet subBuilder = new global::Google.Cloud.Spanner.V1.PartialResultSet();
+ if (responseCase_ == ResponseOneofCase.Row) {
+ subBuilder.MergeFrom(Row);
+ }
+ input.ReadMessage(subBuilder);
+ Row = subBuilder;
+ break;
+ }
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ if ((tag & 7) == 4) {
+ // Abort on any end group tag.
+ return;
+ }
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ break;
+ case 10: {
+ global::Google.Cloud.Spanner.V1.PartialResultSet subBuilder = new global::Google.Cloud.Spanner.V1.PartialResultSet();
+ if (responseCase_ == ResponseOneofCase.Row) {
+ subBuilder.MergeFrom(Row);
+ }
+ input.ReadMessage(subBuilder);
+ Row = subBuilder;
+ break;
+ }
+ }
+ }
+ }
+ #endif
+
+ }
+
+ #endregion
+
+}
+
+#endregion Designer generated code
diff --git a/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-v1/SpannerlibGrpc.cs b/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-v1/SpannerlibGrpc.cs
new file mode 100644
index 00000000..d5e9db94
--- /dev/null
+++ b/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-v1/SpannerlibGrpc.cs
@@ -0,0 +1,590 @@
+//
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/spannerlib/v1/spannerlib.proto
+//
+#pragma warning disable 0414, 1591, 8981, 0612
+#region Designer generated code
+
+using grpc = global::Grpc.Core;
+
+namespace Google.Cloud.SpannerLib.V1 {
+ public static partial class SpannerLib
+ {
+ static readonly string __ServiceName = "google.spannerlib.v1.SpannerLib";
+
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static void __Helper_SerializeMessage(global::Google.Protobuf.IMessage message, grpc::SerializationContext context)
+ {
+ #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION
+ if (message is global::Google.Protobuf.IBufferMessage)
+ {
+ context.SetPayloadLength(message.CalculateSize());
+ global::Google.Protobuf.MessageExtensions.WriteTo(message, context.GetBufferWriter());
+ context.Complete();
+ return;
+ }
+ #endif
+ context.Complete(global::Google.Protobuf.MessageExtensions.ToByteArray(message));
+ }
+
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static class __Helper_MessageCache
+ {
+ public static readonly bool IsBufferMessage = global::System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(global::Google.Protobuf.IBufferMessage)).IsAssignableFrom(typeof(T));
+ }
+
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static T __Helper_DeserializeMessage(grpc::DeserializationContext context, global::Google.Protobuf.MessageParser parser) where T : global::Google.Protobuf.IMessage
+ {
+ #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION
+ if (__Helper_MessageCache.IsBufferMessage)
+ {
+ return parser.ParseFrom(context.PayloadAsReadOnlySequence());
+ }
+ #endif
+ return parser.ParseFrom(context.PayloadAsNewBuffer());
+ }
+
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static readonly grpc::Marshaller __Marshaller_google_spannerlib_v1_InfoRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.SpannerLib.V1.InfoRequest.Parser));
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static readonly grpc::Marshaller __Marshaller_google_spannerlib_v1_InfoResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.SpannerLib.V1.InfoResponse.Parser));
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static readonly grpc::Marshaller __Marshaller_google_spannerlib_v1_CreatePoolRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.SpannerLib.V1.CreatePoolRequest.Parser));
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static readonly grpc::Marshaller __Marshaller_google_spannerlib_v1_Pool = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.SpannerLib.V1.Pool.Parser));
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static readonly grpc::Marshaller __Marshaller_google_protobuf_Empty = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Protobuf.WellKnownTypes.Empty.Parser));
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static readonly grpc::Marshaller __Marshaller_google_spannerlib_v1_CreateConnectionRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.SpannerLib.V1.CreateConnectionRequest.Parser));
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static readonly grpc::Marshaller __Marshaller_google_spannerlib_v1_Connection = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.SpannerLib.V1.Connection.Parser));
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static readonly grpc::Marshaller __Marshaller_google_spannerlib_v1_ExecuteRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.SpannerLib.V1.ExecuteRequest.Parser));
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static readonly grpc::Marshaller __Marshaller_google_spannerlib_v1_Rows = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.SpannerLib.V1.Rows.Parser));
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static readonly grpc::Marshaller __Marshaller_google_spannerlib_v1_RowData = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.SpannerLib.V1.RowData.Parser));
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static readonly grpc::Marshaller __Marshaller_google_spannerlib_v1_ExecuteBatchRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.SpannerLib.V1.ExecuteBatchRequest.Parser));
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static readonly grpc::Marshaller __Marshaller_google_spanner_v1_ExecuteBatchDmlResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.Spanner.V1.ExecuteBatchDmlResponse.Parser));
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static readonly grpc::Marshaller __Marshaller_google_spanner_v1_ResultSetMetadata = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.Spanner.V1.ResultSetMetadata.Parser));
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static readonly grpc::Marshaller __Marshaller_google_spannerlib_v1_NextRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.SpannerLib.V1.NextRequest.Parser));
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static readonly grpc::Marshaller __Marshaller_google_protobuf_ListValue = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Protobuf.WellKnownTypes.ListValue.Parser));
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static readonly grpc::Marshaller __Marshaller_google_spanner_v1_ResultSetStats = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.Spanner.V1.ResultSetStats.Parser));
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static readonly grpc::Marshaller __Marshaller_google_spannerlib_v1_BeginTransactionRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.SpannerLib.V1.BeginTransactionRequest.Parser));
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static readonly grpc::Marshaller __Marshaller_google_spanner_v1_CommitResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.Spanner.V1.CommitResponse.Parser));
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static readonly grpc::Marshaller __Marshaller_google_spannerlib_v1_WriteMutationsRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.SpannerLib.V1.WriteMutationsRequest.Parser));
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static readonly grpc::Marshaller __Marshaller_google_spannerlib_v1_ConnectionStreamRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.SpannerLib.V1.ConnectionStreamRequest.Parser));
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static readonly grpc::Marshaller __Marshaller_google_spannerlib_v1_ConnectionStreamResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.SpannerLib.V1.ConnectionStreamResponse.Parser));
+
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static readonly grpc::Method __Method_Info = new grpc::Method(
+ grpc::MethodType.Unary,
+ __ServiceName,
+ "Info",
+ __Marshaller_google_spannerlib_v1_InfoRequest,
+ __Marshaller_google_spannerlib_v1_InfoResponse);
+
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static readonly grpc::Method __Method_CreatePool = new grpc::Method(
+ grpc::MethodType.Unary,
+ __ServiceName,
+ "CreatePool",
+ __Marshaller_google_spannerlib_v1_CreatePoolRequest,
+ __Marshaller_google_spannerlib_v1_Pool);
+
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static readonly grpc::Method __Method_ClosePool = new grpc::Method(
+ grpc::MethodType.Unary,
+ __ServiceName,
+ "ClosePool",
+ __Marshaller_google_spannerlib_v1_Pool,
+ __Marshaller_google_protobuf_Empty);
+
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static readonly grpc::Method __Method_CreateConnection = new grpc::Method(
+ grpc::MethodType.Unary,
+ __ServiceName,
+ "CreateConnection",
+ __Marshaller_google_spannerlib_v1_CreateConnectionRequest,
+ __Marshaller_google_spannerlib_v1_Connection);
+
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static readonly grpc::Method __Method_CloseConnection = new grpc::Method(
+ grpc::MethodType.Unary,
+ __ServiceName,
+ "CloseConnection",
+ __Marshaller_google_spannerlib_v1_Connection,
+ __Marshaller_google_protobuf_Empty);
+
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static readonly grpc::Method __Method_Execute = new grpc::Method(
+ grpc::MethodType.Unary,
+ __ServiceName,
+ "Execute",
+ __Marshaller_google_spannerlib_v1_ExecuteRequest,
+ __Marshaller_google_spannerlib_v1_Rows);
+
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static readonly grpc::Method __Method_ExecuteStreaming = new grpc::Method(
+ grpc::MethodType.ServerStreaming,
+ __ServiceName,
+ "ExecuteStreaming",
+ __Marshaller_google_spannerlib_v1_ExecuteRequest,
+ __Marshaller_google_spannerlib_v1_RowData);
+
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static readonly grpc::Method __Method_ExecuteBatch = new grpc::Method(
+ grpc::MethodType.Unary,
+ __ServiceName,
+ "ExecuteBatch",
+ __Marshaller_google_spannerlib_v1_ExecuteBatchRequest,
+ __Marshaller_google_spanner_v1_ExecuteBatchDmlResponse);
+
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static readonly grpc::Method __Method_Metadata = new grpc::Method(
+ grpc::MethodType.Unary,
+ __ServiceName,
+ "Metadata",
+ __Marshaller_google_spannerlib_v1_Rows,
+ __Marshaller_google_spanner_v1_ResultSetMetadata);
+
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static readonly grpc::Method __Method_Next = new grpc::Method(
+ grpc::MethodType.Unary,
+ __ServiceName,
+ "Next",
+ __Marshaller_google_spannerlib_v1_NextRequest,
+ __Marshaller_google_protobuf_ListValue);
+
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static readonly grpc::Method __Method_ResultSetStats = new grpc::Method(
+ grpc::MethodType.Unary,
+ __ServiceName,
+ "ResultSetStats",
+ __Marshaller_google_spannerlib_v1_Rows,
+ __Marshaller_google_spanner_v1_ResultSetStats);
+
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static readonly grpc::Method __Method_CloseRows = new grpc::Method(
+ grpc::MethodType.Unary,
+ __ServiceName,
+ "CloseRows",
+ __Marshaller_google_spannerlib_v1_Rows,
+ __Marshaller_google_protobuf_Empty);
+
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static readonly grpc::Method __Method_BeginTransaction = new grpc::Method(
+ grpc::MethodType.Unary,
+ __ServiceName,
+ "BeginTransaction",
+ __Marshaller_google_spannerlib_v1_BeginTransactionRequest,
+ __Marshaller_google_protobuf_Empty);
+
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static readonly grpc::Method __Method_Commit = new grpc::Method(
+ grpc::MethodType.Unary,
+ __ServiceName,
+ "Commit",
+ __Marshaller_google_spannerlib_v1_Connection,
+ __Marshaller_google_spanner_v1_CommitResponse);
+
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static readonly grpc::Method __Method_Rollback = new grpc::Method(
+ grpc::MethodType.Unary,
+ __ServiceName,
+ "Rollback",
+ __Marshaller_google_spannerlib_v1_Connection,
+ __Marshaller_google_protobuf_Empty);
+
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static readonly grpc::Method __Method_WriteMutations = new grpc::Method(
+ grpc::MethodType.Unary,
+ __ServiceName,
+ "WriteMutations",
+ __Marshaller_google_spannerlib_v1_WriteMutationsRequest,
+ __Marshaller_google_spanner_v1_CommitResponse);
+
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ static readonly grpc::Method __Method_ConnectionStream = new grpc::Method(
+ grpc::MethodType.DuplexStreaming,
+ __ServiceName,
+ "ConnectionStream",
+ __Marshaller_google_spannerlib_v1_ConnectionStreamRequest,
+ __Marshaller_google_spannerlib_v1_ConnectionStreamResponse);
+
+ /// Service descriptor
+ public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
+ {
+ get { return global::Google.Cloud.SpannerLib.V1.SpannerlibReflection.Descriptor.Services[0]; }
+ }
+
+ /// Client for SpannerLib
+ public partial class SpannerLibClient : grpc::ClientBase
+ {
+ /// Creates a new client for SpannerLib
+ /// The channel to use to make remote calls.
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public SpannerLibClient(grpc::ChannelBase channel) : base(channel)
+ {
+ }
+ /// Creates a new client for SpannerLib that uses a custom CallInvoker.
+ /// The callInvoker to use to make remote calls.
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public SpannerLibClient(grpc::CallInvoker callInvoker) : base(callInvoker)
+ {
+ }
+ /// Protected parameterless constructor to allow creation of test doubles.
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ protected SpannerLibClient() : base()
+ {
+ }
+ /// Protected constructor to allow creation of configured clients.
+ /// The client configuration.
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ protected SpannerLibClient(ClientBaseConfiguration configuration) : base(configuration)
+ {
+ }
+
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual global::Google.Cloud.SpannerLib.V1.InfoResponse Info(global::Google.Cloud.SpannerLib.V1.InfoRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
+ {
+ return Info(request, new grpc::CallOptions(headers, deadline, cancellationToken));
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual global::Google.Cloud.SpannerLib.V1.InfoResponse Info(global::Google.Cloud.SpannerLib.V1.InfoRequest request, grpc::CallOptions options)
+ {
+ return CallInvoker.BlockingUnaryCall(__Method_Info, null, options, request);
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual grpc::AsyncUnaryCall InfoAsync(global::Google.Cloud.SpannerLib.V1.InfoRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
+ {
+ return InfoAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual grpc::AsyncUnaryCall InfoAsync(global::Google.Cloud.SpannerLib.V1.InfoRequest request, grpc::CallOptions options)
+ {
+ return CallInvoker.AsyncUnaryCall(__Method_Info, null, options, request);
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual global::Google.Cloud.SpannerLib.V1.Pool CreatePool(global::Google.Cloud.SpannerLib.V1.CreatePoolRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
+ {
+ return CreatePool(request, new grpc::CallOptions(headers, deadline, cancellationToken));
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual global::Google.Cloud.SpannerLib.V1.Pool CreatePool(global::Google.Cloud.SpannerLib.V1.CreatePoolRequest request, grpc::CallOptions options)
+ {
+ return CallInvoker.BlockingUnaryCall(__Method_CreatePool, null, options, request);
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual grpc::AsyncUnaryCall CreatePoolAsync(global::Google.Cloud.SpannerLib.V1.CreatePoolRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
+ {
+ return CreatePoolAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual grpc::AsyncUnaryCall CreatePoolAsync(global::Google.Cloud.SpannerLib.V1.CreatePoolRequest request, grpc::CallOptions options)
+ {
+ return CallInvoker.AsyncUnaryCall(__Method_CreatePool, null, options, request);
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual global::Google.Protobuf.WellKnownTypes.Empty ClosePool(global::Google.Cloud.SpannerLib.V1.Pool request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
+ {
+ return ClosePool(request, new grpc::CallOptions(headers, deadline, cancellationToken));
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual global::Google.Protobuf.WellKnownTypes.Empty ClosePool(global::Google.Cloud.SpannerLib.V1.Pool request, grpc::CallOptions options)
+ {
+ return CallInvoker.BlockingUnaryCall(__Method_ClosePool, null, options, request);
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual grpc::AsyncUnaryCall ClosePoolAsync(global::Google.Cloud.SpannerLib.V1.Pool request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
+ {
+ return ClosePoolAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual grpc::AsyncUnaryCall ClosePoolAsync(global::Google.Cloud.SpannerLib.V1.Pool request, grpc::CallOptions options)
+ {
+ return CallInvoker.AsyncUnaryCall(__Method_ClosePool, null, options, request);
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual global::Google.Cloud.SpannerLib.V1.Connection CreateConnection(global::Google.Cloud.SpannerLib.V1.CreateConnectionRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
+ {
+ return CreateConnection(request, new grpc::CallOptions(headers, deadline, cancellationToken));
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual global::Google.Cloud.SpannerLib.V1.Connection CreateConnection(global::Google.Cloud.SpannerLib.V1.CreateConnectionRequest request, grpc::CallOptions options)
+ {
+ return CallInvoker.BlockingUnaryCall(__Method_CreateConnection, null, options, request);
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual grpc::AsyncUnaryCall CreateConnectionAsync(global::Google.Cloud.SpannerLib.V1.CreateConnectionRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
+ {
+ return CreateConnectionAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual grpc::AsyncUnaryCall CreateConnectionAsync(global::Google.Cloud.SpannerLib.V1.CreateConnectionRequest request, grpc::CallOptions options)
+ {
+ return CallInvoker.AsyncUnaryCall(__Method_CreateConnection, null, options, request);
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual global::Google.Protobuf.WellKnownTypes.Empty CloseConnection(global::Google.Cloud.SpannerLib.V1.Connection request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
+ {
+ return CloseConnection(request, new grpc::CallOptions(headers, deadline, cancellationToken));
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual global::Google.Protobuf.WellKnownTypes.Empty CloseConnection(global::Google.Cloud.SpannerLib.V1.Connection request, grpc::CallOptions options)
+ {
+ return CallInvoker.BlockingUnaryCall(__Method_CloseConnection, null, options, request);
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual grpc::AsyncUnaryCall CloseConnectionAsync(global::Google.Cloud.SpannerLib.V1.Connection request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
+ {
+ return CloseConnectionAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual grpc::AsyncUnaryCall CloseConnectionAsync(global::Google.Cloud.SpannerLib.V1.Connection request, grpc::CallOptions options)
+ {
+ return CallInvoker.AsyncUnaryCall(__Method_CloseConnection, null, options, request);
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual global::Google.Cloud.SpannerLib.V1.Rows Execute(global::Google.Cloud.SpannerLib.V1.ExecuteRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
+ {
+ return Execute(request, new grpc::CallOptions(headers, deadline, cancellationToken));
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual global::Google.Cloud.SpannerLib.V1.Rows Execute(global::Google.Cloud.SpannerLib.V1.ExecuteRequest request, grpc::CallOptions options)
+ {
+ return CallInvoker.BlockingUnaryCall(__Method_Execute, null, options, request);
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual grpc::AsyncUnaryCall ExecuteAsync(global::Google.Cloud.SpannerLib.V1.ExecuteRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
+ {
+ return ExecuteAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual grpc::AsyncUnaryCall ExecuteAsync(global::Google.Cloud.SpannerLib.V1.ExecuteRequest request, grpc::CallOptions options)
+ {
+ return CallInvoker.AsyncUnaryCall(__Method_Execute, null, options, request);
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual grpc::AsyncServerStreamingCall ExecuteStreaming(global::Google.Cloud.SpannerLib.V1.ExecuteRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
+ {
+ return ExecuteStreaming(request, new grpc::CallOptions(headers, deadline, cancellationToken));
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual grpc::AsyncServerStreamingCall ExecuteStreaming(global::Google.Cloud.SpannerLib.V1.ExecuteRequest request, grpc::CallOptions options)
+ {
+ return CallInvoker.AsyncServerStreamingCall(__Method_ExecuteStreaming, null, options, request);
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual global::Google.Cloud.Spanner.V1.ExecuteBatchDmlResponse ExecuteBatch(global::Google.Cloud.SpannerLib.V1.ExecuteBatchRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
+ {
+ return ExecuteBatch(request, new grpc::CallOptions(headers, deadline, cancellationToken));
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual global::Google.Cloud.Spanner.V1.ExecuteBatchDmlResponse ExecuteBatch(global::Google.Cloud.SpannerLib.V1.ExecuteBatchRequest request, grpc::CallOptions options)
+ {
+ return CallInvoker.BlockingUnaryCall(__Method_ExecuteBatch, null, options, request);
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual grpc::AsyncUnaryCall ExecuteBatchAsync(global::Google.Cloud.SpannerLib.V1.ExecuteBatchRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
+ {
+ return ExecuteBatchAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual grpc::AsyncUnaryCall ExecuteBatchAsync(global::Google.Cloud.SpannerLib.V1.ExecuteBatchRequest request, grpc::CallOptions options)
+ {
+ return CallInvoker.AsyncUnaryCall(__Method_ExecuteBatch, null, options, request);
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual global::Google.Cloud.Spanner.V1.ResultSetMetadata Metadata(global::Google.Cloud.SpannerLib.V1.Rows request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
+ {
+ return Metadata(request, new grpc::CallOptions(headers, deadline, cancellationToken));
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual global::Google.Cloud.Spanner.V1.ResultSetMetadata Metadata(global::Google.Cloud.SpannerLib.V1.Rows request, grpc::CallOptions options)
+ {
+ return CallInvoker.BlockingUnaryCall(__Method_Metadata, null, options, request);
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual grpc::AsyncUnaryCall MetadataAsync(global::Google.Cloud.SpannerLib.V1.Rows request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
+ {
+ return MetadataAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual grpc::AsyncUnaryCall MetadataAsync(global::Google.Cloud.SpannerLib.V1.Rows request, grpc::CallOptions options)
+ {
+ return CallInvoker.AsyncUnaryCall(__Method_Metadata, null, options, request);
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual global::Google.Protobuf.WellKnownTypes.ListValue Next(global::Google.Cloud.SpannerLib.V1.NextRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
+ {
+ return Next(request, new grpc::CallOptions(headers, deadline, cancellationToken));
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual global::Google.Protobuf.WellKnownTypes.ListValue Next(global::Google.Cloud.SpannerLib.V1.NextRequest request, grpc::CallOptions options)
+ {
+ return CallInvoker.BlockingUnaryCall(__Method_Next, null, options, request);
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual grpc::AsyncUnaryCall NextAsync(global::Google.Cloud.SpannerLib.V1.NextRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
+ {
+ return NextAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual grpc::AsyncUnaryCall NextAsync(global::Google.Cloud.SpannerLib.V1.NextRequest request, grpc::CallOptions options)
+ {
+ return CallInvoker.AsyncUnaryCall(__Method_Next, null, options, request);
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual global::Google.Cloud.Spanner.V1.ResultSetStats ResultSetStats(global::Google.Cloud.SpannerLib.V1.Rows request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
+ {
+ return ResultSetStats(request, new grpc::CallOptions(headers, deadline, cancellationToken));
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual global::Google.Cloud.Spanner.V1.ResultSetStats ResultSetStats(global::Google.Cloud.SpannerLib.V1.Rows request, grpc::CallOptions options)
+ {
+ return CallInvoker.BlockingUnaryCall(__Method_ResultSetStats, null, options, request);
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual grpc::AsyncUnaryCall ResultSetStatsAsync(global::Google.Cloud.SpannerLib.V1.Rows request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
+ {
+ return ResultSetStatsAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual grpc::AsyncUnaryCall ResultSetStatsAsync(global::Google.Cloud.SpannerLib.V1.Rows request, grpc::CallOptions options)
+ {
+ return CallInvoker.AsyncUnaryCall(__Method_ResultSetStats, null, options, request);
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual global::Google.Protobuf.WellKnownTypes.Empty CloseRows(global::Google.Cloud.SpannerLib.V1.Rows request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
+ {
+ return CloseRows(request, new grpc::CallOptions(headers, deadline, cancellationToken));
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual global::Google.Protobuf.WellKnownTypes.Empty CloseRows(global::Google.Cloud.SpannerLib.V1.Rows request, grpc::CallOptions options)
+ {
+ return CallInvoker.BlockingUnaryCall(__Method_CloseRows, null, options, request);
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual grpc::AsyncUnaryCall CloseRowsAsync(global::Google.Cloud.SpannerLib.V1.Rows request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
+ {
+ return CloseRowsAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual grpc::AsyncUnaryCall CloseRowsAsync(global::Google.Cloud.SpannerLib.V1.Rows request, grpc::CallOptions options)
+ {
+ return CallInvoker.AsyncUnaryCall(__Method_CloseRows, null, options, request);
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual global::Google.Protobuf.WellKnownTypes.Empty BeginTransaction(global::Google.Cloud.SpannerLib.V1.BeginTransactionRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
+ {
+ return BeginTransaction(request, new grpc::CallOptions(headers, deadline, cancellationToken));
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual global::Google.Protobuf.WellKnownTypes.Empty BeginTransaction(global::Google.Cloud.SpannerLib.V1.BeginTransactionRequest request, grpc::CallOptions options)
+ {
+ return CallInvoker.BlockingUnaryCall(__Method_BeginTransaction, null, options, request);
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual grpc::AsyncUnaryCall BeginTransactionAsync(global::Google.Cloud.SpannerLib.V1.BeginTransactionRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
+ {
+ return BeginTransactionAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual grpc::AsyncUnaryCall BeginTransactionAsync(global::Google.Cloud.SpannerLib.V1.BeginTransactionRequest request, grpc::CallOptions options)
+ {
+ return CallInvoker.AsyncUnaryCall(__Method_BeginTransaction, null, options, request);
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual global::Google.Cloud.Spanner.V1.CommitResponse Commit(global::Google.Cloud.SpannerLib.V1.Connection request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
+ {
+ return Commit(request, new grpc::CallOptions(headers, deadline, cancellationToken));
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual global::Google.Cloud.Spanner.V1.CommitResponse Commit(global::Google.Cloud.SpannerLib.V1.Connection request, grpc::CallOptions options)
+ {
+ return CallInvoker.BlockingUnaryCall(__Method_Commit, null, options, request);
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual grpc::AsyncUnaryCall CommitAsync(global::Google.Cloud.SpannerLib.V1.Connection request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
+ {
+ return CommitAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual grpc::AsyncUnaryCall CommitAsync(global::Google.Cloud.SpannerLib.V1.Connection request, grpc::CallOptions options)
+ {
+ return CallInvoker.AsyncUnaryCall(__Method_Commit, null, options, request);
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual global::Google.Protobuf.WellKnownTypes.Empty Rollback(global::Google.Cloud.SpannerLib.V1.Connection request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
+ {
+ return Rollback(request, new grpc::CallOptions(headers, deadline, cancellationToken));
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual global::Google.Protobuf.WellKnownTypes.Empty Rollback(global::Google.Cloud.SpannerLib.V1.Connection request, grpc::CallOptions options)
+ {
+ return CallInvoker.BlockingUnaryCall(__Method_Rollback, null, options, request);
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual grpc::AsyncUnaryCall RollbackAsync(global::Google.Cloud.SpannerLib.V1.Connection request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
+ {
+ return RollbackAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual grpc::AsyncUnaryCall RollbackAsync(global::Google.Cloud.SpannerLib.V1.Connection request, grpc::CallOptions options)
+ {
+ return CallInvoker.AsyncUnaryCall(__Method_Rollback, null, options, request);
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual global::Google.Cloud.Spanner.V1.CommitResponse WriteMutations(global::Google.Cloud.SpannerLib.V1.WriteMutationsRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
+ {
+ return WriteMutations(request, new grpc::CallOptions(headers, deadline, cancellationToken));
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual global::Google.Cloud.Spanner.V1.CommitResponse WriteMutations(global::Google.Cloud.SpannerLib.V1.WriteMutationsRequest request, grpc::CallOptions options)
+ {
+ return CallInvoker.BlockingUnaryCall(__Method_WriteMutations, null, options, request);
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual grpc::AsyncUnaryCall WriteMutationsAsync(global::Google.Cloud.SpannerLib.V1.WriteMutationsRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
+ {
+ return WriteMutationsAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual grpc::AsyncUnaryCall WriteMutationsAsync(global::Google.Cloud.SpannerLib.V1.WriteMutationsRequest request, grpc::CallOptions options)
+ {
+ return CallInvoker.AsyncUnaryCall(__Method_WriteMutations, null, options, request);
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual grpc::AsyncDuplexStreamingCall ConnectionStream(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
+ {
+ return ConnectionStream(new grpc::CallOptions(headers, deadline, cancellationToken));
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ public virtual grpc::AsyncDuplexStreamingCall ConnectionStream(grpc::CallOptions options)
+ {
+ return CallInvoker.AsyncDuplexStreamingCall(__Method_ConnectionStream, null, options);
+ }
+ /// Creates a new instance of client from given ClientBaseConfiguration.
+ [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
+ protected override SpannerLibClient NewInstance(ClientBaseConfiguration configuration)
+ {
+ return new SpannerLibClient(configuration);
+ }
+ }
+
+ }
+}
+#endregion
diff --git a/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-v1/spannerlib-dotnet-grpc-v1.csproj b/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-v1/spannerlib-dotnet-grpc-v1.csproj
new file mode 100644
index 00000000..17c3d74d
--- /dev/null
+++ b/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-v1/spannerlib-dotnet-grpc-v1.csproj
@@ -0,0 +1,18 @@
+
+
+
+ netstandard2.1
+ Google.Cloud.SpannerLib.V1
+ enable
+ default
+ Alpha.Google.Cloud.SpannerLib.Grpc.V1
+ 1.0.0-alpha.20251009140944
+ Google
+
+
+
+
+
+
+
+
diff --git a/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-mockserver/MockServerStartup.cs b/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-mockserver/MockServerStartup.cs
new file mode 100644
index 00000000..8553f8ec
--- /dev/null
+++ b/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-mockserver/MockServerStartup.cs
@@ -0,0 +1,68 @@
+// Copyright 2025 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Hosting;
+
+namespace Google.Cloud.SpannerLib.MockServer;
+
+///
+/// Helper class for starting an in-memory mock Spanner server that is used for testing.
+///
+public class MockServerStartup(MockSpannerService mockSpannerService, MockDatabaseAdminService mockDatabaseAdminService)
+{
+ ///
+ /// The in-mem Spanner service.
+ ///
+ private MockSpannerService MockSpannerService { get; } = mockSpannerService;
+
+ ///
+ /// The in-mem Spanner database admin service for executing DDL operations.
+ ///
+ private MockDatabaseAdminService MockDatabaseAdminService { get; } = mockDatabaseAdminService;
+
+ ///
+ /// Configures the services that will be available on this gRPC server.
+ /// This method is called by reflection when the tests are started.
+ ///
+ /// The services collection where the services should be added
+ public void ConfigureServices(IServiceCollection services)
+ {
+ services.AddGrpc();
+ services.AddSingleton(MockSpannerService);
+ services.AddSingleton(MockDatabaseAdminService);
+ }
+
+ ///
+ /// Configures the gRPC server. This method is called by reflection when the tests are started.
+ ///
+ /// The builder for the application that will be hosting the service
+ /// The webhost environment that is hosting the service
+ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
+ {
+ if (env.IsDevelopment())
+ {
+ app.UseDeveloperExceptionPage();
+ }
+
+ app.UseRouting();
+ app.UseEndpoints(endpoints =>
+ {
+ endpoints.MapGrpcService();
+ endpoints.MapGrpcService();
+ });
+ }
+}
\ No newline at end of file
diff --git a/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-mockserver/MockSpannerServer.cs b/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-mockserver/MockSpannerServer.cs
new file mode 100644
index 00000000..dabc42f0
--- /dev/null
+++ b/spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-mockserver/MockSpannerServer.cs
@@ -0,0 +1,806 @@
+// Copyright 2025 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+using System.Collections;
+using System.Collections.Concurrent;
+using Google.Cloud.Spanner.Admin.Database.V1;
+using Google.Cloud.Spanner.Common.V1;
+using Google.Cloud.Spanner.V1;
+using Google.LongRunning;
+using Google.Protobuf;
+using Google.Protobuf.WellKnownTypes;
+using Google.Rpc;
+using Grpc.Core;
+using Status = Google.Rpc.Status;
+using GrpcCore = Grpc.Core;
+
+namespace Google.Cloud.SpannerLib.MockServer;
+
+public class StatementResult
+{
+ public enum StatementResultType
+ {
+ ResultSet,
+ UpdateCount,
+ Exception
+ }
+
+ public StatementResultType Type { get; }
+ public ResultSet? ResultSet { get; }
+ public long UpdateCount { get; }
+ public Exception? Exception { get; }
+
+ public static StatementResult CreateQuery(ResultSet resultSet)
+ {
+ return new StatementResult(resultSet);
+ }
+
+ public static StatementResult CreateUpdateCount(long count)
+ {
+ return new StatementResult(count);
+ }
+
+ public static StatementResult CreateException(Exception exception)
+ {
+ return new StatementResult(exception);
+ }
+
+ public static StatementResult CreateSelect1ResultSet()
+ {
+ return CreateSingleColumnResultSet(new Spanner.V1.Type { Code = Spanner.V1.TypeCode.Int64 }, "COL1", 1);
+ }
+
+ public static StatementResult CreateSingleColumnResultSet(Spanner.V1.Type type, string col, params object[] values)
+ => CreateSingleColumnResultSet(null, type, col, values);
+
+ public static StatementResult CreateSingleColumnResultSet(long? updateCount, Spanner.V1.Type type, string col, params object[] values)
+ {
+ ResultSet rs = new ResultSet
+ {
+ Metadata = new ResultSetMetadata
+ {
+ RowType = new StructType()
+ },
+ };
+ rs.Metadata.RowType.Fields.Add(new StructType.Types.Field
+ {
+ Name = col,
+ Type = type,
+ });
+ foreach (object val in values)
+ {
+ ListValue row = new ListValue();
+ row.Values.Add(SpannerConverter.ToProtobufValue(type, val));
+ rs.Rows.Add(row);
+ }
+ if (updateCount != null)
+ {
+ rs.Stats = new ResultSetStats { RowCountExact = updateCount.Value };
+ }
+ return CreateQuery(rs);
+ }
+
+ public static StatementResult CreateResultSet(IEnumerable> columns, IEnumerable