This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit 810185aa2a2d85220bf2bd70755e0b55e11d22a7
Author: Andrea Cosentino <anco...@gmail.com>
AuthorDate: Fri Jun 11 18:26:34 2021 +0200

    Added PostgreSQL Sink Kamelet
---
 .../kamelets/postgresql-sink.kamelet.yaml          | 83 ++++++++++++++++++++++
 1 file changed, 83 insertions(+)

diff --git 
a/library/camel-kamelets-catalog/src/main/resources/kamelets/postgresql-sink.kamelet.yaml
 
b/library/camel-kamelets-catalog/src/main/resources/kamelets/postgresql-sink.kamelet.yaml
new file mode 100644
index 0000000..14f30c1
--- /dev/null
+++ 
b/library/camel-kamelets-catalog/src/main/resources/kamelets/postgresql-sink.kamelet.yaml
@@ -0,0 +1,83 @@
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+  name: postgresql-sink
+  annotations:
+    camel.apache.org/kamelet.support.level: "Preview"
+    camel.apache.org/catalog.version: "main-SNAPSHOT"
+    camel.apache.org/kamelet.icon: 
"data:image/svg+xml;base64,PHN2ZyByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48dGl0bGU+UG9zdGdyZVNRTCBpY29uPC90aXRsZT48cGF0aCBkPSJNMTcuMTI4IDBhMTAuMTM0IDEwLjEzNCAwIDAgMC0yLjc1NS40MDNsLS4wNjMuMDJBMTAuOTIyIDEwLjkyMiAwIDAgMCAxMi42LjI1OEMxMS40MjIuMjM4IDEwLjQxLjUyNCA5LjU5NCAxIDguNzkuNzIxIDcuMTIyLjI0IDUuMzY0LjMzNiA0LjE0LjQwMyAyLjgwNC43NzUgMS44MTQgMS44Mi44MjcgMi44NjUuMzA1IDQuNDgyLjQxNSA2LjY4MmMuMDMuNjA3LjIwMyAxLjU5Ny
 [...]
+    camel.apache.org/provider: "Apache Software Foundation"
+    camel.apache.org/kamelet.group: "SQL"
+  labels:
+    camel.apache.org/kamelet.type: "sink"
+spec:
+  definition:
+    title: "PostgreSQL Sink"
+    description: |-
+      Send data to a PostgreSQL Database.
+    required:
+      - serverName
+      - username
+      - password
+      - query
+    type: object
+    properties:
+      serverName:
+        title: Server Name
+        description: Server Name for the data source
+        type: string
+        example: localhost
+      port:
+        title: Port
+        description: Server Port for the data source
+        type: string
+        default: 5432
+      username:
+        title: Username
+        description: The username to use for accessing a secured PostgreSQL 
Database
+        type: string
+      password:
+        title: Password
+        description: The password to use for accessing a secured PostgreSQL 
Database
+        type: string
+        format: password
+        x-descriptors:
+        - urn:alm:descriptor:com.tectonic.ui:password
+      query:
+        title: Query
+        description: The Query to execute against the PostgreSQL Database
+        type: string
+      databaseName:
+        title: Database Name
+        description: The Database Name we are pointing
+        type: string
+        default: postgres
+  dependencies:
+  - "camel:jackson"
+  - "camel:kamelet"
+  - "camel:sql"
+  - "mvn:org.postgresql:postgresql:42.2.14"
+  - "mvn:org.apache.commons:commons-dbcp2:2.8.0"
+  flow:
+    beans:
+      - name: dsBean
+        type: "#class:org.apache.commons.dbcp2.BasicDataSource"
+        property:
+          - key: username
+            value: '{{username}}'
+          - key: password
+            value: '{{password}}'
+          - key: url
+            value: 'jdbc:postgresql://{{serverName}}:{{port}}/{{databaseName}}'
+          - key: driverClassName
+            value: 'org.postgresql.Driver'
+    from:
+      uri: "kamelet:source"
+      steps:
+      - unmarshal:
+          json: 
+            library: Jackson
+      - to: 
+          uri: "sql:{{query}}"
+          parameters:
+            dataSource: "#bean:{{dsBean}}"

Reply via email to