Skip to content

chore: create shared lib for connections #420

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 26 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
d1d3109
chore: create shared lib for connections
olavloite May 16, 2025
3447ae4
Merge branch 'main' into spanner-lib
olavloite May 29, 2025
4d7aad9
chore: add more features
olavloite Jun 4, 2025
21a1c4a
Merge branch 'main' into spanner-lib
olavloite Jun 10, 2025
93f38ba
feat: add transactions
olavloite Jun 12, 2025
312ff67
docs: add code comments
olavloite Jun 16, 2025
f898b49
Merge branch 'main' into spanner-lib
olavloite Jun 16, 2025
251d4ce
feat: move metadata and stats to separate result sets
olavloite Jun 16, 2025
8ac5e6b
feat: add option to return metadata and stats
olavloite Jun 17, 2025
304082f
Merge branch 'main' into return-metadata-and-stats
olavloite Jun 17, 2025
f9ff983
Merge branch 'return-metadata-and-stats' into spanner-lib
olavloite Jun 18, 2025
2de8b88
feat: support timestampbound for single-use read-only tx
olavloite Jun 19, 2025
6667833
test: add more tests
olavloite Jun 23, 2025
3a1ce86
feat: add mutations support
olavloite Jun 25, 2025
91cf56c
test: add tests for dotnet
olavloite Jun 25, 2025
b819fd9
Merge branch 'main' into spanner-lib
olavloite Jun 25, 2025
3db43be
Merge branch 'main' into spanner-lib
olavloite Jun 26, 2025
872a83d
chore: go mod tidy
olavloite Jun 26, 2025
ce6db93
chore: refactor dotnet lib
olavloite Jun 26, 2025
9ab50f2
chore: use separate classes per arch
olavloite Jun 26, 2025
4b910fb
chore: update description
olavloite Jun 27, 2025
2cf0e32
chore: change libraries to packed content
olavloite Jun 27, 2025
cc9fc07
chore: refactor dotnet lib
olavloite Jun 30, 2025
c25dcee
chore: separate native lib + use standard dotnet runtime setup
olavloite Jun 30, 2025
56d667e
Merge branch 'main' into spanner-lib
olavloite Jun 30, 2025
e83455c
chore: cleanup
olavloite Jun 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions .github/workflows/release-dotnet-native-spanner-lib.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
on:
workflow_dispatch:
permissions:
contents: read
pull-requests: write
name: Build and Release Google.Cloud.SpannerLib.Native
jobs:
build-linux-x64:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.24
- name: Checkout code
uses: actions/checkout@v4
- name: Build shared library
working-directory: spannerlib
run: go build -o spannerlib.so -buildmode=c-shared
- name: Upload linux-x64
uses: actions/upload-artifact@v4
with:
name: spannerlib-linux-x64
path: spannerlib/spannerlib.so
build-osx-arm64:
runs-on: macos-latest
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.24
- name: Checkout code
uses: actions/checkout@v4
- name: Build shared library
working-directory: spannerlib
run: go build -o spannerlib.dylib -buildmode=c-shared
- name: Upload osx-arm64
uses: actions/upload-artifact@v4
with:
name: spannerlib-osx-arm64
path: spannerlib/spannerlib.dylib
build-and-package:
needs: [build-linux-x64, build-osx-arm64]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download and copy linux-x64
uses: actions/download-artifact@v4
with:
name: spannerlib-linux-x64
path: spannerlib/dotnet-spannerlib/Google.Cloud.SpannerLib.Native/libraries/linux-x64/
- name: Download and copy osx-arm64
uses: actions/download-artifact@v4
with:
name: spannerlib-osx-arm64
path: spannerlib/dotnet-spannerlib/Google.Cloud.SpannerLib.Native/libraries/osx-arm64/
- name: Install dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: dotnet version
run: dotnet --version
- name: Build native library package
run: dotnet pack
working-directory: spannerlib/dotnet-spannerlib/Google.Cloud.SpannerLib.Native
- name: Add package source
run: dotnet nuget add source "$PWD"/bin/Release --name local
working-directory: spannerlib/dotnet-spannerlib/Google.Cloud.SpannerLib.Native
- name: Restore dependencies
run: dotnet restore
working-directory: spannerlib/dotnet-spannerlib
- name: Build
run: dotnet build --no-restore
working-directory: spannerlib/dotnet-spannerlib
- name: Unit Tests
working-directory: spannerlib/dotnet-spannerlib/Google.Cloud.SpannerLib.Tests
run: dotnet test --no-build --verbosity normal
- name: Publish SpannerLib.Native to nuget
run: dotnet nuget push bin/Release/Experimental.SpannerLib.Native.*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
working-directory: spannerlib/dotnet-spannerlib/Google.Cloud.SpannerLib.Native
- name: Build SpannerLib
run: dotnet pack
working-directory: spannerlib/dotnet-spannerlib/Google.Cloud.SpannerLib
- name: Publish SpannerLib to nuget
run: dotnet nuget push bin/Release/Experimental.SpannerLib.*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
working-directory: spannerlib/dotnet-spannerlib/Google.Cloud.SpannerLib
81 changes: 81 additions & 0 deletions .github/workflows/spanner-lib-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
on:
push:
branches: [ main ]
pull_request:
permissions:
contents: read
pull-requests: write
name: Spanner Lib Tests
jobs:
test:
strategy:
matrix:
go-version: [1.24.x]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v4
- name: Run unit tests
working-directory: spannerlib/exported
run: go test -race -short

