gen icon indicating copy to clipboard operation
gen copied to clipboard

Gen: Friendly & Safer GORM powered by Code Generation

Results 281 gen issues
Sort by recently updated
recently updated
newest added

**gen** produce field comment as below: ``` Field1 *string `gorm:"column:field1;type:varchar(10)" json:"field1"` // this is field1 desc ``` but gorm migration has different definition as below: ``` Field1 *string `gorm:"column:field1;type:varchar(10);comment:this is...

## GORM Playground Link no link - this is a bug in the cli binary ## Description looks like the tool is failing to format some generated code ``` gentool...

## 如何设置自定义类型与gen类型的对应 ## The document you expected this should be explained 我又一个自定义类型 ``` type MyTime struct { time.Time } ``` 然后再模型中引用: ``` type MyModel { gorm.Model SubmittedAt *MyTime `gorm:"column:submitted;type:datetime(6)" json:"submitted_at"`...

## Your Question Sometimes there is a need to use functions that are not in code generation (e.g. UPPER). For example, I would like to get the following request: ```...

## Your Question 不同表名前缀生成到不同的目录 ## The document you expected this should be explained 数据库有s3_开头与sso_开头的表名, 如何配置让s3_开头的表名生成到queryS3、modelS3目录下 让sso_开头的表名生成到querySso、modelSso目录下 ## Expected answer

Bumps [gorm.io/plugin/dbresolver](https://github.com/go-gorm/dbresolver) from 1.2.1 to 1.2.2. Commits daa8575 Register callbacks for global resolver See full diff in compare view [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=gorm.io/plugin/dbresolver&package-manager=go_modules&previous-version=1.2.1&new-version=1.2.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR...

dependencies
go

create table sql ``` create SCHEMA test; CREATE TYPE "public".fruit_color AS ENUM ('unknown', 'red', 'green', 'orange'); create table "test"."fruits"( "name" varchar(64) COLLATE "pg_catalog"."default" DEFAULT ''::character varying, "color" "public"."fruit_color" NOT NULL...

## Describe the feature 支持导出query的filed 对应的类型。 ## Motivation 我目前是用gen来生成所有的SQL数据库表,然后把query绑定到不同的repository struct上面使用的。 虽然看到了之前的issue,可以在方法或者函数里面直接把query field赋值给变量,但在我的使用场景中,一个struct只会用到一两个table,不会用到query上面的全部SQL表。所以比较合适的办法是直接把query上面的某几个dao挂到我的不同struct上,而非把整个query挂到结构体上,然后再每次从query上面赋值出来。 同时因为这些类型没有导出,我也没法直接把query.Field 赋值给结构体的某个字段再使用。 希望能增加一个mode直接导出没有绑定context的表类型。 ## Related Issues

## GORM Playground Link no link as this is not something i found while coding https://github.com/go-gorm/playground/pull/1 ## Description ``` go run --race tools/gentool/gentool.go \ --db postgres \ --dsn '.......' \...

## GORM Playground Link ## Description Hello! When trying to use Alias ​​it is not declared in FROM: ``` sc := Query().SoftwareComponent.As("sc") sc.Select(sc.Id).First() // Generated: SELECT "sc"."id" FROM "software_component" ORDER...