{"id":13664959,"url":"https://github.com/edrdo/dbdia","last_synced_at":"2026-01-16T06:34:34.340Z","repository":{"id":206395688,"uuid":"255206323","full_name":"edrdo/dbdia","owner":"edrdo","description":"Diagram generator for Entity-Relationship models and relational schemas.","archived":false,"fork":false,"pushed_at":"2023-05-09T18:47:51.000Z","size":186,"stargazers_count":26,"open_issues_count":1,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-10T22:40:36.818Z","etag":null,"topics":["antlr","colab","database","diagram","er","graphviz","java","python","schema"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/edrdo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-04-13T01:45:58.000Z","updated_at":"2024-10-08T16:50:33.000Z","dependencies_parsed_at":"2023-11-09T12:59:52.533Z","dependency_job_id":"1f280099-959f-4b5a-a9d0-a1505f62cb2a","html_url":"https://github.com/edrdo/dbdia","commit_stats":null,"previous_names":["edrdo/dbdia"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edrdo%2Fdbdia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edrdo%2Fdbdia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edrdo%2Fdbdia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edrdo%2Fdbdia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edrdo","download_url":"https://codeload.github.com/edrdo/dbdia/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250922127,"owners_count":21508279,"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":["antlr","colab","database","diagram","er","graphviz","java","python","schema"],"created_at":"2024-08-02T05:03:13.204Z","updated_at":"2026-01-16T06:34:34.328Z","avatar_url":"https://github.com/edrdo.png","language":"Java","funding_links":[],"categories":["Java"],"sub_categories":[],"readme":"\n[![License: Apache 2.0](https://img.shields.io/github/license/edrdo/dbdia)](https://github.com/edrdo/dbdia/blob/master/LICENSE.txt)\n[![GitHub release](https://img.shields.io/github/v/release/edrdo/dbdia)](https://github.com/edrdo/dbdia/releases)\n[![CI](https://github.com/edrdo/dbdia/actions/workflows/ci.yml/badge.svg)](https://github.com/edrdo/dbdia/actions/workflows/ci.yml)\n\n# dbdia\n\n__Author: [Eduardo R. B. Marques](https://github.com/edrdo)__\n\n__dbdia__ is open-source software under the terms of the __[Apache License 2.0](https://github.com/edrdo/dbdia/blob/master/LICENSE.txt)__.\n\n## Summary\n\n__dbdia__ is a diagram generator for database __Entity-Relationship (ER)__ models\nand __relational schemas__. \n\nDiagrams are expressed using a domain-specific language\nthat is translated to image format (PNG, PDF, SVG, ...) using the __dot__ tool from __[Graphviz](https://graphviz.org)__ . \n\nThe visual syntax employed by __dbdia__ in ER and relational diagrams  mostly follows the conventions of the __[Fundamentals of Database Systems, 7th edition](https://www.pearson.com/us/higher-education/program/Elmasri-Fundamentals-of-Database-Systems-7th-Edition/PGM189052.html)__  textbook by Ramez Elmasri and Shamkant B. Navathe.\n\n## Run dbdia online using a Colab notebook\n\n[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/edrdo/dbdia/blob/master/src/main/colab/dbdia.ipynb)\n\n## DSL used for ER models and relational schemas\n\nCheck [__here__](/DSL.md) for a description of the DSL used by dbdia.\n\n## Examples\n\nCheck the __examples__ directory in this repository or in the dbdia release archive.\nThe examples can be also be tested directly in the Colab notebook. \n\n![Example ER model](/examples/SocialNetwork2_er.svg)\n![Example Schema](/examples/SocialNetwork2_sch.svg)\n\n### Entity definitions\n\n```\nEntityName \n(\n  _ KeyField _,\n  OptionalField ?,\n  . DerivedField ., \n  { MultiValueField },\n  CompositeField ( SubField1, { SubField2 }, SubField3 ?, . SubField4 .),\n  { ComplexField(SubField1, SubField2(SubField21, SubField22)) } \n)\n```\n![Entity example](/examples/Entity.svg)\n\n### Relationship definitions\n\n```\nEntityA ( ) // with no attributes (just for convenience)\nEntityB ( ) // you can in any case ommit attributes in diagrams\nEntityC ( ) // using the 'rel' diagram type generation\n\n// Relationship: Rel1 \n// Entities involved: EntityA and EntityB\n// Cardinality: 1 to N\n// Participation: partial for EntityA, total for EntityB\n// Relationship attributes: none\n\nEntityA --- 1 --- \u003c Rel1 \u003e === N === EntityB\n\n// Relationship: Rel2\n// Entities involved: EntityA and EntityB\n// Cardinality: M to N\n// Participation: partial for both entities\n// Relationship attributes: none\n\nEntityA --- M --- \u003c Rel2 \u003e --- N --- EntityB\n\n// Relationship: Rel3\n// Entities involved: EntityA and EntityC\n// Cardinality: 1 to 1\n// Participation: total for EntityA, partial for EntityC\n// Relationship attributes: Rattr1, { RAttr2 } as shown.\n\nEntityA === 1 === \u003c Rel3( RAttr1, { RAttr2 } )\u003e --- 1 --- EntityC\n```\n![Relationship example](/examples/Relationships.svg)\n\n### Relational schema definitions\n\n```\ntable A\n(\n  _ PrimaryKey _,\n  PlainField, \n  OptionalField ?, \n  ForeignKey1 --\u003e A.PrimaryKey,\n  ForeignKey2 --\u003e B.PrimaryKey\n)\n\n// Type info is optional - this table has type annotations per each field\n// Any identifier is accepted for the type designation.\ntable B\n(\n  _ PrimaryKey _ int, \n  PlainField varchar\n) \n```\n![Schema example](/examples/Schema.svg)\n\n\n## Download, install, and use\n\n### Dependencies\n\n- A Java runtime environment, version 8 or higher.\n- [Graphviz](https://graphviz.org)\n\nThe following should work with recent versions of Ubuntu:\n\n```\nsudo apt install default-jre\nsudo apt intall graphviz\n```\n\n### Install\n\n- Download the ZIP of the latest release [here](https://github.com/edrdo/dbdia/releases).\n- Unzip the release archive to some folder __\u003cDBDIA_PATH\u003e__\n- The __dbdia__ script (for Linux/MacOS/POSIX) and the __dbdia.bat__\nvariant for Windows can be found in __\u003cDBDIA_PATH\u003e/bin__. \nIt may be convenient to add __\u003cDBDIA_PATH\u003e/bin__ to your __PATH__ environment.\n\n### Usage\n\n```\ndbdia [-option1=value1 ... -optionk=valuek] \u003ctypeOfDiagram\u003e inputFile outputFile\n```\n\n__Diagram types__\n\n- `er`: full ER diagram including entities, entity attributes, and relationships;\n- `ent`: ER diagram including entities and their attributes only;\n- `rel`: ER diagram excluding entity attributes;\n- `sch`: relational schema diagram.\n\n__Options__\n\n- Type `dbdia help` for a list of options.\n\n## Compiling from scratch\n\nRequirements:\n\n- Java JDK (OracleJDK or OpenJDK) for Java 8 or higher\n- Maven 3.x \n\nCommands:\n\n```\ngit clone git@github.com:edrdo/dbdia.git\ncd dbdia\nmvn package \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedrdo%2Fdbdia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedrdo%2Fdbdia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedrdo%2Fdbdia/lists"}