build-lib:
strategy:
matrix:
go-version: [1.24.x]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v4
- name: Build shared lib
working-directory: spannerlib
run: go build -o spannerlib.so -buildmode=c-shared

test-dotnet-ubuntu:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.24
- name: Checkout code
uses: actions/checkout@v4
- name: Build shared lib
working-directory: spannerlib
run: go build -o spannerlib.so -buildmode=c-shared
- name: Copy lib to dotnet folder
working-directory: spannerlib
run: |
mkdir -p dotnet-spannerlib/Google.Cloud.SpannerLib.Native/libraries/any
cp spannerlib.so dotnet-spannerlib/Google.Cloud.SpannerLib.Native/libraries/any/spannerlib.so
- name: Install dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: dotnet version
run: dotnet --version
- name: Build native library package
run: dotnet pack
working-directory: spannerlib/dotnet-spannerlib/Google.Cloud.SpannerLib.Native
- name: Add package source
run: dotnet nuget add source "$PWD"/bin/Release --name local
working-directory: spannerlib/dotnet-spannerlib/Google.Cloud.SpannerLib.Native
- name: Restore dependencies
run: dotnet restore
working-directory: spannerlib/dotnet-spannerlib
- name: Build
run: dotnet build --no-restore
working-directory: spannerlib/dotnet-spannerlib
- name: Unit Tests
working-directory: spannerlib/dotnet-spannerlib/Google.Cloud.SpannerLib.Tests
run: dotnet test --no-build --verbosity normal
6 changes: 3 additions & 3 deletions benchmarks/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ replace github.com/googleapis/go-sql-spanner => ../

