synth 简单试用

以下是一个简单的试用,主要是体验下synth 的功能

安装

我使用的mac 系统,其他系统按照官方文档操作

curl --proto '=https' --tlsv1.2 -sSL https://getsynth.com/install | sh

项目创建

  • 创建文件夹
mkdir  first
  • 创建简单模型
    我直接通过pg 数据库导入的
 
synth import --from postgres://user:pass@localhost:5432/postgres --schema public sensor

效果

  • 准备数据库
    docker-compose 文件,基于pg 的测试
 
version: "3"
services:
   postgres:
      image: postgres:16.0
      ports:
        - "5432:5432"
      environment:
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres
      - POSTGRES_DB=postgres
  • 生成
synth generate --size 100 --to postgres://postgres:postgres@localhost:5432 --schema public sensor

说明

目前直接基于db生成db数据的时候是有一些问题,并不是很顺畅,毕竟我们实际业务中还是比较复杂的,为了更好的生成数据还是还得更好的调整模型
让模型更加符合实际业务,synth 工具值得学习下

参考资料

https://github.com/shuttle-hq/synth
https://github.com/shuttle-hq/synth/tree/master/examples/bank/bank_db
https://www.getsynth.com/docs/getting_started/hello-world

posted on   荣锋亮  阅读(29)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
历史上的今天:
2022-01-16 image-combiner 方便的图片合成包
2022-01-16 使用graalvm native-image 快速暴露jar 代码为native 共享库
2021-01-16 xk6 构建原理说明
2020-01-16 mupdf pdf文档转换工具源码构建安装

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示