{"id":17649199,"url":"https://github.com/pengux/cruder","last_synced_at":"2025-05-07T06:20:31.102Z","repository":{"id":57527048,"uuid":"83302118","full_name":"pengux/cruder","owner":"pengux","description":"Generate code for CRUD functions from a Go struct","archived":false,"fork":false,"pushed_at":"2018-08-12T12:31:51.000Z","size":44,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-31T07:11:11.116Z","etag":null,"topics":["code-generation","crud-functionality","golang"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pengux.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}},"created_at":"2017-02-27T11:18:34.000Z","updated_at":"2025-02-23T17:10:16.000Z","dependencies_parsed_at":"2022-09-07T05:31:05.426Z","dependency_job_id":null,"html_url":"https://github.com/pengux/cruder","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pengux%2Fcruder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pengux%2Fcruder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pengux%2Fcruder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pengux%2Fcruder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pengux","download_url":"https://codeload.github.com/pengux/cruder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252824787,"owners_count":21809839,"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":["code-generation","crud-functionality","golang"],"created_at":"2024-10-23T11:24:51.207Z","updated_at":"2025-05-07T06:20:31.084Z","avatar_url":"https://github.com/pengux.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cruder\nGenerate code for CRUD functions from a Go struct\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/pengux/cruder)](https://goreportcard.com/report/github.com/pengux/cruder)\n\n## Usage\n```\ncruder is a tool to generate code for Create, Read, Update, Delete functions\nfrom a Go struct. It supports multiple generators which currently are:\n\nFunctions that can be generated are:\n- Create: Adds an entry\n- Read: Gets an entry using an ID\n- List: Gets multiple entries\n- Update: Updates an entry\n- Delete: Deletes an entry using an ID\n\nUsage:\n  cruder [command]\n\nAvailable Commands:\n  help        Help about any command\n  pg          Generates CRUD methods for Postgresql, uses the lib/pg package\n\nFlags:\n      --fn stringArray           CRUD functions to generate, e.g. --fn \"create\" --fn \"delete\". Default to all functions (default [create,get,list,update,delete])\n  -h, --help                     help for cruder\n      --pkg string               package name for the generated code, default to the same package from input\n      --primaryfield string      the field to use as primary key. Default to 'ID' if it exists in the \u003cstruct\u003e\n      --readfield stringArray    Fields in the struct that should be used for read operations (get,list). Default to all fields except the one used for softdelete\n      --skipsuffix               Skip adding the struct name as suffix to the generated functions\n      --softdeletefield string   the field to use for softdelete (should be of type nullable datetime field). Default to 'DeletedAt' if it exists in the \u003cstruct\u003e\n      --writefield stringArray   Fields in the struct that should be used for write operations (create,update). Default to all fields\n\nUse \"cruder [command] --help\" for more information about a command.\n```\n\n### Example\n```sh\ncruder --table=foos Foo example/example.go\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpengux%2Fcruder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpengux%2Fcruder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpengux%2Fcruder/lists"}