require (
cloud.google.com/go v0.121.3
cloud.google.com/go/spanner v1.82.0
cloud.google.com/go/spanner v1.82.1-0.20250625132714-fe377af799f0
github.com/google/uuid v1.6.0
github.com/googleapis/go-sql-spanner v1.14.0
google.golang.org/api v0.239.0
Expand All @@ -24,7 +24,7 @@ require (
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.2 // indirect
github.com/GoogleCloudPlatform/grpc-gcp-go/grpcgcp v1.5.3 // indirect
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.27.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cncf/xds/go v0.0.0-20250326154945-ae57f3c0d45f // indirect
Expand Down Expand Up @@ -60,6 +60,6 @@ require (
golang.org/x/text v0.26.0 // indirect
golang.org/x/time v0.12.0 // indirect
google.golang.org/genproto v0.0.0-20250505200425-f936aa4a68b2 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250512202823-5a2f75b736a9 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250603155806-513f23925822 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822 // indirect
)
12 changes: 6 additions & 6 deletions benchmarks/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,8 @@ cloud.google.com/go/shell v1.6.0/go.mod h1:oHO8QACS90luWgxP3N9iZVuEiSF84zNyLytb+
cloud.google.com/go/spanner v1.41.0/go.mod h1:MLYDBJR/dY4Wt7ZaMIQ7rXOTLjYrmxLE/5ve9vFfWos=
cloud.google.com/go/spanner v1.44.0/go.mod h1:G8XIgYdOK+Fbcpbs7p2fiprDw4CaZX63whnSMLVBxjk=
cloud.google.com/go/spanner v1.45.0/go.mod h1:FIws5LowYz8YAE1J8fOS7DJup8ff7xJeetWEo5REA2M=
cloud.google.com/go/spanner v1.82.0 h1:w9uO8RqEoBooBLX4nqV1RtgudyU2ZX780KTLRgeVg60=
cloud.google.com/go/spanner v1.82.0/go.mod h1:BzybQHFQ/NqGxvE/M+/iU29xgutJf7Q85/4U9RWMto0=
cloud.google.com/go/spanner v1.82.1-0.20250625132714-fe377af799f0 h1:JpZinZY/JMrWJAPoSVt08CwfCFkzMt2WWTjtlrnHc9Y=
cloud.google.com/go/spanner v1.82.1-0.20250625132714-fe377af799f0/go.mod h1:QSWcjxszT0WRHNd8zyGI0WctrYA1N7j0yTFsWyol9Yw=
cloud.google.com/go/speech v1.6.0/go.mod h1:79tcr4FHCimOp56lwC01xnt/WPJZc4v3gzyT7FoBkCM=
cloud.google.com/go/speech v1.7.0/go.mod h1:KptqL+BAQIhMsj1kOP2la5DSEEerPDuOP/2mmkhHhZQ=
cloud.google.com/go/speech v1.8.0/go.mod h1:9bYIl1/tjsAnMgKGHKmBZzXKEkGgtU+MpdDPTE9f7y0=
Expand Down Expand Up @@ -615,8 +615,8 @@ gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zum
git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/GoogleCloudPlatform/grpc-gcp-go/grpcgcp v1.5.2 h1:DBjmt6/otSdULyJdVg2BlG0qGZO5tKL4VzOs0jpvw5Q=
github.com/GoogleCloudPlatform/grpc-gcp-go/grpcgcp v1.5.2/go.mod h1:dppbR7CwXD4pgtV9t3wD1812RaLDcBjtblcDF5f1vI0=
github.com/GoogleCloudPlatform/grpc-gcp-go/grpcgcp v1.5.3 h1:2afWGsMzkIcN8Qm4mgPJKZWyroE5QBszMiDMYEBrnfw=
github.com/GoogleCloudPlatform/grpc-gcp-go/grpcgcp v1.5.3/go.mod h1:dppbR7CwXD4pgtV9t3wD1812RaLDcBjtblcDF5f1vI0=
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.27.0 h1:ErKg/3iS1AKcTkf3yixlZ54f9U1rljCkQyEXWUnIUxc=
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.27.0/go.mod h1:yAZHSGnqScoU556rBOVkwLze6WP5N+U11RHuWaGVxwY=
github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk=
Expand Down Expand Up @@ -1508,8 +1508,8 @@ google.golang.org/genproto v0.0.0-20230331144136-dcfb400f0633/go.mod h1:UUQDJDOl
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU=
google.golang.org/genproto v0.0.0-20250505200425-f936aa4a68b2 h1:1tXaIXCracvtsRxSBsYDiSBN0cuJvM7QYW+MrpIRY78=
google.golang.org/genproto v0.0.0-20250505200425-f936aa4a68b2/go.mod h1:49MsLSx0oWMOZqcpB3uL8ZOkAh1+TndpJ8ONoCBWiZk=
google.golang.org/genproto/googleapis/api v0.0.0-20250512202823-5a2f75b736a9 h1:WvBuA5rjZx9SNIzgcU53OohgZy6lKSus++uY4xLaWKc=
google.golang.org/genproto/googleapis/api v0.0.0-20250512202823-5a2f75b736a9/go.mod h1:W3S/3np0/dPWsWLi1h/UymYctGXaGBM2StwzD0y140U=
google.golang.org/genproto/googleapis/api v0.0.0-20250603155806-513f23925822 h1:oWVWY3NzT7KJppx2UKhKmzPq4SRe0LdCijVRwvGeikY=
google.golang.org/genproto/googleapis/api v0.0.0-20250603155806-513f23925822/go.mod h1:h3c4v36UTKzUiuaOKQ6gr3S+0hovBtUrXzTG/i3+XEc=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822 h1:fc6jSaCT0vBduLYZHYrBBNY4dsWuvgyff9noRNDdBeE=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
Expand Down
Loading
Loading