Skip to content

Commit

Permalink
Document Cloud SQL with reactive SQL client
Browse files Browse the repository at this point in the history
  • Loading branch information
loicmathieu committed Oct 14, 2021
1 parent 2213c7d commit 6b8f451
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions docs/src/main/asciidoc/deploying-to-google-cloud.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,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.

Expand Down Expand Up @@ -262,6 +264,30 @@ 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 use it with Cloud SQL you will need to add the following dependency (pick the right classifier depending on your needs)

[source, xml]
----
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<classifier>linux-x86_64</classifier>
</dependency>
----

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 Appengine.

== 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),
Expand Down

0 comments on commit 6b8f451

Please sign in to comment.