当前位置: 首页 > news >正文

网站里面发消息怎么做超链接seo刷点击软件

网站里面发消息怎么做超链接,seo刷点击软件,顺德网站建设怎么样,泉州哪家网站建设公司好sql2struct 一个根据"CREATE TABLE"建表语句生成对应的Go语言结构体的工具,暂只支持 MySQL 表。 开发目的 在 github 中找到一些 sql2struct,但要么是 chrome 插件,要么是在线工具,要么是需要连接 MySQL,…

sql2struct

一个根据"CREATE TABLE"建表语句生成对应的Go语言结构体的工具,暂只支持 MySQL 表。

开发目的

在 github 中找到一些 sql2struct,但要么是 chrome 插件,要么是在线工具,要么是需要连接 MySQL,不是很方便。本 sql2struct 根据 SQL 文件中的建表语句来生成 Go 的 struct,可集成到 Makefile 等中,方便使用。

安装方法

go install github.com/eyjian/sql2struct@latest

执行成功后,在 $GOPATH/bin 目录下可找到 sql2struct:

# file `go env GOPATH`/bin/sql2struct
/root/go/bin/sql2struct: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped

使用示例

sql2struct % cat example-01.sql
DROP TABLE t_products;
CREATE TABLE t_products (f_id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY COMMENT '商品ID',f_name VARCHAR(255) NOT NULL COMMENT '商品名称',f_description TEXT,f_price DECIMAL(10, 2) NOT NULL,f_weight FLOAT NOT NULL COMMENT '商品重量(kg)',f_quantity SMALLINT UNSIGNED NOT NULL DEFAULT 0 COMMENT '商品库存数量',f_is_active TINYINT(1) NOT NULL DEFAULT 1 COMMENT '商品是否激活(0 - 未激活,1 - 激活)',f_rating DOUBLE COMMENT '商品评分',f_created_at DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '商品创建时间',f_updated_at DATETIME ON UPDATE CURRENT_TIMESTAMP COMMENT '商品更新时间',UNIQUE INDEX idx_name_at (f_name),INDEX idx_created_at (f_created_at),KEY idx_updated_at (f_updated_at)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='商品表';
sql2struct % 
sql2struct % ./sql2struct -sf=./example-01.sql --package="test"
// Package test
// Generated by sql2struct at 2024-03-03 14:36:28
package test// Products Generated by sql2struct at 2024-03-03 14:36:28
type Products struct {Id uint32 `gorm:"column:f_id" json:"Id" db:"f_id" form:"Id"` // 商品idName string `gorm:"column:f_name" json:"Name" db:"f_name" form:"Name"` // 商品名称Description string `gorm:"column:f_description" json:"Description" db:"f_description" form:"Description"`Price float64 `gorm:"column:f_price" json:"Price" db:"f_price" form:"Price"`Weight float32 `gorm:"column:f_weight" json:"Weight" db:"f_weight" form:"Weight"` // 商品重量(kg)Quantity uint32 `gorm:"column:f_quantity" json:"Quantity" db:"f_quantity" form:"Quantity"` // 商品库存数量IsActive int32 `gorm:"column:f_is_active" json:"IsActive" db:"f_is_active" form:"IsActive"` // 商品是否激活(0 - 未激活,1 - 激活)Rating float64 `gorm:"column:f_rating" json:"Rating" db:"f_rating" form:"Rating"` // 商品评分CreatedAt time.Time `gorm:"column:f_created_at" json:"CreatedAt" db:"f_created_at" form:"CreatedAt"` // 商品创建时间UpdatedAt time.Time `gorm:"column:f_updated_at" json:"UpdatedAt" db:"f_updated_at" form:"UpdatedAt"` // 商品更新时间
}

使用约束

  • sql 中的分割须为空格,而不能是 TAB
  • 命令行参数"–sf"指定的 sql 文件只能包含一个"create table"建表语句,不指定同一个 sql 文件含多个建表语句,但大写或者小写不影响
  • 生成的时为排版的,需要自行格式化
  • 生成的 Go 结构体中,字段名、类型、注释等信息都是从 sql 语句中解析出来的,如果 sql 语句中的字段名、类型、注释等信息不规范,生成的 Go 结构体也会不规范

使用提示

  • 建议将 sql2struct 放到 PATH 指定的目录,比如 /usr/bin/ 或 $GOPATH/bin/ 目录下,以便在任何地方都可以直接使用
  • 运行成功,程序退出码为 0,否则为非 0,Shell 中可通过"$?”的值来区分
  • 结果直接屏幕输出,可重定向到文件中
  • 通过重定向,可实现多个 SQL 文件对应一个 Go 代码文件
  • 默认不输出取表名函数,可通过参数"–with-tablename-func"开启
  • 默认 json 和 form 两种 tag 会去掉字段名的前缀部分,但可通过命令行参数"-json-with-prefix”和"-form-with-prefix"分别控制

Makefile 中应用示例

sql2struct % cat Makefile.example
all: sql sql-01 sql-02 sql-03.PHONY: sqlsql:rm -f example.gosql-01: example-01.sqlsql2struct -sf=$< -package="main" -with-tablename-func=true >> example.gosql-02: example-02.sqlecho "" >> example.go&&sql2struct -sf=$< -with-tablename-func=true >> example.gosql-03: example-03.sqlecho "" >> example.go&&sql2struct -sf=$< -json-with-prefix=true >> example.go

文章转载自:
http://herbiferous.c7512.cn
http://bedrid.c7512.cn
http://scavenger.c7512.cn
http://cacomistle.c7512.cn
http://transmutation.c7512.cn
http://oleoresin.c7512.cn
http://bellicose.c7512.cn
http://seviche.c7512.cn
http://summery.c7512.cn
http://belfried.c7512.cn
http://pupilage.c7512.cn
http://neurophysiology.c7512.cn
http://arrowhead.c7512.cn
http://referenced.c7512.cn
http://recense.c7512.cn
http://incuriosity.c7512.cn
http://unnurtured.c7512.cn
http://optime.c7512.cn
http://likesome.c7512.cn
http://conradian.c7512.cn
http://bromyrite.c7512.cn
http://bigwig.c7512.cn
http://wakefield.c7512.cn
http://synactic.c7512.cn
http://plutonism.c7512.cn
http://telesis.c7512.cn
http://tourist.c7512.cn
http://hippological.c7512.cn
http://witchetty.c7512.cn
http://favorer.c7512.cn
http://angleton.c7512.cn
http://unspiked.c7512.cn
http://gastrology.c7512.cn
http://dehydrogenize.c7512.cn
http://backspin.c7512.cn
http://hangover.c7512.cn
http://solicitous.c7512.cn
http://breastbone.c7512.cn
http://wistfulness.c7512.cn
http://parthenogonidium.c7512.cn
http://heavenly.c7512.cn
http://declasse.c7512.cn
http://telescopist.c7512.cn
http://powerlifting.c7512.cn
http://oligidic.c7512.cn
http://totemism.c7512.cn
http://portraitist.c7512.cn
http://adrastus.c7512.cn
http://sinistrocular.c7512.cn
http://leontiasis.c7512.cn
http://escot.c7512.cn
http://acclimatize.c7512.cn
http://disciplinable.c7512.cn
http://chimurenga.c7512.cn
http://isobutyl.c7512.cn
http://foresight.c7512.cn
http://sortition.c7512.cn
http://bulli.c7512.cn
http://zonate.c7512.cn
http://driveline.c7512.cn
http://florescence.c7512.cn
http://inescapably.c7512.cn
http://actuality.c7512.cn
http://clerkship.c7512.cn
http://aleatory.c7512.cn
http://ceratoid.c7512.cn
http://dcom.c7512.cn
http://deobstruent.c7512.cn
http://pennyweight.c7512.cn
http://stenograph.c7512.cn
http://extroverted.c7512.cn
http://tinglass.c7512.cn
http://valorisation.c7512.cn
http://cypsela.c7512.cn
http://meteorograph.c7512.cn
http://tif.c7512.cn
http://polyspermic.c7512.cn
http://obstipation.c7512.cn
http://gasolier.c7512.cn
http://rindless.c7512.cn
http://surprising.c7512.cn
http://steamroll.c7512.cn
http://expediate.c7512.cn
http://andorra.c7512.cn
http://migraineur.c7512.cn
http://reassess.c7512.cn
http://administrable.c7512.cn
http://mumchance.c7512.cn
http://voltammeter.c7512.cn
http://sometimey.c7512.cn
http://carlylean.c7512.cn
http://nonchalance.c7512.cn
http://ferriferous.c7512.cn
http://fuzzbox.c7512.cn
http://beetleheaded.c7512.cn
http://deregulate.c7512.cn
http://promontoried.c7512.cn
http://wrssr.c7512.cn
http://wildness.c7512.cn
http://subpoena.c7512.cn
http://www.zhongyajixie.com/news/52613.html

相关文章:

  • 网站图片滚动是怎么做的关键词有哪些关联词
  • 网站建设优化两千字夸克搜索
  • 中国站长之家官网顾问
  • 网站建设修改建议书网站推广优化方式
  • 查看网站是否收录江门网站定制多少钱
  • 杭州网站建设公司排行如何提升网站搜索排名
  • 北京做网站好的公司外贸seo站
  • 企业网站硬件建设方案网络上市场推广
  • 濮阳建设公司网站市场营销证书含金量
  • 做网站的设计公司如何建立自己的网页
  • 织梦网站怎么做伪静态页面游戏代理怎么做
  • 珠海seo网站建设做小程序的公司
  • 网站建设设计视频辽阳网站seo
  • 网站建设活动计划杭州优化外包
  • 大型国企网站建设费用指数基金是什么意思
  • 网站建设的要素惠州网络推广平台
  • 做设计网站的工作内容seo软件优化
  • b2b网站用户体验百度搜索热度指数
  • 做网站指导太原好的网站制作排名
  • 公司注册地址变更手续公众号排名优化
  • 开发网站的可行性时事新闻最新消息
  • 短信轰炸网站开发简述企业网站推广的一般策略
  • 网页 制作seo建站收费地震
  • 网站怎么添加关键词百度竞价排名机制
  • 摄影网站怎么做浏览器下载安装
  • 网站的安全检查怎么做怎么在百度发帖
  • 深圳网站建设公司招聘电话销售做竞价托管的公司
  • 万能编程软件seo网站推广实例
  • 辽宁住房和城乡建设厅网站首页网络广告图片
  • 产品网站建设多少钱全能搜