Skip to content

Commit 269f090

Browse files
feat: add database dialect (#1657)
* feat: add database dialect PiperOrigin-RevId: 423930262 Source-Link: googleapis/googleapis@b0c104f Source-Link: https://github.com/googleapis/googleapis-gen/commit/4289d82000d55456357f05be01b7763082bb77b6 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDI4OWQ4MjAwMGQ1NTQ1NjM1N2YwNWJlMDFiNzc2MzA4MmJiNzdiNiJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 7504121 commit 269f090

File tree

41 files changed

+1846
-557
lines changed

Some content is hidden

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

41 files changed

+1846
-557
lines changed

google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClient.java

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@
7777
/**
7878
* Service Description: Cloud Spanner Database Admin API
7979
*
80-
* <p>The Cloud Spanner Database Admin API can be used to create, drop, and list databases. It also
81-
* enables updating the schema of pre-existing databases. It can be also used to create, delete and
82-
* list backups for a database and to restore from an existing backup.
80+
* <p>The Cloud Spanner Database Admin API can be used to: &#42; create, drop, and list databases
81+
* &#42; update the schema of pre-existing databases &#42; create, delete and list backups for a
82+
* database &#42; restore a database from an existing backup
8383
*
8484
* <p>This class provides the ability to make remote calls to the backing service through method
8585
* calls that map to API methods. Sample code to get started:
@@ -438,6 +438,7 @@ public final OperationFuture<Database, CreateDatabaseMetadata> createDatabaseAsy
438438
* .setCreateStatement("createStatement744686547")
439439
* .addAllExtraStatements(new ArrayList<String>())
440440
* .setEncryptionConfig(EncryptionConfig.newBuilder().build())
441+
* .setDatabaseDialect(DatabaseDialect.forNumber(0))
441442
* .build();
442443
* Database response = databaseAdminClient.createDatabaseAsync(request).get();
443444
* }
@@ -471,6 +472,7 @@ public final OperationFuture<Database, CreateDatabaseMetadata> createDatabaseAsy
471472
* .setCreateStatement("createStatement744686547")
472473
* .addAllExtraStatements(new ArrayList<String>())
473474
* .setEncryptionConfig(EncryptionConfig.newBuilder().build())
475+
* .setDatabaseDialect(DatabaseDialect.forNumber(0))
474476
* .build();
475477
* OperationFuture<Database, CreateDatabaseMetadata> future =
476478
* databaseAdminClient.createDatabaseOperationCallable().futureCall(request);
@@ -504,6 +506,7 @@ public final OperationFuture<Database, CreateDatabaseMetadata> createDatabaseAsy
504506
* .setCreateStatement("createStatement744686547")
505507
* .addAllExtraStatements(new ArrayList<String>())
506508
* .setEncryptionConfig(EncryptionConfig.newBuilder().build())
509+
* .setDatabaseDialect(DatabaseDialect.forNumber(0))
507510
* .build();
508511
* ApiFuture<Operation> future =
509512
* databaseAdminClient.createDatabaseCallable().futureCall(request);
@@ -772,7 +775,8 @@ public final UnaryCallable<UpdateDatabaseDdlRequest, Operation> updateDatabaseDd
772775
// AUTO-GENERATED DOCUMENTATION AND METHOD.
773776
/**
774777
* Drops (aka deletes) a Cloud Spanner database. Completed backups for the database will be
775-
* retained according to their `expire_time`.
778+
* retained according to their `expire_time`. Note: Cloud Spanner might continue to accept
779+
* requests for a few seconds after the database has been deleted.
776780
*
777781
* <p>Sample code:
778782
*
@@ -797,7 +801,8 @@ public final void dropDatabase(DatabaseName database) {
797801
// AUTO-GENERATED DOCUMENTATION AND METHOD.
798802
/**
799803
* Drops (aka deletes) a Cloud Spanner database. Completed backups for the database will be
800-
* retained according to their `expire_time`.
804+
* retained according to their `expire_time`. Note: Cloud Spanner might continue to accept
805+
* requests for a few seconds after the database has been deleted.
801806
*
802807
* <p>Sample code:
803808
*
@@ -819,7 +824,8 @@ public final void dropDatabase(String database) {
819824
// AUTO-GENERATED DOCUMENTATION AND METHOD.
820825
/**
821826
* Drops (aka deletes) a Cloud Spanner database. Completed backups for the database will be
822-
* retained according to their `expire_time`.
827+
* retained according to their `expire_time`. Note: Cloud Spanner might continue to accept
828+
* requests for a few seconds after the database has been deleted.
823829
*
824830
* <p>Sample code:
825831
*
@@ -843,7 +849,8 @@ public final void dropDatabase(DropDatabaseRequest request) {
843849
// AUTO-GENERATED DOCUMENTATION AND METHOD.
844850
/**
845851
* Drops (aka deletes) a Cloud Spanner database. Completed backups for the database will be
846-
* retained according to their `expire_time`.
852+
* retained according to their `expire_time`. Note: Cloud Spanner might continue to accept
853+
* requests for a few seconds after the database has been deleted.
847854
*
848855
* <p>Sample code:
849856
*

google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/package-info.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
*
2222
* <p>Service Description: Cloud Spanner Database Admin API
2323
*
24-
* <p>The Cloud Spanner Database Admin API can be used to create, drop, and list databases. It also
25-
* enables updating the schema of pre-existing databases. It can be also used to create, delete and
26-
* list backups for a database and to restore from an existing backup.
24+
* <p>The Cloud Spanner Database Admin API can be used to: &#42; create, drop, and list databases
25+
* &#42; update the schema of pre-existing databases &#42; create, delete and list backups for a
26+
* database &#42; restore a database from an existing backup
2727
*
2828
* <p>Sample for DatabaseAdminClient:
2929
*

google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClientTest.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
import com.google.spanner.admin.database.v1.CreateBackupRequest;
5050
import com.google.spanner.admin.database.v1.CreateDatabaseRequest;
5151
import com.google.spanner.admin.database.v1.Database;
52+
import com.google.spanner.admin.database.v1.DatabaseDialect;
5253
import com.google.spanner.admin.database.v1.DatabaseName;
5354
import com.google.spanner.admin.database.v1.DeleteBackupRequest;
5455
import com.google.spanner.admin.database.v1.DropDatabaseRequest;
@@ -224,6 +225,7 @@ public void createDatabaseTest() throws Exception {
224225
.setVersionRetentionPeriod("versionRetentionPeriod-629783929")
225226
.setEarliestVersionTime(Timestamp.newBuilder().build())
226227
.setDefaultLeader("defaultLeader759009962")
228+
.setDatabaseDialect(DatabaseDialect.forNumber(0))
227229
.build();
228230
Operation resultOperation =
229231
Operation.newBuilder()
@@ -280,6 +282,7 @@ public void createDatabaseTest2() throws Exception {
280282
.setVersionRetentionPeriod("versionRetentionPeriod-629783929")
281283
.setEarliestVersionTime(Timestamp.newBuilder().build())
282284
.setDefaultLeader("defaultLeader759009962")
285+
.setDatabaseDialect(DatabaseDialect.forNumber(0))
283286
.build();
284287
Operation resultOperation =
285288
Operation.newBuilder()
@@ -336,6 +339,7 @@ public void getDatabaseTest() throws Exception {
336339
.setVersionRetentionPeriod("versionRetentionPeriod-629783929")
337340
.setEarliestVersionTime(Timestamp.newBuilder().build())
338341
.setDefaultLeader("defaultLeader759009962")
342+
.setDatabaseDialect(DatabaseDialect.forNumber(0))
339343
.build();
340344
mockDatabaseAdmin.addResponse(expectedResponse);
341345

@@ -381,6 +385,7 @@ public void getDatabaseTest2() throws Exception {
381385
.setVersionRetentionPeriod("versionRetentionPeriod-629783929")
382386
.setEarliestVersionTime(Timestamp.newBuilder().build())
383387
.setDefaultLeader("defaultLeader759009962")
388+
.setDatabaseDialect(DatabaseDialect.forNumber(0))
384389
.build();
385390
mockDatabaseAdmin.addResponse(expectedResponse);
386391

@@ -900,6 +905,7 @@ public void createBackupTest() throws Exception {
900905
.setSizeBytes(-1796325715)
901906
.addAllReferencingDatabases(new ArrayList<String>())
902907
.setEncryptionInfo(EncryptionInfo.newBuilder().build())
908+
.setDatabaseDialect(DatabaseDialect.forNumber(0))
903909
.build();
904910
Operation resultOperation =
905911
Operation.newBuilder()
@@ -959,6 +965,7 @@ public void createBackupTest2() throws Exception {
959965
.setSizeBytes(-1796325715)
960966
.addAllReferencingDatabases(new ArrayList<String>())
961967
.setEncryptionInfo(EncryptionInfo.newBuilder().build())
968+
.setDatabaseDialect(DatabaseDialect.forNumber(0))
962969
.build();
963970
Operation resultOperation =
964971
Operation.newBuilder()
@@ -1018,6 +1025,7 @@ public void getBackupTest() throws Exception {
10181025
.setSizeBytes(-1796325715)
10191026
.addAllReferencingDatabases(new ArrayList<String>())
10201027
.setEncryptionInfo(EncryptionInfo.newBuilder().build())
1028+
.setDatabaseDialect(DatabaseDialect.forNumber(0))
10211029
.build();
10221030
mockDatabaseAdmin.addResponse(expectedResponse);
10231031

@@ -1063,6 +1071,7 @@ public void getBackupTest2() throws Exception {
10631071
.setSizeBytes(-1796325715)
10641072
.addAllReferencingDatabases(new ArrayList<String>())
10651073
.setEncryptionInfo(EncryptionInfo.newBuilder().build())
1074+
.setDatabaseDialect(DatabaseDialect.forNumber(0))
10661075
.build();
10671076
mockDatabaseAdmin.addResponse(expectedResponse);
10681077

@@ -1108,6 +1117,7 @@ public void updateBackupTest() throws Exception {
11081117
.setSizeBytes(-1796325715)
11091118
.addAllReferencingDatabases(new ArrayList<String>())
11101119
.setEncryptionInfo(EncryptionInfo.newBuilder().build())
1120+
.setDatabaseDialect(DatabaseDialect.forNumber(0))
11111121
.build();
11121122
mockDatabaseAdmin.addResponse(expectedResponse);
11131123

@@ -1312,6 +1322,7 @@ public void restoreDatabaseTest() throws Exception {
13121322
.setVersionRetentionPeriod("versionRetentionPeriod-629783929")
13131323
.setEarliestVersionTime(Timestamp.newBuilder().build())
13141324
.setDefaultLeader("defaultLeader759009962")
1325+
.setDatabaseDialect(DatabaseDialect.forNumber(0))
13151326
.build();
13161327
Operation resultOperation =
13171328
Operation.newBuilder()
@@ -1371,6 +1382,7 @@ public void restoreDatabaseTest2() throws Exception {
13711382
.setVersionRetentionPeriod("versionRetentionPeriod-629783929")
13721383
.setEarliestVersionTime(Timestamp.newBuilder().build())
13731384
.setDefaultLeader("defaultLeader759009962")
1385+
.setDatabaseDialect(DatabaseDialect.forNumber(0))
13741386
.build();
13751387
Operation resultOperation =
13761388
Operation.newBuilder()
@@ -1430,6 +1442,7 @@ public void restoreDatabaseTest3() throws Exception {
14301442
.setVersionRetentionPeriod("versionRetentionPeriod-629783929")
14311443
.setEarliestVersionTime(Timestamp.newBuilder().build())
14321444
.setDefaultLeader("defaultLeader759009962")
1445+
.setDatabaseDialect(DatabaseDialect.forNumber(0))
14331446
.build();
14341447
Operation resultOperation =
14351448
Operation.newBuilder()
@@ -1489,6 +1502,7 @@ public void restoreDatabaseTest4() throws Exception {
14891502
.setVersionRetentionPeriod("versionRetentionPeriod-629783929")
14901503
.setEarliestVersionTime(Timestamp.newBuilder().build())
14911504
.setDefaultLeader("defaultLeader759009962")
1505+
.setDatabaseDialect(DatabaseDialect.forNumber(0))
14921506
.build();
14931507
Operation resultOperation =
14941508
Operation.newBuilder()

grpc-google-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DatabaseAdminGrpc.java

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@
2222
*
2323
* <pre>
2424
* Cloud Spanner Database Admin API
25-
* The Cloud Spanner Database Admin API can be used to create, drop, and
26-
* list databases. It also enables updating the schema of pre-existing
27-
* databases. It can be also used to create, delete and list backups for a
28-
* database and to restore from an existing backup.
25+
* The Cloud Spanner Database Admin API can be used to:
26+
* * create, drop, and list databases
27+
* * update the schema of pre-existing databases
28+
* * create, delete and list backups for a database
29+
* * restore a database from an existing backup
2930
* </pre>
3031
*/
3132
@javax.annotation.Generated(
@@ -851,10 +852,11 @@ public DatabaseAdminFutureStub newStub(
851852
*
852853
* <pre>
853854
* Cloud Spanner Database Admin API
854-
* The Cloud Spanner Database Admin API can be used to create, drop, and
855-
* list databases. It also enables updating the schema of pre-existing
856-
* databases. It can be also used to create, delete and list backups for a
857-
* database and to restore from an existing backup.
855+
* The Cloud Spanner Database Admin API can be used to:
856+
* * create, drop, and list databases
857+
* * update the schema of pre-existing databases
858+
* * create, delete and list backups for a database
859+
* * restore a database from an existing backup
858860
* </pre>
859861
*/
860862
public abstract static class DatabaseAdminImplBase implements io.grpc.BindableService {
@@ -937,6 +939,8 @@ public void updateDatabaseDdl(
937939
* Drops (aka deletes) a Cloud Spanner database.
938940
* Completed backups for the database will be retained according to their
939941
* `expire_time`.
942+
* Note: Cloud Spanner might continue to accept requests for a few seconds
943+
* after the database has been deleted.
940944
* </pre>
941945
*/
942946
public void dropDatabase(
@@ -1306,10 +1310,11 @@ public final io.grpc.ServerServiceDefinition bindService() {
13061310
*
13071311
* <pre>
13081312
* Cloud Spanner Database Admin API
1309-
* The Cloud Spanner Database Admin API can be used to create, drop, and
1310-
* list databases. It also enables updating the schema of pre-existing
1311-
* databases. It can be also used to create, delete and list backups for a
1312-
* database and to restore from an existing backup.
1313+
* The Cloud Spanner Database Admin API can be used to:
1314+
* * create, drop, and list databases
1315+
* * update the schema of pre-existing databases
1316+
* * create, delete and list backups for a database
1317+
* * restore a database from an existing backup
13131318
* </pre>
13141319
*/
13151320
public static final class DatabaseAdminStub
@@ -1409,6 +1414,8 @@ public void updateDatabaseDdl(
14091414
* Drops (aka deletes) a Cloud Spanner database.
14101415
* Completed backups for the database will be retained according to their
14111416
* `expire_time`.
1417+
* Note: Cloud Spanner might continue to accept requests for a few seconds
1418+
* after the database has been deleted.
14121419
* </pre>
14131420
*/
14141421
public void dropDatabase(
@@ -1689,10 +1696,11 @@ public void listBackupOperations(
16891696
*
16901697
* <pre>
16911698
* Cloud Spanner Database Admin API
1692-
* The Cloud Spanner Database Admin API can be used to create, drop, and
1693-
* list databases. It also enables updating the schema of pre-existing
1694-
* databases. It can be also used to create, delete and list backups for a
1695-
* database and to restore from an existing backup.
1699+
* The Cloud Spanner Database Admin API can be used to:
1700+
* * create, drop, and list databases
1701+
* * update the schema of pre-existing databases
1702+
* * create, delete and list backups for a database
1703+
* * restore a database from an existing backup
16961704
* </pre>
16971705
*/
16981706
public static final class DatabaseAdminBlockingStub
@@ -1779,6 +1787,8 @@ public com.google.longrunning.Operation updateDatabaseDdl(
17791787
* Drops (aka deletes) a Cloud Spanner database.
17801788
* Completed backups for the database will be retained according to their
17811789
* `expire_time`.
1790+
* Note: Cloud Spanner might continue to accept requests for a few seconds
1791+
* after the database has been deleted.
17821792
* </pre>
17831793
*/
17841794
public com.google.protobuf.Empty dropDatabase(
@@ -2014,10 +2024,11 @@ public com.google.spanner.admin.database.v1.ListBackupOperationsResponse listBac
20142024
*
20152025
* <pre>
20162026
* Cloud Spanner Database Admin API
2017-
* The Cloud Spanner Database Admin API can be used to create, drop, and
2018-
* list databases. It also enables updating the schema of pre-existing
2019-
* databases. It can be also used to create, delete and list backups for a
2020-
* database and to restore from an existing backup.
2027+
* The Cloud Spanner Database Admin API can be used to:
2028+
* * create, drop, and list databases
2029+
* * update the schema of pre-existing databases
2030+
* * create, delete and list backups for a database
2031+
* * restore a database from an existing backup
20212032
* </pre>
20222033
*/
20232034
public static final class DatabaseAdminFutureStub
@@ -2106,6 +2117,8 @@ protected DatabaseAdminFutureStub build(
21062117
* Drops (aka deletes) a Cloud Spanner database.
21072118
* Completed backups for the database will be retained according to their
21082119
* `expire_time`.
2120+
* Note: Cloud Spanner might continue to accept requests for a few seconds
2121+
* after the database has been deleted.
21092122
* </pre>
21102123
*/
21112124
public com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.Empty>

0 commit comments

Comments
 (0)