0
votes

Is there ORM integration available with Google Cloud Spanner?

I tried to integrate the app with the help of spanner-jdbc, along with spanner-hibernate(i.e. dialect provided by ‘nl topicus’ organization). I think this implementation is not official implementation of hibernate and I’m having trouble with implementation as if I need to change in existing table I need to re-create the whole schema using hbm2ddlauto property to create.

I’m implementing it on Spring boot application.

Also, can anyone clarify that is there any local environment available for Google Cloud Spanner, as my knowledge no solution is there for the same?

3
There's not really a very concrete question here. Could you please clarify exactly what the problem is that you are running into? You could also have a look at this example project: github.com/olavloite/spanner-jpa-exampleKnut Olav Løite

3 Answers

2
votes

Spanner has an officially supported JDBC driver here: https://cloud.google.com/spanner/docs/partners/drivers.

There is currently no officially supported ORM or local environment for Cloud Spanner.

0
votes

GCP provides an official Cloud Spanner Dialect compatible with Hibernate 5.4 (released at 2018-12-12). https://github.com/GoogleCloudPlatform/google-cloud-spanner-hibernate/tree/1.2.0

Although the local development was the biggest challenge for a while, an emulator is available now as well in beta. https://cloud.google.com/spanner/docs/emulator

0
votes

In 2019, both Hibernate ORM and Spring Data integrations were added for Cloud Spanner:

Google Cloud Spanner Dialect for Hibernate ORM - Documentation - Github

Spring Data Cloud Spanner - Documentation - Github

Also, for Python, a Django database backend was launched in 2020 - Announcement - Github

The Cloud Spanner Emulator is available for local development, and testing - Documentation - GitHub (it can be started via gcloud or directly from a Docker image)