From dc643a7db640d80b49c805bc901185a9dd7b7625 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mathieu?= Date: Tue, 13 Apr 2021 18:06:28 +0200 Subject: [PATCH] Document Cloud SQL with reactive SQL client --- .../asciidoc/deploying-to-google-cloud.adoc | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/docs/src/main/asciidoc/deploying-to-google-cloud.adoc b/docs/src/main/asciidoc/deploying-to-google-cloud.adoc index d878889d635c0..e927b3c398d10 100644 --- a/docs/src/main/asciidoc/deploying-to-google-cloud.adoc +++ b/docs/src/main/asciidoc/deploying-to-google-cloud.adoc @@ -230,6 +230,8 @@ When the deployment is done, the output will display the URL to access your appl Google Cloud SQL provides managed instances for MySQL, PostgreSQL and Microsoft SQL Server. Quarkus has support for all three databases. +=== Using Cloud SQL with a JDBC driver + To make your applications work with Cloud SQL, you first need to use the corresponding JDBC extension, for example, for PostgreSQL, add the `quarkus-jdbc-postgresql` extension. @@ -269,6 +271,31 @@ as Hibernate ORM would not be able to automatically detect the dialect of your d WARNING: Using a PostgreSQL socket factory is not possible in dev mode at the moment due to issue link:https://github.com/quarkusio/quarkus/issues/15782[#15782]. +=== Using Cloud SQL with a reactive SQL client + +You can also use one of our reactive SQL client instead of the JDBC client. +To do so with Cloud SQL, add the following dependency +(adjust the classifier depending on your platform): + +[source, xml] +---- + + io.netty + netty-transport-native-epoll + linux-x86_64 + +---- + +Then configure your reactive datasource with no hostname and with the Netty native transport: + +[source, properties] +---- +quarkus.datasource.reactive.url=postgresql://:5432/db-name?host=/cloudsql/project-id:zone:db-name +quarkus.vertx.prefer-native-transport=true +---- + +WARNING: This only works when your application is running inside a Google Cloud managed runtime like App Engine. + == Going further You can find a set of extensions to access various Google Cloud Services in the Quarkiverse (a GitHub organization for Quarkus extensions maintained by the community),