{"id":26360978,"url":"https://github.com/we7coreteam/gorm-gen-yaml","last_synced_at":"2025-10-16T10:29:18.267Z","repository":{"id":191375724,"uuid":"684387998","full_name":"we7coreteam/gorm-gen-yaml","owner":"we7coreteam","description":"通用yaml配置文件生成 gorm dao \u0026 modal 文件","archived":false,"fork":false,"pushed_at":"2025-02-10T03:00:38.000Z","size":81,"stargazers_count":13,"open_issues_count":2,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-10T04:19:32.629Z","etag":null,"topics":["golang","gorm","gorm-gen","gorm-gen-yaml"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/we7coreteam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-29T03:11:27.000Z","updated_at":"2025-02-10T03:00:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"7cc3eec4-dd5e-44a7-abc4-5a1028ecc5f6","html_url":"https://github.com/we7coreteam/gorm-gen-yaml","commit_stats":null,"previous_names":["we7coreteam/gorm-gen-yaml"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/we7coreteam%2Fgorm-gen-yaml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/we7coreteam%2Fgorm-gen-yaml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/we7coreteam%2Fgorm-gen-yaml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/we7coreteam%2Fgorm-gen-yaml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/we7coreteam","download_url":"https://codeload.github.com/we7coreteam/gorm-gen-yaml/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243902343,"owners_count":20366266,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","gorm","gorm-gen","gorm-gen-yaml"],"created_at":"2025-03-16T17:19:07.441Z","updated_at":"2025-10-16T10:29:13.216Z","avatar_url":"https://github.com/we7coreteam.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gorm-gen-yaml\n\n根据 yaml 配置文件生成数据库表的 model 文件及 dao 文件。\n\n程序会根据配置文件中声明的表之间的依赖关系，按照顺序进行生成。让你摆锐复杂的依赖关系。\n\noutput 目录为根据下面配置生成出的文件。\n\n# 配置\n\n\u003ca href=\"https://github.com/we7coreteam/gorm-gen-yaml/blob/main/gen.yaml\"\u003e查看配置文件\u003c/a\u003e\n\n# 调用\n\n```go\ng := gen.NewGenerator(gen.Config{\n    OutPath:      \"./output/dao\",\n    Mode:         gen.WithoutContext | gen.WithDefaultQuery | gen.WithQueryInterface, // generate mode\n    ModelPkgPath: \"entity\",\n})\ng.UseDB(db)\nfieldOpts := []gen.ModelOpt{}\nyamlgen.NewYamlGenerator(\"./gen.yaml\").UseGormGenerator(g).Generate(fieldOpts...)\n//g.ApplyBasic(g.GenerateAllTable(fieldOpts...)...)\n//g.GenerateModel(tableName)\ng.Execute()\n```\n\n# 测试\n\n运行 gen_test.go 文件中的 TestParse 方法。生成完成 dao 和 model 文件后，可以删除 TestSelect 注释进行测试\n\n# 交流群\n\nQQ群：364768550\n\n\u003cimg src=\"https://s2.loli.net/2024/06/03/uMjYwCWmVPaRSUt.png\" width=\"300\" \u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwe7coreteam%2Fgorm-gen-yaml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwe7coreteam%2Fgorm-gen-yaml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwe7coreteam%2Fgorm-gen-yaml/lists"}