我给 ”Go 语言“ 开发了 6 个在线工具

工具快速访问

  • JSON 转 GO: https://www.printlove.cn/tool...
  • YAML 转 GO: https://www.printlove.cn/tool...
  • SQL 转 go-zero Model: https://printlove.cn/tools/sq...
  • SQL 转 GORM Model: https://www.printlove.cn/tool...
  • SQL 转 ElasticSearch DSL: https://printlove.cn/tools/sq...
  • SQL 转 entgo schema: https://printlove.cn/tools/sq...
JSON转GO 网址:https://www.printlove.cn/tool...
1. 有两种模式
  • 转化-展开:json中的所有对象都创建为新的struct
  • 转化-嵌套:json中的对象都包含到一个struct中
2. 自定义tag
默认转化后的tagjson,也可以自定义,比如可以改为:gorm
3. 效果图
我给 ”Go 语言“ 开发了 6 个在线工具
文章图片

YAML转GO 网址:https://www.printlove.cn/tool...
将 yaml 格式自动转化为 Go Struct 结构。
效果图
我给 ”Go 语言“ 开发了 6 个在线工具
文章图片

SQL 转 ent 网址:https://printlove.cn/tools/sq...
1. 效果图
我给 ”Go 语言“ 开发了 6 个在线工具
文章图片

2. 功能
  1. 此工具提供将 SQL 语句转化为 ent schema
  2. 提供常见的数据库类型到 field 函数的转化
SQL 转 ElasticSearch DSL 网址:https://printlove.cn/tools/sq...
1. 效果图
我给 ”Go 语言“ 开发了 6 个在线工具
文章图片

2. 当前支持
  • [x] sql and expression
  • [x] sql or expression
  • [x] equal(=) support
  • [x] not equal(!=) support
  • [x] gt(>) support
  • [x] gte(>=) support
  • [x] lt(<) support
  • [x] lte(<=) support
  • [x] sql in (eg. id in (1,2,3) ) expression
  • [x] sql not in (eg. id not in (1,2,3) ) expression
  • [x] paren bool support (eg. where (a=1 or b=1) and (c=1 or d=1))
  • [x] sql like expression (currently use match phrase, perhaps will change to wildcard in the future)
  • [x] sql order by support
  • [x] sql limit support
  • [x] sql not like expression
  • [x] field missing check
  • [x] support aggregation like count(*), count(field), min(field), max(field), avg(field)
  • [x] support aggregation like stats(field), extended_stats(field), percentiles(field) which are not standard sql function
  • [ ] null check expression(is null/is not null)
  • [ ] join expression
  • [ ] having support
    SQL转go-zero
网址:https://printlove.cn/tools/sq...
1. 效果图
我给 ”Go 语言“ 开发了 6 个在线工具
文章图片

2. 功能
和官方的 goctl 工具生成的代码是一样的,同样支持是否带缓存的Model。
SQL转GORM Model 网址:https://www.printlove.cn/tool...
1. 效果图
【我给 ”Go 语言“ 开发了 6 个在线工具】我给 ”Go 语言“ 开发了 6 个在线工具
文章图片

2. 功能
  • 支持多表
  • 支持引入包的导入

    推荐阅读