{"id":37151027,"url":"https://github.com/go-kenka/dent","last_synced_at":"2026-01-14T17:50:45.934Z","repository":{"id":61625962,"uuid":"542397054","full_name":"go-kenka/dent","owner":"go-kenka","description":"Go entity framework","archived":false,"fork":false,"pushed_at":"2022-09-28T07:21:27.000Z","size":37,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-20T14:27:59.051Z","etag":null,"topics":["ent","entity-framework","go","golang"],"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/go-kenka.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}},"created_at":"2022-09-28T03:52:30.000Z","updated_at":"2024-06-20T14:27:59.052Z","dependencies_parsed_at":"2022-10-18T17:30:13.754Z","dependency_job_id":null,"html_url":"https://github.com/go-kenka/dent","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/go-kenka/dent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-kenka%2Fdent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-kenka%2Fdent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-kenka%2Fdent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-kenka%2Fdent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-kenka","download_url":"https://codeload.github.com/go-kenka/dent/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-kenka%2Fdent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28428958,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T16:38:47.836Z","status":"ssl_error","status_checked_at":"2026-01-14T16:34:59.695Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["ent","entity-framework","go","golang"],"created_at":"2026-01-14T17:50:45.340Z","updated_at":"2026-01-14T17:50:45.930Z","avatar_url":"https://github.com/go-kenka.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## dent - 一个强大的Go语言实体框架\n\ndent是一个简单而又功能强大的Go语言实体框架，dent易于构建和维护应用程序与大数据模型。\n\n- **图就是代码** - 将任何数据库表建模为Go对象。\n- **轻松地遍历任何图形** - 可以轻松地运行查询、聚合和遍历任何图形结构。\n- **静态类型和显式API** - 使用代码生成静态类型和显式API，查询数据更加便捷。\n- **多存储驱动程序** - 支持MySQL, PostgreSQL, SQLite 和 Gremlin。\n- **可扩展** - 简单地扩展和使用Go模板自定义。\n\n## 快速安装\n```console\ngo get github.com/go-kenka/dent\n```\n## 示例\n```go\nclient, err := dent.Open(\"mysql\", \"root:pass@tcp(localhost:3306)/test\")\n\tif err != nil {\n\t\tt.Fatalf(\"failed opening connection to mysql: %v\", err)\n\t}\n\tdefer client.Close()\n\n\ttable := dent.NewTable(\"test_aaa\")\n\ttable.AddColumn(\u0026schema.Column{\n\t\tName: \"field1\",\n\t\tType: field.TypeInt,\n\t})\n\ttable.AddColumn(\u0026schema.Column{\n\t\tName: \"field2\",\n\t\tType: field.TypeInt,\n\t})\n\n\t// Run the auto migration tool.\n\tif err := client.Schema.Create(context.Background(), table); err != nil {\n\t\tt.Fatalf(\"failed creating schema resources: %v\", err)\n\t}\n\n\tdclient := client.Dynamic\n\tdclient.AddTable(table)\n\t{\n\t\ttable := NewTable(\"user\")\n\t\ttable.AddColumn(\u0026schema.Column{\n\t\t\tName: \"username\",\n\t\t\tType: field.TypeString,\n\t\t})\n\t\ttable.AddColumn(\u0026schema.Column{\n\t\t\tName: \"creator_id\",\n\t\t\tType: field.TypeInt,\n\t\t})\n\t\tdclient.AddTable(table)\n\t}\n\n\tresult, err := dclient.Table(\"test_aaa\").Create().SetValue(\"field3\", 1).SetValue(\"field2\", 2).Save(context.Background())\n\tif err != nil {\n\t\tt.Fatalf(\"failed create value: %v\", err)\n\t}\n\n\tt.Logf(\"create result: %v\", result.Row)\n\n\tresult, err = result.Update().SetValue(\"field1\", 4).Save(context.Background())\n\tif err != nil {\n\t\tt.Fatalf(\"failed update value: %v\", err)\n\t}\n\n\tt.Logf(\"update result: %v\", result.Row)\n\n\terr = result.Delete().Exec(context.Background())\n\tif err != nil {\n\t\tt.Fatalf(\"failed delete value: %v\", err)\n\t}\n\n\tresult, err = dclient.Table(\"user\").Query().Where(And(IntEQ(\"id\", 1))).WithListData(\"test_aaa\", \"test_list\", \"field1\").First(context.Background())\n\tif err != nil {\n\t\tt.Fatalf(\"failed create value: %v\", err)\n\t}\n\tt.Logf(\"query result: %v\", result)\n\n\tcount, err := dclient.Table(\"test_aaa\").Query().Where(And(IntEQ(\"field1\", 1))).Count(context.Background())\n\tif err != nil {\n\t\tt.Fatalf(\"failed create value: %v\", err)\n\t}\n\tt.Logf(\"count result: %v\", count)\n\n```\n\n## 声明\ndent使用Apache 2.0协议授权，可以在[LICENSE文件](LICENSE)中找到。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-kenka%2Fdent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-kenka%2Fdent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-kenka%2Fdent/lists"}