{"id":15673479,"url":"https://github.com/jwebcoder/plantuml2mysql","last_synced_at":"2025-07-13T13:34:45.859Z","repository":{"id":40769506,"uuid":"261606381","full_name":"JWebCoder/plantuml2mysql","owner":"JWebCoder","description":"Parse plantuml class diagrams into mysql","archived":false,"fork":false,"pushed_at":"2023-01-06T05:07:04.000Z","size":663,"stargazers_count":7,"open_issues_count":12,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-08T03:16:10.209Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/JWebCoder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"jwebcoder","patreon":"jwebcoder","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-05-05T23:36:22.000Z","updated_at":"2024-02-20T08:55:07.000Z","dependencies_parsed_at":"2023-02-05T09:31:52.410Z","dependency_job_id":null,"html_url":"https://github.com/JWebCoder/plantuml2mysql","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JWebCoder%2Fplantuml2mysql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JWebCoder%2Fplantuml2mysql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JWebCoder%2Fplantuml2mysql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JWebCoder%2Fplantuml2mysql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JWebCoder","download_url":"https://codeload.github.com/JWebCoder/plantuml2mysql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252990004,"owners_count":21836668,"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":[],"created_at":"2024-10-03T15:40:53.477Z","updated_at":"2025-05-08T03:16:15.831Z","avatar_url":"https://github.com/JWebCoder.png","language":"TypeScript","funding_links":["https://github.com/sponsors/jwebcoder","https://patreon.com/jwebcoder"],"categories":[],"sub_categories":[],"readme":"# plantuml2mysql\nParse plantuml class diagrams into mysql\n\n## Installation\n\nnpm i plantuml2mysql\n\n## Usage\n\n### Terminal\n\n`npx plantuml2mysql database.md database.sql`\n\n### By code\n\n```typescript\nimport plantuml2mysql from 'plantuml2mysql'\nimport fs from 'fs'\nimport path from 'path'\n\nplantuml2mysql(path.join(__dirname, './database.md')).then(\n  (result) =\u003e {\n    fs.writeFileSync('./database.sql', result)\n  }\n)\n\n```\n\n## Plantuml Class example\n\n```\n@startuml database diagram\n  class Cart {\n    #id INT AUTO_INCREMENT\n    -userId UNIQUE REF(user.id)\n    timestamp TIMESTAMP\n  }\n\n  class CartIngredientList {\n    +cartId REF(cart.id)\n    +ingredientId REF(ingredient.id)\n    ..\n    quantity TINYINT NN\n    later BOOLEAN DEFAULT(true)\n    checked BOOLEAN NN DEFAULT(false)\n  }\n\n  class Ingredient {\n    #id INT AUTO_INCREMENT\n    ..\n    name VARCHAR(70) UNIQUE\n  }\n  \n  class User {\n    #id INT AUTO_INCREMENT\n    -roleId NN DEFAULT(0) REF(role.id)\n    ..\n    name VARCHAR(70) NN DEFAULT(Joao)\n    age SMALLINT\n    dateOfBirth DATE\n    email VARCHAR(320) NN UNIQUE\n    gender TINYINT\n    floatField FLOAT\n    doubleField DOUBLE\n  }\n  \n  class Role {\n    #id INT AUTO_INCREMENT\n    ..\n    name VARCHAR(20) NN\n  }\n\n  class NoPrimaryKeyTable {\n    parameter INT\n  }\n  \n  User \"0..*\" o--o \"1\" Role\n\n  User \"1\" *--o \"0..1\" Cart\n\n  Cart \"0..*\" o--o \"1..*\" Ingredient\n  (Cart, Ingredient) .. CartIngredientList\n\n@enduml\n```\n\n![diagram](./assets/dbdiagram.png)\n\n## Column structure\n\n**Example columns**\n- \\#id INT AUTO_INCREMENT\n- checked BOOLEAN NN DEFAULT(false)\n\n**Structure**\n1. Key type (#, -, +), this is optional\n2. Column name\n3. column data type\n4. any other properties\n\n## Detailed metadata\n\n|meta data| description | example |\n|-|-|-|\n| # | Primary key | #id |\n| - | Foreign key | -userId |\n| + | Primary key and Foreign key, for relation tables | +cartId |\n| AUTO_INCREMENT | auto increment field |\n| UNIQUE| adds a unique index to the field |\n| REF(table.column) | sets the foreign key reference | REF(user.id) |\n| NN | Not Null field |\n| DEFAULT(value) | sets the default value | DEFAULT(10) |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwebcoder%2Fplantuml2mysql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjwebcoder%2Fplantuml2mysql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwebcoder%2Fplantuml2mysql/lists"}