You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by wa...@apache.org on 2023/05/17 12:31:52 UTC

[incubator-seatunnel] branch dev updated: [Docs][Connector-V2][Mysql] Add the generate sink sql parameter And example (#4769)

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

wanghailin pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-seatunnel.git


The following commit(s) were added to refs/heads/dev by this push:
     new a1bfaa8d1 [Docs][Connector-V2][Mysql] Add the generate sink sql parameter And example (#4769)
a1bfaa8d1 is described below

commit a1bfaa8d1f2f58d48b31fa29c60761d57b80ee29
Author: ZhilinLi <zh...@gmail.com>
AuthorDate: Wed May 17 20:31:44 2023 +0800

    [Docs][Connector-V2][Mysql] Add the generate sink sql parameter And example (#4769)
---
 docs/en/connector-v2/sink/Mysql.md | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/docs/en/connector-v2/sink/Mysql.md b/docs/en/connector-v2/sink/Mysql.md
index abd5ea9e1..72b83f3c1 100644
--- a/docs/en/connector-v2/sink/Mysql.md
+++ b/docs/en/connector-v2/sink/Mysql.md
@@ -70,6 +70,7 @@ semantics (using XA transaction guarantee).
 | batch_size                                | Int     | No       | 1000    | For batch writing, when the number of buffered records reaches the number of `batch_size` or the time reaches `batch_interval_ms`<br/>, the data will be flushed into the database                                                           |
 | batch_interval_ms                         | Int     | No       | 1000    | For batch writing, when the number of buffers reaches the number of `batch_size` or the time reaches `batch_interval_ms`, the data will be flushed into the database                                                                         |
 | is_exactly_once                           | Boolean | No       | false   | Whether to enable exactly-once semantics, which will use Xa transactions. If on, you need to<br/>set `xa_data_source_class_name`.                                                                                                            |
+| generate_sink_sql                         | Boolean | No       | false   | Generate sql statements based on the database table you want to write to                                                                                                                                                                     |
 | xa_data_source_class_name                 | String  | No       | -       | The xa data source class name of the database Driver, for example, mysql is `com.mysql.cj.jdbc.MysqlXADataSource`, and<br/>please refer to appendix for other data sources                                                                   |
 | max_commit_attempts                       | Int     | No       | 3       | The number of retries for transaction commit failures                                                                                                                                                                                        |
 | transaction_timeout_sec                   | Int     | No       | -1      | The timeout after the transaction is opened, the default is -1 (never timeout). Note that setting the timeout may affect<br/>exactly-once semantics                                                                                          |
@@ -129,6 +130,22 @@ sink {
 }
 ```
 
+> This example  not need to write complex sql statements, you can configure the database name table name to automatically generate add statements for you
+```
+sink {
+    jdbc {
+        url = "jdbc:mysql://localhost:3306/test"
+        driver = "com.mysql.cj.jdbc.Driver"
+        user = "root"
+        password = "123456"
+        
+        generate_sink_sql = true
+        database = test
+        table = test_table
+    }
+}
+```
+
 ### Exactly-once :
 
 > For accurate write scene we guarantee accurate once