V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
The Go Programming Language
http://golang.org/
Go Playground
Go Projects
Revel Web Framework
airplayxcom
V2EX  ›  Go 编程语言

Gormat - 跨平台 Gopher 辅助工具

  •  
  •   airplayxcom · 2020-03-07 13:49:11 +08:00 · 1601 次点击
    这是一个创建于 1515 天前的主题,其中的信息可能已经有所发展或是发生改变。

    Gormat - 跨平台 Gopher 辅助工具

    跨平台的界面化 golang 便捷转换器,支持数据库转 Struct、Sql 转 Struct、Json 转 Struct 等。

    image

    Features 功能展示

    • [x] 数据库转 Struct
      • [x] 数据引擎支持
        • [x] Mysql
        • [ ] PostgreSQL
        • [ ] Sqlite3
        • [ ] Mssql
      • [x] 自动存文件
      • [x] 标签支持
        • [x] Gorm
        • [x] Xrom
        • [x] JSON
      • [x] 排除列表
      • [x] 数据映射
      • [x] 自定义转型
    • [x] Sql 转 Struct
    • [x] Json 转 Struct

    Prerequisites 开发条件

    golang >= 1.11
    

    Installation 安装

    安装使用不需要额外的环境,移步到releases下载。

    不同平台需要安装额外的开发环境

    OS X & Linux:

    OpenSSL
    

    Windows:

    Gcc
    

    Usage example 编译示例( windows )

    SET CGO_ENABLED=1
    SET CC=x86_64-w64-mingw32-gcc
    SET GOOS=windows
    SET GOARCH=amd64
    go build -o gormat.exe -ldflags="-H windowsgui"
    

    本项目使用 fyne 开发,更多打包编译步骤参考: https://fyne.io/develop/distribution.html

    Contributing 开源支持

    fyne.io/fyne
    github.com/Chronokeeper/anyxml
    github.com/CloudyKit/fastprinter
    github.com/CloudyKit/jet
    github.com/agrison/go-tablib
    github.com/agrison/mxj
    github.com/bndr/gotabulate
    github.com/buger/jsonparser
    github.com/chenhg5/collection
    github.com/denisenkom/go-mssqldb
    github.com/fatih/astrewrite
    github.com/fatih/camelcase
    github.com/fatih/structs
    github.com/go-sql-driver/mysql
    github.com/lib/pq
    github.com/liudanking/gorm2sql
    github.com/liudanking/goutil
    github.com/mattn/go-sqlite3
    github.com/pinzolo/casee
    github.com/tealeg/xlsx
    github.com/xormplus/builder
    github.com/xormplus/core
    github.com/xormplus/xorm
    golang.org/x/net
    golang.org/x/tools
    gopkg.in/flosch/pongo2.v3
    gopkg.in/yaml.v2
    

    Thanks 鸣谢

    github.com/hsyan2008/gom
    github.com/fatih/structtag
    github.com/yujiahaol68/sql2struct
    github.com/bashtian/jsonutils
    

    Release History 版本历史

    • beta
      • 测试开源版本
    • 0.0.1
      • gormat lite

    About 关于

    在 golang 开发中,有很多时候需要手动敲结构体,并且需要手动入库。尽管 gorm 有自动迁移的功能,但并不能有效、理想化的形成数据库字段。 网上也有很多开源的例子,但是都没有界面化并且方便管理的工具,所以我开始写这个项目,目的就是更高效的开发,转换即用。

    本项目借鉴了许多开源转换库的代码,并结合 orm 进行适度调整。在开发中遇到了很多的问题,fyne 这个 GUI 开发框架也是有很多坑点的,现不赘述。不管是数据库转 Struct,还是 Struct 转 SQL 语句,普遍还存在一些误差,所以转换结果仅供参考, 实际项目请自行调整使用。

    License 授权协议

    这个项目 MIT 协议, 请点击 LICENSE 了解更多细节。

    3 条回复    2020-05-19 11:43:46 +08:00
    janxin
        1
    janxin  
       2020-03-07 14:41:04 +08:00
    fyne UI 框架还挺原始的,LZ 画 UI 麻烦不麻烦哦?
    airplayxcom
        2
    airplayxcom  
    OP
       2020-03-07 15:02:40 +08:00
    @janxin 坑踩得不少,但组件拿来即用
    labulaka521
        3
    labulaka521  
       2020-05-19 11:43:46 +08:00 via Android
    请问有什么坑能说说吗
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2254 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 04:24 · PVG 12:24 · LAX 21:24 · JFK 00:24
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.