跳转至

Sybase Writer

Sybase Writer 插件实现了写入数据到 Sybase 库表的功能。

配置样例

我们可以用 Docker 容器来启动一个 Sybase 数据库

docker run -tid --rm  -h dksybase --name sybase  -p 5000:5000  ifnazar/sybase_15_7 bash /sybase/start

然后创建一张如下表

create table addax_writer 
(
    id int,
    name varchar(255),
    salary float(2),
    created_at datetime,
    updated_at datetime
);

再使用下面的任务配置文件

{
  "job": {
    "content": {
      "writer": {
        "name": "sybasewriter",
        "parameter": {
          "column": [
            "id",
            "name",
            "salary",
            "created_at",
            "updated_at"
          ],
          "connection": {
            "jdbcUrl": "jdbc:sybase:Tds:127.0.0.1:5000/master",
            "table": [
              "dbo.addax_writer"
            ]
          },
          "username": "sa",
          "password": "password"
        }
      },
      "reader": {
        "name": "streamreader",
        "parameter": {
          "column": [
            {
              "random": "100,1000",
              "type": "long"
            },
            {
              "random": "10,100",
              "type": "string"
            },
            {
              "random": "10,1000",
              "type": "double"
            },
            {
              "incr": "2022-01-01 13:00:00,2,d",
              "type": "date"
            },
            {
              "incr": "2023-01-01 13:00:00,2,d",
              "type": "date"
            }
          ],
          "sliceRecordCount": 100
        }
      }
    },
    "setting": {
      "speed": {
        "bytes": -1,
        "channel": 1
      }
    }
  }
}

参数说明

该插件基于 RDBMS Writer 实现,因此可以参考 RDBMS Writer 的所有配置项。