This repository has been archived on 2025-03-16. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
boilerplate/internal/gen/gen.go
2025-01-03 00:05:10 +07:00

22 lines
492 B
Go

package main
import (
"gorm.io/gen"
"app/internal/models"
)
func main() {
// Initialize the generator with configuration
g := gen.NewGenerator(gen.Config{
OutPath: "../dal", // output directory, default value is ./query
Mode: gen.WithDefaultQuery | gen.WithQueryInterface | gen.WithoutContext,
FieldNullable: true,
})
// Generate default DAO interface for those specified structs
g.ApplyBasic(models.Entities...)
// Execute the generator
g.Execute()
}