Search code examples
springspring-bootgoogle-cloud-platformgoogle-cloud-datastore

How to choose the datastore database to connect


I have two datastore databases in GCP "default" and "mydb". My project credentials was provided by the Google Cloud SDK "gcloud auth application-default login" command and when I run my project it connects to the "default" database. How can I choose to connect to the "mydb"?


Solution

  • From https://github.com/GoogleCloudPlatform/spring-cloud-gcp/pull/2150/files. I don't know which spring boot release this is in, but you can set your database name with spring.cloud.gcp.datastore.database-id .