Skip to content

Releases

bump goctl support

Choose a tag to compare

@SpectatorNan SpectatorNan released this 29 Jun 14:14
b538f7e

upgrade new goctl support

  • gorm-zero support
    • support check sql null import
    • custom gorm deleted_at key
    • support gorm before create with before update hook, template example in model.tpl

source code link:
goctl-gorm-zero-support

Add Config type open db

Choose a tag to compare

@SpectatorNan SpectatorNan released this 15 Dec 11:05
  • support set cache expire time when query db
  • add mysql and pgsql config type struct
  • add ConnectMysql with ConnectPgSql method open db
    mysql:
       db, err := gormc.ConnectMysql(c.Mysql)
	if err != nil {
		log.Fatal(err)
	}

pgsql:

       db, err := gormc.ConnectPgSql(c.PgSql)
	if err != nil {
		log.Fatal(err)
	}

notice:

  • If you need the model type to support the DeletedAt field to automatically use gorm.DeletedAt and automatically determine whether to reference database, you can use the following modified version of goctl code_link, please download the corresponding package according to the system type.
#check version  modified version has gormc flag
goctl -v
goctl version 1.4.3-gormc darwin/amd64
  • If you do not use gorm-zero support version, when the table contains optional fields, please manually import database/sql

Update templates to better handle caching

Choose a tag to compare

@SpectatorNan SpectatorNan released this 23 Sep 16:12

Full Changelog: v1.0.0...v1.0.2

version 1.0.1

Choose a tag to compare

@SpectatorNan SpectatorNan released this 17 Sep 17:07

Optimize cache related templates