{"id":18872774,"url":"https://github.com/survivorbat/gorm-like","last_synced_at":"2025-04-14T16:14:40.720Z","repository":{"id":176894217,"uuid":"659708145","full_name":"survivorbat/gorm-like","owner":"survivorbat","description":"I wanted to provide a map to a WHERE query and automatically turn it into a LIKE query if wildcards were present, this plugin does just that.","archived":false,"fork":false,"pushed_at":"2024-10-29T08:02:19.000Z","size":60,"stargazers_count":3,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-14T16:14:34.169Z","etag":null,"topics":["database","go","go-orm","golang","gorm","like"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/survivorbat/gorm-like","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/survivorbat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-06-28T11:47:40.000Z","updated_at":"2024-10-29T08:00:30.000Z","dependencies_parsed_at":"2024-11-08T05:33:44.053Z","dependency_job_id":"3bc0c151-d2b9-421c-a0b6-e955982657e0","html_url":"https://github.com/survivorbat/gorm-like","commit_stats":null,"previous_names":["survivorbat/gorm-like"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/survivorbat%2Fgorm-like","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/survivorbat%2Fgorm-like/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/survivorbat%2Fgorm-like/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/survivorbat%2Fgorm-like/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/survivorbat","download_url":"https://codeload.github.com/survivorbat/gorm-like/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248914114,"owners_count":21182359,"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":["database","go","go-orm","golang","gorm","like"],"created_at":"2024-11-08T05:32:12.628Z","updated_at":"2025-04-14T16:14:40.698Z","avatar_url":"https://github.com/survivorbat.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 👍 Gorm Auto Like Plugin\n\n[![Go package](https://github.com/survivorbat/gorm-like/actions/workflows/test.yaml/badge.svg)](https://github.com/survivorbat/gorm-like/actions/workflows/test.yaml)\n\nI wanted to provide a map to a WHERE query and automatically turn it into a LIKE query if wildcards were present, this\nplugin does just that. [If you want to convert queries based on prefix, you should have a look at gorm-query-convert](https://github.com/survivorbat/gorm-query-convert).\n\nBy default, all queries are turned into like-queries if either a % or a given character is found, if you don't want this,\nyou have 2 options:\n\n- `TaggedOnly()`: Will only change queries on fields that have the `gormlike:\"true\"` tag\n- `SettingOnly()`: Will only change queries on `*gorm.DB` objects that have `.Set(\"gormlike\", true)` set.\n\nIf you want a particular query or field to not be like-able, use `.Set(\"gormlike\", false)` or `gormlike:\"false\"` respectively. These work\nregardless of configuration.\n\n## 💡 Related Libraries\n\n- [deepgorm](https://github.com/survivorbat/gorm-deep-filtering) turns nested maps in WHERE-calls into subqueries\n- [gormqonvert](https://github.com/survivorbat/gorm-query-convert) turns WHERE-calls into different queries if certain tokens were found\n- [gormcase](https://github.com/survivorbat/gorm-case) adds case insensitivity to WHERE queries\n- [gormtestutil](https://github.com/ing-bank/gormtestutil) provides easy utility methods for unit-testing with gorm\n\n## ⬇️ Installation\n\n`go get github.com/survivorbat/gorm-like`\n\n## 📋 Usage\n\n```go\npackage main\n\nimport (\n    \"github.com/survivorbat/gorm-like\"\n)\n\nfunc main() {\n\tdb, _ := gorm.Open(sqlite.Open(\"test.db\"), \u0026gorm.Config{})\n\tdb.Use(gormlike.New())\n}\n\n```\n\n## 🔭 Plans\n\nNot much here.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsurvivorbat%2Fgorm-like","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsurvivorbat%2Fgorm-like","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsurvivorbat%2Fgorm-like/lists"}