{"id":19876494,"url":"https://github.com/namgold/dbdiagram2json","last_synced_at":"2026-05-12T11:38:11.801Z","repository":{"id":131106548,"uuid":"217254961","full_name":"namgold/dbdiagram2json","owner":"namgold","description":null,"archived":false,"fork":false,"pushed_at":"2019-11-14T08:50:53.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-11T17:22:51.964Z","etag":null,"topics":["convert","dbdiagram","export","json","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/namgold.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-24T08:54:25.000Z","updated_at":"2019-11-14T08:50:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"854fa3fc-3fab-4304-889a-f2320502d64f","html_url":"https://github.com/namgold/dbdiagram2json","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namgold%2Fdbdiagram2json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namgold%2Fdbdiagram2json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namgold%2Fdbdiagram2json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namgold%2Fdbdiagram2json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/namgold","download_url":"https://codeload.github.com/namgold/dbdiagram2json/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241304295,"owners_count":19941101,"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":["convert","dbdiagram","export","json","python"],"created_at":"2024-11-12T16:33:13.197Z","updated_at":"2026-05-12T11:38:11.742Z","avatar_url":"https://github.com/namgold.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dbdiagram2json\n## Description\nThis tool is used for export [https://dbdiagram.io](https://dbdiagram.io/) diagrams to JSON format.\n## Usage\n\n 1. Copy diagrams from [https://dbdiagram.io](https://dbdiagram.io/) to *dbdiagram.input* file place at the root of project.\n 2.  Run command:\n   \u003e python main.py\n 3. Output has been generated to *dbdiagram.json*\n### Example\nIn file  \u003ca href = \"https://dbdiagram.io/d/5dc03424edf08a25543d7cf8\"\u003e**`dbdiagram.input`**\u003c/a\u003e:\n```\nTable Customer as cus {\n  ID                CHAR(10)        [primary key, increment]\n  NAME              NVARCHAR(100)   [not null]\n  DATE_OF_BIRTH     DATE            [null]\n  ACTIVE            CHAR(1)         [not null, default: \"F\"]\n}\n\nTable Order as ord {\n    ID              CHAR(10)        [primary key]\n    CUS_ID          CHAR(10)        [ref: \u003e cus.ID, not null]\n    ITEM_ID         CHAR(10)        [ref: \u003e Item.ID, not null]\n}\n\nTable Item {\n  ID                CHAR(10)        [primary key, increment]\n  NAME              NVARCHAR(100)   [not null]\n}\n```\n\u003cimg src=\"./doc/dbdiagram.png\" width=\"500\"/\u003e\n\nWill generate folowing **`dbdiagram.json`**:\n```json\n{\n    \"Table\": [\n        {\n            \"name\": \"Customer\",\n            \"shortName\": \"cus\",\n            \"option\": null,\n            \"fields\": [\n                {\n                    \"name\": \"ID\",\n                    \"type\": \"CHAR(10)\",\n                    \"options\": {\n                        \"primary key\": true,\n                        \"increment\": true\n                    }\n                },\n                {\n                    \"name\": \"NAME\",\n                    \"type\": \"NVARCHAR(100)\",\n                    \"options\": {\n                        \"nullable\": false\n                    }\n                },\n                {\n                    \"name\": \"DATE_OF_BIRTH\",\n                    \"type\": \"DATE\",\n                    \"options\": {\n                        \"nullable\": true\n                    }\n                },\n                {\n                    \"name\": \"ACTIVE\",\n                    \"type\": \"CHAR(1)\",\n                    \"options\": {\n                        \"nullable\": false,\n                        \"default\": \"F\"\n                    }\n                }\n            ]\n        },\n        {\n            \"name\": \"Order\",\n            \"shortName\": \"ord\",\n            \"option\": null,\n            \"fields\": [\n                {\n                    \"name\": \"ID\",\n                    \"type\": \"CHAR(10)\",\n                    \"options\": {\n                        \"primary key\": true\n                    }\n                },\n                {\n                    \"name\": \"CUS_ID\",\n                    \"type\": \"CHAR(10)\",\n                    \"options\": {\n                        \"ref\": {\n                            \"op\": \"\u003e\",\n                            \"table\": \"cus\",\n                            \"column\": \"ID\"\n                        },\n                        \"nullable\": false\n                    }\n                },\n                {\n                    \"name\": \"ITEM_ID\",\n                    \"type\": \"CHAR(10)\",\n                    \"options\": {\n                        \"ref\": {\n                            \"op\": \"\u003e\",\n                            \"table\": \"Item\",\n                            \"column\": \"ID\"\n                        },\n                        \"nullable\": false\n                    }\n                }\n            ]\n        },\n        {\n            \"name\": \"Item\",\n            \"shortName\": null,\n            \"option\": null,\n            \"fields\": [\n                {\n                    \"name\": \"ID\",\n                    \"type\": \"CHAR(10)\",\n                    \"options\": {\n                        \"primary key\": true,\n                        \"increment\": true\n                    }\n                },\n                {\n                    \"name\": \"NAME\",\n                    \"type\": \"NVARCHAR(100)\",\n                    \"options\": {\n                        \"nullable\": false\n                    }\n                }\n            ]\n        }\n    ]\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnamgold%2Fdbdiagram2json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnamgold%2Fdbdiagram2json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnamgold%2Fdbdiagram2json/lists"}