This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/main by this push:
new 7b6cc24 Add DataSource configuration docs to JDBC & SQL extensions
7b6cc24 is described below
commit 7b6cc2404cdd2322a305d67a79109cb0df110b02
Author: James Netherton <[email protected]>
AuthorDate: Thu May 13 09:51:01 2021 +0100
Add DataSource configuration docs to JDBC & SQL extensions
---
docs/modules/ROOT/pages/reference/extensions/jdbc.adoc | 17 +++++++++++++++++
docs/modules/ROOT/pages/reference/extensions/sql.adoc | 17 +++++++++++++++++
extensions/jdbc/runtime/src/main/doc/configuration.adoc | 13 +++++++++++++
extensions/sql/runtime/src/main/doc/configuration.adoc | 17 +++++++++++++++++
4 files changed, 64 insertions(+)
diff --git a/docs/modules/ROOT/pages/reference/extensions/jdbc.adoc
b/docs/modules/ROOT/pages/reference/extensions/jdbc.adoc
index cd9b018..1c13397 100644
--- a/docs/modules/ROOT/pages/reference/extensions/jdbc.adoc
+++ b/docs/modules/ROOT/pages/reference/extensions/jdbc.adoc
@@ -38,3 +38,20 @@ Or add the coordinates to your existing project:
----
Check the xref:user-guide/index.adoc[User guide] for more information about
writing Camel Quarkus applications.
+
+== Additional Camel Quarkus configuration
+
+=== Configuring a DataSource
+
+This extension leverages https://quarkus.io/guides/datasource[Quarkus Agroal]
for `DataSource` support. Setting up a `DataSource` can be achieved via
configuration properties.
+It is recommended that you explicitly name the datasource so that it can be
referenced in the JDBC endpoint URI. E.g like `to("jdbc:camel")`.
+
+[source,properties]
+----
+quarkus.datasource.camel.db-kind=postgresql
+quarkus.datasource.camel.username=your-username
+quarkus.datasource.camel.password=your-password
+quarkus.datasource.camel.jdbc.url=jdbc:postgresql://localhost:5432/your-database
+quarkus.datasource.camel.jdbc.max-size=16
+----
+
diff --git a/docs/modules/ROOT/pages/reference/extensions/sql.adoc
b/docs/modules/ROOT/pages/reference/extensions/sql.adoc
index df52926..9bdc7da 100644
--- a/docs/modules/ROOT/pages/reference/extensions/sql.adoc
+++ b/docs/modules/ROOT/pages/reference/extensions/sql.adoc
@@ -42,6 +42,23 @@ Check the xref:user-guide/index.adoc[User guide] for more
information about writ
== Additional Camel Quarkus configuration
+=== Configuring a DataSource
+
+This extension leverages https://quarkus.io/guides/datasource[Quarkus Agroal]
for `DataSource` support. Setting up a `DataSource` can be achieved via
configuration properties.
+
+[source,properties]
+----
+quarkus.datasource.db-kind=postgresql
+quarkus.datasource.username=your-username
+quarkus.datasource.password=your-password
+quarkus.datasource.jdbc.url=jdbc:postgresql://localhost:5432/your-database
+quarkus.datasource.jdbc.max-size=16
+----
+
+The Camel SQL component will automatically resolve the `DataSource` bean from
the registry. When configuring multiple datasources, you can specify which one
is to be used on an SQL endpoint via
+the URI options `datasource` or `dataSource`. Refer to the SQL component
documentation for more details.
+
+=== SQL scripts
When configuring `sql` or `sql-stored` endpoints to reference script files
from the classpath, set the following configuration property to ensure that
they are available in native mode.
Note that URI schemes such as `file` or `http` do not need to be listed.
diff --git a/extensions/jdbc/runtime/src/main/doc/configuration.adoc
b/extensions/jdbc/runtime/src/main/doc/configuration.adoc
new file mode 100644
index 0000000..ef708a5
--- /dev/null
+++ b/extensions/jdbc/runtime/src/main/doc/configuration.adoc
@@ -0,0 +1,13 @@
+=== Configuring a DataSource
+
+This extension leverages https://quarkus.io/guides/datasource[Quarkus Agroal]
for `DataSource` support. Setting up a `DataSource` can be achieved via
configuration properties.
+It is recommended that you explicitly name the datasource so that it can be
referenced in the JDBC endpoint URI. E.g like `to("jdbc:camel")`.
+
+[source,properties]
+----
+quarkus.datasource.camel.db-kind=postgresql
+quarkus.datasource.camel.username=your-username
+quarkus.datasource.camel.password=your-password
+quarkus.datasource.camel.jdbc.url=jdbc:postgresql://localhost:5432/your-database
+quarkus.datasource.camel.jdbc.max-size=16
+----
diff --git a/extensions/sql/runtime/src/main/doc/configuration.adoc
b/extensions/sql/runtime/src/main/doc/configuration.adoc
index e1cc8d3..fd776a0 100644
--- a/extensions/sql/runtime/src/main/doc/configuration.adoc
+++ b/extensions/sql/runtime/src/main/doc/configuration.adoc
@@ -1,3 +1,20 @@
+=== Configuring a DataSource
+
+This extension leverages https://quarkus.io/guides/datasource[Quarkus Agroal]
for `DataSource` support. Setting up a `DataSource` can be achieved via
configuration properties.
+
+[source,properties]
+----
+quarkus.datasource.db-kind=postgresql
+quarkus.datasource.username=your-username
+quarkus.datasource.password=your-password
+quarkus.datasource.jdbc.url=jdbc:postgresql://localhost:5432/your-database
+quarkus.datasource.jdbc.max-size=16
+----
+
+The Camel SQL component will automatically resolve the `DataSource` bean from
the registry. When configuring multiple datasources, you can specify which one
is to be used on an SQL endpoint via
+the URI options `datasource` or `dataSource`. Refer to the SQL component
documentation for more details.
+
+=== SQL scripts
When configuring `sql` or `sql-stored` endpoints to reference script files
from the classpath, set the following configuration property to ensure that
they are available in native mode.
Note that URI schemes such as `file` or `http` do not need to be listed.