Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document Cloud SQL with reactive SQL client #20801

Merged
merged 1 commit into from
Oct 26, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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