{"id":21530710,"url":"https://github.com/manyakrus/ddl_from_protobuf","last_synced_at":"2026-05-19T00:34:32.115Z","repository":{"id":259906990,"uuid":"876673732","full_name":"ManyakRus/ddl_from_protobuf","owner":"ManyakRus","description":"Create DDL sql script from protobuf .proto file, for database create tables and columns, constraints and indexes, generated automatic.","archived":false,"fork":false,"pushed_at":"2024-12-04T07:28:22.000Z","size":4701,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-07T08:47:57.750Z","etag":null,"topics":["ddl","generator","postgres","postgresql","protobuf","script","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":"2024-10-22T11:21:40.000Z","updated_at":"2024-12-04T07:28:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"b534862f-6f7e-4fcc-a1fe-3ba8dbb30718","html_url":"https://github.com/ManyakRus/ddl_from_protobuf","commit_stats":null,"previous_names":["manyakrus/ddl_from_protobuf"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManyakRus%2Fddl_from_protobuf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManyakRus%2Fddl_from_protobuf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManyakRus%2Fddl_from_protobuf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManyakRus%2Fddl_from_protobuf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ManyakRus","download_url":"https://codeload.github.com/ManyakRus/ddl_from_protobuf/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244094266,"owners_count":20397020,"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":["ddl","generator","postgres","postgresql","protobuf","script","sql"],"created_at":"2024-11-24T02:09:50.851Z","updated_at":"2026-05-19T00:34:32.083Z","avatar_url":"https://github.com/ManyakRus.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"The ddl_from_protobuf application is designed to create a DDL .sql file from protobuf .proto files\nA text file is created with SQL query text for creating tables, etc.\nSQL text for PostgreSQL database\n\nCan create:\n- tables\n- columns\n- primary key\n- constraints\n- indexes\n\nIn .proto files, it finds all messages and enums, and creates DDL for them\n\nFor enum:\nA table is created with the fields \"id\" and \"name\", primary key and index \"id\"\nall values ​​are filled in the rows (insert)\n\nFor message:\nOnly messages that have a primary key are taken, i.e. a column with the name: \"primary_key\", \"id\", \"uid\"\nA table with the name from messaage is created.\nAll columns that are in message are created, including:\n- simple types\n- references to enum tables\n- references to message tables that have a primary key\n- for references to message tables that do not have a primary key, many separate columns are created that are in the related table.\nFor columns of links to other tables, the suffix \"_id\" is added\nTable and column names for SQL are formatted in the snake_case standard, in lowercase letters (since uppercase letters must be written in quotes)\n\n2) You can also generate the .go source code for converting from the Protobuf type to the Entities type for working with the database.\nTo do this, fill in the (.env) settings.txt file:\nNEED_CREATE_CONVERT_FILES=true\nREPOSITORY_PROTO_URL=\n\n\n\nInstallation procedure:\n1. Compile this repository\n\u003emake build\na ddl_from_protobuf file will appear in the bin folder\n\n2. Put protobuf .proto files in the bin/proto folder\n\n3. Fill in the settings in the settings.txt (or .env) file\nYou can leave them blank, the default settings will be used\n\n4. Run\n\u003eddl_from_protobuf\nA new ddl.sql file will appear in the bin/proto folder\n\nSettings:\nprimary_key_names.json - you can change the list of field names for the primary key in the file\ndatabase_types.json - a table of type correspondences in protobuf and SQL\ncolumns_every_table.sql - SQL test for adding to every table (empty)\n\nSource code in Golang.\nTested on Linux Ubuntu\nReadme from 10/31/2024\n\nMade by Aleksandr Nikitin\nhttps://github.com/ManyakRus/ddl_from_protobuf\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanyakrus%2Fddl_from_protobuf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanyakrus%2Fddl_from_protobuf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanyakrus%2Fddl_from_protobuf/lists"}