ShardingSphere 使用示例代码生成器

项目基于 freemarker 模板引擎生成 ShardingSphere 使用示例代码。

使用步骤

  1. 配置参数

文件位置:src/main/resources/config.yaml

  1. 生成代码

运行 org.apache.shardingsphere.example.generator.ExampleGeneratorMain 即可生成对应的示例代码。

生成后的代码位于:target/generated-sources/shardingsphere-${product}-sample

配置项说明

属性名称说明可选项
product产品jdbc、proxy
mode运行模式memory、cluster-zookeeper、cluster-etcd、standalone-file
transaction事务类型local
features功能sharding、readwrite-splitting、db-discovery、encrypt
frameworks框架jdbc、spring-boot-starter-jdbc、spring-boot-starter-jpa、spring-boot-starter-mybatis、spring-namespace-jpa、spring-namespace-mybatis
host数据库主机名
port数据库端口
username数据库用户名
password数据库密码