Skip to content

Commit

Permalink
Merge pull request #524 from loicmathieu/firestore-database-id
Browse files Browse the repository at this point in the history
Allow configuring Firestore databaseId
  • Loading branch information
loicmathieu authored Nov 6, 2023
2 parents f73c1ab + 34b8caa commit e6dc37d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ public class FirestoreConfiguration {
@ConfigItem
public Optional<RetryConfiguration> retry;

/**
* The firestore database identifier.
* It not set, the default will be used.
*/
@ConfigItem
public Optional<String> databaseId;

@ConfigGroup
public static class RetryConfiguration {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public Firestore firestore() throws IOException {
.setProjectId(gcpConfiguration.projectId().orElse(null));
firestoreConfiguration.hostOverride.ifPresent(builder::setHost);
firestoreConfiguration.retry.ifPresent(retry -> builder.setRetrySettings(buildRetrySettings(retry)));
firestoreConfiguration.databaseId.ifPresent(databaseId -> builder.setDatabaseId(databaseId));
return builder.build().getService();
}

Expand Down

0 comments on commit e6dc37d

Please sign in to comment.