oblogproxy/third-party/etransfer-cpp
wangxiantong.wxt 0be86e9311 support obcdc 4.3.0.1 2024-04-15 20:17:00 +08:00
..
cmake support ddl convert 2024-01-17 14:54:46 +08:00
example support ddl convert 2024-01-17 14:54:46 +08:00
grammar/oceanbase support obcdc 4.3.0.1 2024-04-15 20:17:00 +08:00
include/convert support ddl convert 2024-01-17 14:54:46 +08:00
src support obcdc 4.3.0.1 2024-04-15 20:17:00 +08:00
test support obcdc 4.3.0.1 2024-04-15 20:17:00 +08:00
thirdparty/antlr4 support ddl convert 2024-01-17 14:54:46 +08:00
.clang-format support ddl convert 2024-01-17 14:54:46 +08:00
.gitignore support ddl convert 2024-01-17 14:54:46 +08:00
CMakeLists.txt support ddl convert 2024-01-17 14:54:46 +08:00
README.md support ddl convert 2024-01-17 14:54:46 +08:00

README.md

etransfer-cpp

etransfer-cpp is a DDL conversion tool, it is currently used to convert DDL statements from OceanBase MySQL mode to MySQL fully compatible DDL statements.

Overview

The following picture shows how etransfer-cpp works.

  graph LR
    sql1["create table t(
        a int, b int)
        BLOCK_SIZE = 16384"]--String--> Source
    subgraph Source
        direction LR
        Parser([Oceanbase Parser])
    end
    subgraph Sink
        direction TB
        ObjectBuilder([MySQL ObjectBuilder])
    end
    Source -- Object --> Sink

    Sink --String--> sql2["CREATE TABLE `t`(
        `a` INTEGER,
        `b` INTEGER
        )"]

The etransfer-cpp includes two stages: source and sink. In the source stage, DDL statements in OceanBase MySQL mode are parsed to intermediate Object (such as CreateTableObject) based on antlr4. In the sink stage, the intermediate Object is built into MySQL fully compatible DDL statements.

Build

Prerequisites

  • The minimum C++ version to compile the etransfer-cpp is C++17.
  • Java 11 is required to generate grammar parser code.

Build etransfer-cpp

cd etransfer-cpp
mkdir -p build
cd build
cmake ..
make

Usage

etransfer-cpp can be used as library in your project. The example code can be found at example code.