Skip to content

Commit

Permalink
Merge pull request #20801 from loicmathieu/doc/reactive-cloud-sql
Browse files Browse the repository at this point in the history
Document Cloud SQL with reactive SQL client
  • Loading branch information
gsmet authored Oct 26, 2021
2 parents 8205e5e + dc643a7 commit 7164bfa
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions docs/src/main/asciidoc/deploying-to-google-cloud.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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]
----
<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 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),
Expand Down

0 comments on commit 7164bfa

Please sign in to comment.