Skip to content

Commit

Permalink
feat: init gen.go
Browse files Browse the repository at this point in the history
  • Loading branch information
tr1v3r committed Feb 15, 2023
1 parent 3f14b65 commit 3f15714
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
16 changes: 16 additions & 0 deletions gen.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package main

import "gorm.io/gen"

func generate() {
g := gen.NewGenerator(gen.Config{
OutPath: "./query",
Mode: gen.WithDefaultQuery, /*WithQueryInterface, WithoutContext*/
})

g.UseDB(DB)

g.ApplyBasic(g.GenerateModel("people"), g.GenerateModelAs("temp_user", "User"))

g.Execute()
}
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ module gorm.io/playground
go 1.16

require (
github.com/denisenkom/go-mssqldb v0.12.2 // indirect
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect
gorm.io/driver/mysql v1.4.1
gorm.io/driver/postgres v1.4.4
gorm.io/driver/sqlite v1.4.2
gorm.io/driver/sqlserver v1.4.1
gorm.io/gen v0.3.21
gorm.io/gorm v1.24.0
)

Expand Down

0 comments on commit 3f15714

Please sign in to comment.