Categories: GoFrame 教程

GoFrame 开发工具-代码生成

最新的CLI工具版本功能会随着GoFrame框架的最新版本编译,引入如果本地的CLI工具自动化生成的代码与项目的GoFrame框架版本出现兼容性问题时,建议升级项目框架版本,或者自定义安装旧版本的CLI工具。旧版本CLI工具安装方式参考仓库首页介绍:https://github.com/gogf/gf-cli

使用方式

$ gf gen -h
USAGE
    gf gen COMMAND [OPTION]

COMMAND
    dao         automatically generate go files for dao/dto/entity
    pb          parse proto files and generate protobuf go files
    pbentity    generate entity message files in protobuf3 format

DESCRIPTION
    The "gen" command is designed for multiple generating purposes.
    Its currently supporting generating go files for ORM models, protobuf and protobuf entity files.
    Please use "gf gen dao -h" for specified type help.

注意事项

gen命令涉及到数据访问相关代码生成时,默认支持的数据库类型为:​MySQL/MariaDB​、​PostgreSQL​、​SQLServer​。

如果需要​SQLite​或​Oracle​数据库类型支持,需要开发者自己修改源码文件后自行本地手动编译生成​CLI​工具随后安装,因为这两个数据库的驱动需要​CGO​支持,无法预编译生成给大家直接使用。

andy

前端小白,在Web176教程网这个平台跟大家一起学习,加油!

Share
Published by
andy

Recent Posts

聊聊vue3中的defineProps

在Vue 3中,defineP…

1 周 ago

在 Chrome 中删除、允许和管理 Cookie

您可以选择删除现有 Cooki…

2 周 ago

自定义指令:聊聊vue中的自定义指令应用法则

今天我们来聊聊vue中的自定义…

3 周 ago

聊聊Vue中@click.stop和@click.prevent

一起来学下聊聊Vue中@cli…

4 周 ago

Nginx 基本操作:启动、停止、重启命令。

我们来学习Nginx基础操作:…

1 月 ago

Vue3:手动清理keep-alive组件缓存的方法

Vue3中手动清理keep-a…

1 月 ago