{"id":22711729,"url":"https://github.com/manyakrus/crud_generator","last_synced_at":"2025-04-13T16:13:12.561Z","repository":{"id":197015374,"uuid":"696339850","full_name":"ManyakRus/crud_generator","owner":"ManyakRus","description":"Automatic generator complete microservice source code with CRUD and Model and GRPC . From Postgres SQL database. ","archived":false,"fork":false,"pushed_at":"2025-04-03T10:15:19.000Z","size":49638,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-13T16:13:05.245Z","etag":null,"topics":["codegenerator","crud","database","generator","grpc","nrpc","postgres","sql"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ManyakRus.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-09-25T14:54:18.000Z","updated_at":"2025-04-03T10:15:22.000Z","dependencies_parsed_at":"2023-09-28T17:06:19.129Z","dependency_job_id":"7c219989-df62-4592-8520-06f1269d9b68","html_url":"https://github.com/ManyakRus/crud_generator","commit_stats":null,"previous_names":["manyakrus/crud_generator"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManyakRus%2Fcrud_generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManyakRus%2Fcrud_generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManyakRus%2Fcrud_generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManyakRus%2Fcrud_generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ManyakRus","download_url":"https://codeload.github.com/ManyakRus/crud_generator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248741193,"owners_count":21154255,"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":["codegenerator","crud","database","generator","grpc","nrpc","postgres","sql"],"created_at":"2024-12-10T13:07:54.360Z","updated_at":"2025-04-13T16:13:12.536Z","avatar_url":"https://github.com/ManyakRus.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"The crud_generator application is designed to automatically generate source code files\nin golang language to perform CRUD operations.\nA completely ready-made microservice is created that can be launched immediately.\n\nFor each table in the Postgres SQL database, functions will be automatic created to perform crud operations:\n- Create()\n- Read()\n- Update()\n- Delete() (or Delete() + Restore(), if there is an is_deleted field)\n- Save() - creating a new record when ID is empty, or updating a record when ID is not empty\n- ReadFromCache() - reading from cache or database\n- Update_ColumnName() - changing only one column with the name ColumnName,\nseparate function for each column of each table\n- UpdateManyFields() - change several columns listed in an array\n- FindBy_ColumnName() - search for a record by one or more columns (if you fill in the findby_functions.json file)\n- FindMassBy_ColumnName() - search for multiple records by one or more columns (if you fill in the findmassby_functions.json file)\n- ReadAll() - returns all table records, except those marked for deletion is_deleted=true (if you fill in the readall_functions.json file)\n\nfiles are generated:\n1. table - struct structure with all fields from the database, and gorm + json annotations\nTables with fields in the database must be created manually in advance.\nThe code generator will find all the tables and their fields in the database and use them.\n\n2. entities - struct structure, including table, with crud operations functions\n\n3. crud - files for performing crud operations, exchange with the database,\nas well as files with tests\n\n4. grpc server - files for performing crud operations over the network, using the GRPC protocol,\nas well as files with tests\n\n5. grpc client - client files for using GRPC by third-party services,\nas well as files with tests\n\n6. nrpc server - files for performing crud operations over the network, using the NRPC protocol (via the NATS message broker),\nas well as files with tests\n\n7. nrpc client - client files for use by NRPC third-party services,\nas well as files with tests\n\n8. crud_starter - a file with functions for switching to the desired protocol db or grpc or nrpc\n\n9. main.go and other .go files\n\n10. Makefile - script launch configuration file\n\n11. .env - file for filling in the microservice configuration (database connection parameters, etc.)\n\n\nCode templates are stored in the bin/templates folder.\nThe code template is a .go file copied from the real project -\nso it’s easy to make a template (change it to your own) - just copy your file.\nThe code generator replaces part of the code in the template with another code:\n- name of the database table\n- model name\n- adding and removing imports\n\nInstallation procedure:\n1. Compile this repository\n\u003emake build\n\u003e\nthe crud_generator file will appear in the bin folder\n\n2. Fill in the settings in the file bin/templates/configs_/settings.txt\n- connections to your database\n- the name of your new service\n- URL of your new service\n- and etc.\n\n3. Tables in the database must be created in advance, manually.\n\n4. Launch crud_generator\nA new folder with the name of your service will appear in the bin folder,\nwith subfolders and finished files inside.\n\n5. Fill in the configuration parameters in the .env file\nStart microservice:\n\u003emake run\n\u003e\n\nFeatures:\n1. Tables with a prefix in the name or comments = \"DELETED\" or \"УДАЛИТЬ\" are ignored\n2. Columns with a prefix in the name or comments = \"DELETED\" or \"УДАЛИТЬ\" are ignored\n\nP.S.\nI generated myself 420,000 lines of code, from 70 tables in the database, for my service.\n\n\nSource code in Golang language.\nTested on Linux Ubuntu\nReadme from 11/14/2023\n\n![modules](https://github.com/ManyakRus/crud_generator/assets/30662875/304a41fa-a84c-40c4-9566-e5d65a381175)\n\n\nMade by Alexander Nikitin\nhttps://github.com/ManyakRus/crud_generator\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanyakrus%2Fcrud_generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanyakrus%2Fcrud_generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanyakrus%2Fcrud_generator/lists"}