1
- # Google Cloud Java Client for Spanner
1
+ # Google Cloud Spanner Client for Java
2
2
3
- Java idiomatic client for [ Cloud Spanner] [ cloud-spanner ] .
3
+ Java idiomatic client for [ Cloud Spanner] [ product-docs ] .
4
4
5
- [ ![ Kokoro CI] ( http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/master.svg )] ( http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/master.html )
6
- [ ![ Maven] ( https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-spanner.svg )] ( https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-spanner.svg )
7
- [ ![ Codacy Badge] ( https://api.codacy.com/project/badge/grade/9da006ad7c3a4fe1abd142e77c003917 )] ( https://www.codacy.com/app/mziccard/google-cloud-java )
5
+ [ ![ Maven] [ maven-version-image ]] [ maven-version-link ]
6
+ ![ Stability] [ stability-image ]
8
7
9
- - [ Product Documentation] [ spanner- product-docs]
10
- - [ Client Library Documentation] [ spanner-client-lib-docs ]
8
+ - [ Product Documentation] [ product-docs ]
9
+ - [ Client Library Documentation] [ javadocs ]
11
10
12
11
## Quickstart
13
- If you are using Maven with a BOM, add this to your pom.xml file.
12
+
13
+ If you are using Maven with [ BOM] [ libraries-bom ] , add this to your pom.xml file
14
14
``` xml
15
15
<dependencyManagement >
16
- <dependencies >
16
+ <dependencies >
17
+ <dependency >
18
+ <groupId >com.google.cloud</groupId >
19
+ <artifactId >libraries-bom</artifactId >
20
+ <version >5.1.0</version >
21
+ <type >pom</type >
22
+ <scope >import</scope >
23
+ </dependency >
24
+ </dependencies >
25
+ </dependencyManagement >
26
+
27
+ <dependencies >
17
28
<dependency >
18
29
<groupId >com.google.cloud</groupId >
19
- <artifactId >libraries-bom</artifactId >
20
- <version >3.0.0</version >
21
- <type >pom</type >
22
- <scope >import</scope >
23
- </dependency >
24
- </dependencies >
25
- </dependencyManagement >
30
+ <artifactId >google-cloud-spanner</artifactId >
31
+ </dependency >
26
32
27
- <dependency >
28
- <groupId >com.google.cloud</groupId >
29
- <artifactId >google-cloud-spanner</artifactId >
30
- </dependency >
31
33
```
32
- [ // ] : # ( {x-version-update-start:google-cloud-spanner:released} )
33
- If you are using Maven without a BOM, add this to your dependencies.
34
+
35
+ If you are using Maven without BOM, add this to your dependencies:
36
+
34
37
``` xml
35
38
<dependency >
36
39
<groupId >com.google.cloud</groupId >
37
40
<artifactId >google-cloud-spanner</artifactId >
38
- <version >1.53 .0</version >
41
+ <version >1.52 .0</version >
39
42
</dependency >
43
+
40
44
```
45
+
46
+ [ // ] : # ( {x-version-update-start:google-cloud-spanner:released} )
47
+
41
48
If you are using Gradle, add this to your dependencies
42
49
``` Groovy
43
50
compile 'com.google.cloud:google-cloud-spanner:1.53.0'
@@ -50,27 +57,37 @@ libraryDependencies += "com.google.cloud" % "google-cloud-spanner" % "1.53.0"
50
57
51
58
## Authentication
52
59
53
- See the
54
- [ Authentication] ( https://.com/googleapis/google-cloud-java#authentication )
55
- section in the base directory's README.
60
+ See the [ Authentication] [ authentication ] section in the base directory's README.
61
+
62
+ ## Getting Started
63
+
64
+ ### Prerequisites
65
+
66
+ You will need a [ Google Cloud Platform Console] [ developer-console ] project with the Cloud Spanner [ API enabled] [ enable-api ] .
67
+ You will need to [ enable billing] [ enable-billing ] to use Google Cloud Spanner.
68
+ [ Follow these instructions] [ create-project ] to get your project set up. You will also need to set up the local development environment by
69
+ [ installing the Google Cloud SDK] [ cloud-sdk ] and running the following commands in command line:
70
+ ` gcloud auth login ` and ` gcloud config set project [YOUR PROJECT ID] ` .
71
+
72
+ ### Installation and setup
73
+
74
+ You'll need to obtain the ` google-cloud-spanner ` library. See the [ Quickstart] ( #quickstart ) section
75
+ to add ` google-cloud-spanner ` as a dependency in your code.
56
76
57
77
## About Cloud Spanner
58
78
59
- [ Cloud Spanner] [ cloud-spanner ] is a fully managed, mission-critical,
79
+
80
+ [ Cloud Spanner] [ product-docs ] is a fully managed, mission-critical,
60
81
relational database service that offers transactional consistency at global scale,
61
82
schemas, SQL (ANSI 2011 with extensions), and automatic, synchronous replication
62
83
for high availability.
63
84
64
85
Be sure to activate the Cloud Spanner API on the Developer's Console to
65
86
use Cloud Spanner from your project.
66
87
67
- See the [ Spanner client lib docs] [ spanner-client-lib-docs ] to learn how to
68
- interact with Cloud Spanner using this Client Library.
88
+ See the [ Cloud Spanner client library docs] [ javadocs ] to learn how to
89
+ use this Cloud Spanner Client Library.
69
90
70
- ## Getting Started
71
- #### Prerequisites
72
- Please refer to the [ getting
73
- started] ( https://cloud.google.com/spanner/docs/getting-started/java/ ) guide.
74
91
75
92
#### Calling Cloud Spanner
76
93
Here is a code snippet showing a simple usage example. Add the following imports
@@ -112,48 +129,79 @@ try {
112
129
113
130
#### Complete source code
114
131
115
- In [ DatabaseSelect.java] ( ../.. /google-cloud-examples/src/main/java/com/google/cloud/examples/spanner/snippets/DatabaseSelect.java) we put together all the code shown above in a single program.
132
+ In [ DatabaseSelect.java] ( https://.com/googleapis/google-cloud-java/tree/master /google-cloud-examples/src/main/java/com/google/cloud/examples/spanner/snippets/DatabaseSelect.java) we put together all the code shown above in a single program.
116
133
117
- ## Troubleshooting
118
134
119
- To get help, follow the instructions in the [ shared Troubleshooting
120
- document] ( https://.com/googleapis/google-cloud-common/blob/master/troubleshooting/readme.md#troubleshooting ) .
121
135
122
- Transport
123
- ---------
124
- Spanner uses gRPC for the transport layer.
125
136
126
- ## Java Versions
127
137
128
- Java 7 or above is required for using this client.
138
+ ## Troubleshooting
129
139
130
- ## Testing
140
+ To get help, follow the instructions in the [ shared Troubleshooting document ] [ troubleshooting ] .
131
141
132
- This library has tools to help make tests for code using Cloud Spanner.
142
+ ## Transport
133
143
134
- See [ TESTING] to read more about testing.
144
+ Cloud Spanner uses gRPC for the transport layer.
145
+
146
+ ## Java Versions
147
+
148
+ Java 7 or above is required for using this client.
135
149
136
150
## Versioning
137
151
152
+
138
153
This library follows [ Semantic Versioning] ( http://semver.org/ ) .
139
154
140
- It is currently in major version zero (` 0.y.z ` ), which means that anything may
141
- change at any time and the public API should not be considered stable.
142
155
143
156
## Contributing
144
157
158
+
145
159
Contributions to this library are always welcome and highly encouraged.
146
160
147
- See [ CONTRIBUTING] for more information on how to get started.
161
+ See [ CONTRIBUTING] [ contributing ] for more information how to get started.
148
162
149
- ## License
163
+ Please note that this project is released with a Contributor Code of Conduct. By participating in
164
+ this project you agree to abide by its terms. See [ Code of Conduct] [ code-of-conduct ] for more
165
+ information.
150
166
151
- Apache 2.0 - See [ LICENSE ] for more information.
167
+ ## License
152
168
153
- [ CONTRIBUTING ] :https://.com/googleapis/google-cloud-java/blob/master/CONTRIBUTING.md
154
- [ LICENSE ] : https://.com/googleapis/google-cloud-java/blob/master/LICENSE
155
- [ TESTING ] : https://.com/googleapis/google-cloud-java/blob/master/TESTING.md#testing-code-that-uses-cloud-spanner
156
- [ cloud-platform ] : https://cloud.google.com/
157
- [ cloud-spanner ] : https://cloud.google.com/spanner/
158
- [ spanner-product-docs ] : https://cloud.google.com/spanner/docs/
159
- [ spanner-client-lib-docs ] : https://googleapis.dev/java/google-cloud-clients/latest/index.html?com/google/cloud/spanner/package-summary.html
169
+ Apache 2.0 - See [ LICENSE] [ license ] for more information.
170
+
171
+ ## CI Status
172
+
173
+ Java Version | Status
174
+ ------------ | ------
175
+ Java 7 | [ ![ Kokoro CI] [ kokoro-badge-image-1 ]] [ kokoro-badge-link-1 ]
176
+ Java 8 | [ ![ Kokoro CI] [ kokoro-badge-image-2 ]] [ kokoro-badge-link-2 ]
177
+ Java 8 OSX | [ ![ Kokoro CI] [ kokoro-badge-image-3 ]] [ kokoro-badge-link-3 ]
178
+ Java 8 Windows | [ ![ Kokoro CI] [ kokoro-badge-image-4 ]] [ kokoro-badge-link-4 ]
179
+ Java 11 | [ ![ Kokoro CI] [ kokoro-badge-image-5 ]] [ kokoro-badge-link-5 ]
180
+
181
+ [ product-docs ] : https://cloud.google.com/spanner/docs/
182
+ [ javadocs ] : https://googleapis.dev/java/google-cloud-spanner/latest/
183
+ [ kokoro-badge-image-1 ] : http://storage.googleapis.com/cloud-devrel-public/java/badges/java-spanner/java7.svg
184
+ [ kokoro-badge-link-1 ] : http://storage.googleapis.com/cloud-devrel-public/java/badges/java-spanner/java7.html
185
+ [ kokoro-badge-image-2 ] : http://storage.googleapis.com/cloud-devrel-public/java/badges/java-spanner/java8.svg
186
+ [ kokoro-badge-link-2 ] : http://storage.googleapis.com/cloud-devrel-public/java/badges/java-spanner/java8.html
187
+ [ kokoro-badge-image-3 ] : http://storage.googleapis.com/cloud-devrel-public/java/badges/java-spanner/java8-osx.svg
188
+ [ kokoro-badge-link-3 ] : http://storage.googleapis.com/cloud-devrel-public/java/badges/java-spanner/java8-osx.html
189
+ [ kokoro-badge-image-4 ] : http://storage.googleapis.com/cloud-devrel-public/java/badges/java-spanner/java8-win.svg
190
+ [ kokoro-badge-link-4 ] : http://storage.googleapis.com/cloud-devrel-public/java/badges/java-spanner/java8-win.html
191
+ [ kokoro-badge-image-5 ] : http://storage.googleapis.com/cloud-devrel-public/java/badges/java-spanner/java11.svg
192
+ [ kokoro-badge-link-5 ] : http://storage.googleapis.com/cloud-devrel-public/java/badges/java-spanner/java11.html
193
+ [ stability-image ] : https://img.shields.io/badge/stability-ga-green
194
+ [ maven-version-image ] : https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-spanner.svg
195
+ [ maven-version-link ] : https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-spanner&core=gav
196
+ [ authentication ] : https://.com/googleapis/google-cloud-java#authentication
197
+ [ developer-console ] : https://console.developers.google.com/
198
+ [ create-project ] : https://cloud.google.com/resource-manager/docs/creating-managing-projects
199
+ [ cloud-sdk ] : https://cloud.google.com/sdk/
200
+ [ troubleshooting ] : https://.com/googleapis/google-cloud-common/blob/master/troubleshooting/readme.md#troubleshooting
201
+ [ contributing ] : https://.com/googleapis/java-spanner/blob/master/CONTRIBUTING.md
202
+ [ code-of-conduct ] : https://.com/googleapis/java-spanner/blob/master/CODE_OF_CONDUCT.md#contributor-code-of-conduct
203
+ [ license ] : https://.com/googleapis/java-spanner/blob/master/LICENSE
204
+ [ enable-billing ] : https://cloud.google.com/apis/docs/getting-started#enabling_billing
205
+ [ enable-api ] : https://console.cloud.google.com/flows/enableapi?apiid=spanner.googleapis.com
206
+ [ libraries-bom ] : https://.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM
207
+ [ shell_img ] : https://gstatic.com/cloudssh/images/open-btn.png
0 commit comments