{"id":17863984,"url":"https://github.com/wppurking/gin-gorm","last_synced_at":"2026-04-28T20:05:40.707Z","repository":{"id":57485450,"uuid":"197419616","full_name":"wppurking/gin-gorm","owner":"wppurking","description":"gin gorm middleware","archived":false,"fork":false,"pushed_at":"2019-07-17T16:17:20.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-20T11:48:04.991Z","etag":null,"topics":["gin","gin-gonic","gin-middleware","gorm"],"latest_commit_sha":null,"homepage":null,"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/wppurking.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":"2019-07-17T15:49:04.000Z","updated_at":"2019-07-17T16:17:57.000Z","dependencies_parsed_at":"2022-08-26T13:23:30.944Z","dependency_job_id":null,"html_url":"https://github.com/wppurking/gin-gorm","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wppurking%2Fgin-gorm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wppurking%2Fgin-gorm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wppurking%2Fgin-gorm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wppurking%2Fgin-gorm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wppurking","download_url":"https://codeload.github.com/wppurking/gin-gorm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246893304,"owners_count":20850927,"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":["gin","gin-gonic","gin-middleware","gorm"],"created_at":"2024-10-28T09:06:04.801Z","updated_at":"2026-04-28T20:05:35.686Z","avatar_url":"https://github.com/wppurking.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gin Gorm\nAn gin middleware to provide every gin action an gorm transaction\n\n# Install\n`go get github.com/wppurking/gin-gorm`\n\n\n# Usage\n1. First `gin.Use` this middleware\n2. In the `gin Action` method use `gin_gorm.Tx(c)` to get the gorm.DB transactino to use\n```\nfunc main() {\n\trouter := gin.Default()\n\n\trouter.POST(\"/form_post\", func(c *gin.Context) {\n\t\tmessage := c.PostForm(\"message\")\n\t\tnick := c.DefaultPostForm(\"nick\", \"anonymous\")\n\n\t\ttx := gin_gorm.Tx(c)\n\t\tvar user model.User\n\t\ttx.Where(\"nick = ?\", nick).First(\u0026user)\n\n\t\tc.JSON(200, gin.H{\n\t\t\t\"status\":  \"posted\",\n\t\t\t\"message\": message,\n\t\t\t\"nick\":    nick,\n\t\t\t\"user\":    user,\n\t\t})\n\t})\n\trouter.Run(\":8080\")\n}\n\n``` \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwppurking%2Fgin-gorm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwppurking%2Fgin-gorm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwppurking%2Fgin-gorm/lists"}