Skip to content

Commit d122aa3

Browse files
olavloiterenovate-botrelease-please[bot]pracucciaakashanandg
authored
chore: add .NET gRPC wrapper (#539)
* fix: update dependency net.java.dev.jna:jna to v5.18.0 (#538) * chore: update all dependencies (#537) * fix: update all dependencies (#536) * fix: update all dependencies * chore: go mod tidy --------- Co-authored-by: Knut Olav Løite <koloite@gmail.com> * chore(main): release 1.18.1 (#525) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> * fix: update module github.com/googleapis/go-sql-spanner to v1.18.1 (#540) * chore: add .NET gRPC wrapper Adds a gRPC wrapper for .NET. This wrapper uses the gRPC API to connect to SpannerLib. The gRPC channel uses a Unix domain socket. * fix: update dependency net.java.dev.jna:jna to v5.18.1 (#544) This PR contains the following updates: | Package | Change | Age | Confidence | |---|---|---|---| | [net.java.dev.jna:jna](https://redirect.github.com/java-native-access/jna) | `5.18.0` -> `5.18.1` | [![age](https://developer.mend.io/api/mc/badges/age/maven/net.java.dev.jna:jna/5.18.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/net.java.dev.jna:jna/5.18.0/5.18.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>java-native-access/jna (net.java.dev.jna:jna)</summary> ### [`v5.18.1`](https://redirect.github.com/java-native-access/jna/blob/HEAD/CHANGES.md#Release-5181) [Compare Source](https://redirect.github.com/java-native-access/jna/compare/5.18.0...5.18.1) \============== ## Bug Fixes - [#&#8203;1686](https://redirect.github.com/java-native-access/jna/issues/1686): Fix `sortFields` race condition while getting fields - [@&#8203;bendk](https://redirect.github.com/bendk). </details> --- ### Configuration 📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/googleapis/go-sql-spanner). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xMzEuOSIsInVwZGF0ZWRJblZlciI6IjQxLjEzMS45IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> * feat: add authority param support to DSN (#546) Signed-off-by: Marco Pracucci <marco@pracucci.com> * fix: update all dependencies (#542) * fix: update all dependencies * chore: go mod tidy * build: add ByteBuddy for Java wrapper --------- Co-authored-by: Knut Olav Løite <koloite@gmail.com> * feat(ruby): Add Ruby FFI wrapper for spannerlib (#545) * feat(ruby): add Ruby FFI wrapper for spannerlib * chore(main): release 1.19.0 (#541) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> * chore: store temp TransactionOptions in connection state (#548) Store temporary TransactionOptions in the connection state as local options. Local options only apply to the current transaction. This simplifies the internal state handling of the driver, as all transaction state should only be read from the connection state, and not also from a temporary variable. This also enables the use of a combination of temporary transaction options and using SQL statements to set further options. The shared library always includes temporary transaction options, as the BeginTransaction function accepts TransactionOptions as an input argument. This meant that using SQL statements to set further transaction options was not supported through the shared library. * feat: parse SET TRANSACTION statements (#549) * feat: parse SET TRANSACTION statements Parse SET TRANSACTION statements and translate these to SET LOCAL statements. SET TRANSACTION may only be executed in a transaction block, and can only be used for a specific, limited set of connection properties. The syntax is specified by the SQL standard and PostgreSQL. See also https://www.postgresql.org/docs/current/sql-set-transaction.html This change only adds partial support. The following features will be added in future changes: 1. SET TRANSACTION READ {WRITE | ONLY} is not picked up by the driver, as the type of transaction is set directly when BeginTx is called. A refactor of this transaction handling is needed to be able to pick up SET TRANSACTION READ ONLY / SET TRANSACTION READ WRITE statements that are executed after BeginTx has been called. 2. PostgreSQL allows multiple transaction modes to be set in a single SET TRANSACTION statement. E.g. the following is allowed: SET TRANSACTION READ WRITE, ISOLATION LEVEL SERIALIZABLE The current implementation only supports one transaction mode per SET statement. * feat: support multiple transaction options in one statement * feat: support transaction options in BEGIN statements (#550) * feat: parse SET TRANSACTION statements Parse SET TRANSACTION statements and translate these to SET LOCAL statements. SET TRANSACTION may only be executed in a transaction block, and can only be used for a specific, limited set of connection properties. The syntax is specified by the SQL standard and PostgreSQL. See also https://www.postgresql.org/docs/current/sql-set-transaction.html This change only adds partial support. The following features will be added in future changes: 1. SET TRANSACTION READ {WRITE | ONLY} is not picked up by the driver, as the type of transaction is set directly when BeginTx is called. A refactor of this transaction handling is needed to be able to pick up SET TRANSACTION READ ONLY / SET TRANSACTION READ WRITE statements that are executed after BeginTx has been called. 2. PostgreSQL allows multiple transaction modes to be set in a single SET TRANSACTION statement. E.g. the following is allowed: SET TRANSACTION READ WRITE, ISOLATION LEVEL SERIALIZABLE The current implementation only supports one transaction mode per SET statement. * feat: support multiple transaction options in one statement * feat: support transaction options in BEGIN statements Adds support for including transaction options in BEGIN statements, like: ```sql BEGIN READ ONLY; BEGIN READ WRITE; BEGIN TRANSACTION ISOLATION LEVEL REPEATABLE READ; BEGIN READ WRITE, ISOLATION LEVEL SERIALIZABLE; ``` * chore: re-trigger checks * chore: add timeout for server startup --------- Signed-off-by: Marco Pracucci <marco@pracucci.com> Co-authored-by: Mend Renovate <bot@renovateapp.com> Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Marco Pracucci <marco@pracucci.com> Co-authored-by: aakashanandg <aakashanand@google.com>
1 parent 7716c72 commit d122aa3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+7876
-494
lines changed

.github/workflows/spanner-lib-tests.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ jobs:
9797
go-version: ${{ matrix.go-version }}
9898
- name: Checkout code
9999
uses: actions/checkout@v4
100+
with:
101+
submodules: 'true'
100102
- name: Build shared library
101103
working-directory: spannerlib/shared
102104
run: go build -o spannerlib.so -buildmode=c-shared shared_lib.go
@@ -124,6 +126,34 @@ jobs:
124126
fi
125127
working-directory: spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-native
126128
shell: bash
129+
- name: Build gRPC server
130+
working-directory: spannerlib/grpc-server
131+
run: |
132+
go build -o grpc_server server.go
133+
chmod +x grpc_server
134+
- name: Copy gRPC server to .NET wrapper
135+
working-directory: spannerlib
136+
run: |
137+
mkdir -p wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-server/binaries/any
138+
if [ "$RUNNER_OS" == "Windows" ]; then
139+
cp grpc-server/grpc_server wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-server/binaries/any/grpc_server.exe
140+
else
141+
cp grpc-server/grpc_server wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-server/binaries/any/grpc_server
142+
fi
143+
shell: bash
144+
- name: Build .NET gRPC server package
145+
run: dotnet pack
146+
working-directory: spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-server
147+
shell: bash
148+
- name: Add .NET package source
149+
run: |
150+
if [ "$RUNNER_OS" == "Windows" ]; then
151+
dotnet nuget add source ${GITHUB_WORKSPACE}"\spannerlib\wrappers\spannerlib-dotnet\spannerlib-dotnet-grpc-server\bin\Release" --name local-grpc-server
152+
else
153+
dotnet nuget add source "$PWD"/bin/Release --name local-grpc-server
154+
fi
155+
working-directory: spannerlib/wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-server
156+
shell: bash
127157
- name: Restore dependencies
128158
run: dotnet restore
129159
working-directory: spannerlib/wrappers/spannerlib-dotnet
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
go build -o grpc_server server.go
2+
chmod +x grpc_server
3+
cp grpc_server ../wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc/binaries/any/grpc_server
4+
cp grpc_server ../wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc/binaries/osx-arm64/grpc_server
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
go build -o grpc_server server.go
22
chmod +x grpc_server
3+
mkdir -p ../wrappers/spannerlib-java/src/main/resources/darwin-aarch64
34
cp grpc_server ../wrappers/spannerlib-java/src/main/resources/darwin-aarch64/grpc_server

spannerlib/grpc-server/build-protos.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
PATH="${PATH}:${HOME}/go/bin"
2-
rm -rf googleapis/google/spannerlib || true
3-
cp -r google/spannerlib googleapis/google/spannerlib
2+
ln -sf "${PWD}"/google/spannerlib googleapis/google/spannerlib
43
cd googleapis || exit 1
54
protoc \
65
--go_out=../ \
@@ -14,5 +13,13 @@ protoc \
1413
--java-grpc_out=../../wrappers/spannerlib-java/src/main/java/ \
1514
--java-grpc_opt=paths=source_relative \
1615
google/spannerlib/v1/spannerlib.proto
16+
protoc \
17+
--csharp_out=../../wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-v1/ \
18+
--plugin=protoc-gen-csharp_grpc=/Users/loite/.nuget/packages/grpc.tools/2.72.0/tools/macosx_x64/grpc_csharp_plugin \
19+
--csharp_grpc_out=../../wrappers/spannerlib-dotnet/spannerlib-dotnet-grpc-v1/ \
20+
--csharp_opt=file_extension=.g.cs \
21+
--csharp_grpc_opt=no_server \
22+
--proto_path=. \
23+
google/spannerlib/v1/spannerlib.proto
1724
cd .. || exit 1
18-
rm -rf googleapis/google/spannerlib
25+
rm googleapis/google/spannerlib
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/Users/loite/GolandProjects/go-sql-spanner/spannerlib/grpc-server/google/spannerlib

0 commit comments

Comments
 (0)