Skip to content

Commit

Permalink
Merge pull request #26 from borkdominik/pre
Browse files Browse the repository at this point in the history
Final changes for Release
  • Loading branch information
plglaser authored Aug 11, 2022
2 parents 684557c + fc8c660 commit 40e3256
Show file tree
Hide file tree
Showing 6 changed files with 126 additions and 94 deletions.
97 changes: 36 additions & 61 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@

<!-- DESCRIPTION -->
<p align="center">
<b>ER modeling tool for VS Code supporting hybrid, textual- and graphical editing, multiple notations, and SQL code generation!</b></br>
<sub><a href="https://marketplace.visualstudio.com/items?itemName=BIGModelingTools.erdiagram">➜ Download for VS Code</a><sub>
<b>Open-source ER modeling tool for VS Code supporting hybrid, textual- and graphical editing, multiple notations, and SQL code generation!</b></br>
<sub><a href="https://marketplace.visualstudio.com/items?itemName=BIGModelingTools.erdiagram">➜ Download the VS Code Extension</a><sub>
</p>

<!-- DEMO -->
<p align="center">
<img src="https://raw.githubusercontent.com/borkdominik/bigER/main/docs/img/tool-screenshot.png" alt="Demo" width="800" />
<img src="https://raw.githubusercontent.com/borkdominik/bigER/main/docs/img/demo.gif" alt="Demo" width="800" />
</p>

<!-- FEATURES -->
**Main features:**
- 📝 **Textual Language** for ER modeling with *rich-text editing* support through the [Language Server Protocol (LSP)](https://microsoft.github.io/language-server-protocol/).
- 📊 **Diagram View** that is *fully synchronized* with the model in the textual editor and includes *automatic layout* of elements, *multi-notation support* and a *toolbar* for modifying the diagram representation or underlying model.
- 🖨️ **Code Generation** for *generating SQL tables* from the specified ER model and integrate with existing databases.
- **📝 Textual Language** for the specification of ER models in the textual editor. Assistive *validation* and *rich-text editing* support, enabled with the [Language Server Protocol](https://microsoft.github.io/language-server-protocol/), allows to quickly get familiar with the available language constructs.
- 📊 **Diagram View** that is fully synchronized with the textual model and automatically updates on changes. Also offers an interactive toolbar with *graphical editing actions*, *layout mechanisms*, and *multi-notation support*.
- 🖨️ **Code Generation** to *generate SQL tables* out of the specified ER models and integrate with existing databases.

---

Expand All @@ -48,84 +48,59 @@

## About the Project

The tool uses a language server for the ER modeling language which communicates its language features through the [Language Server Protocol (LSP)](https://microsoft.github.io/language-server-protocol/). This makes bigER highly reusable, increases perfomance and simplifies implementation for other editors that also use the LSP.
Entity-Relationship (ER) modeling is the de-facto standard for data modeling, offering powerful concepts to visualize data in (relational) databases. Various tools for ER modeling are available, however, often they are inflexible, proprietary, or constrained to specific platforms.

The language and editor features are realized with the [Xtext](https://www.eclipse.org/Xtext/) language workbench, while [Sprotty](https://github.com/eclipse/sprotty) with a [Sprotty-enhanced Graphical Language Server](https://github.com/eclipse/sprotty-server) is used for rendering the diagrams. All of this is integrated with VS Code by implementing a [Sprotty VS Code Extension](https://github.com/eclipse/sprotty-vscode).
The bigER tool aims to provide an open-source and modern solution for ER by making use of the [Language Server Protocol (LSP)](https://microsoft.github.io/language-server-protocol/). The protocol is used for communicating textual language features to the VS Code client and is further extended to also support graphical editing, making it one of the first *hybrid modeling tools* based on the LSP.

**Built With**

<!-- USAGE -->
## Usage
The Java-based language server is realized with [Xtext](https://www.eclipse.org/Xtext/) and [Xtend](https://www.eclipse.org/xtend/), while the diagramming capabilities are based on [Sprotty](https://github.com/eclipse/sprotty). Sprotty enhances the server with graphical language features (using [`sprotty-server`](https://github.com/eclipse/sprotty-server)) and integrates with VS Code through [Sprotty VS Code Extensions](https://github.com/eclipse/sprotty-vscode).

In the following we describe the basic usage of the tool based on a simple example. See the documentation in the [bigER Wiki](https://github.com/borkdominik/bigER/wiki/) or check out other [Examples](https://github.com/borkdominik/bigER/tree/main/examples) to learn more.

**Installation**

Download and install the extension from the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=BIGModelingTools.erdiagram). For more information regarding installation see the [Extension Marketplace](https://code.visualstudio.com/docs/editor/extension-marketplace) guide for VS Code.
<!-- USAGE -->
## Usage

Download and install the extension from the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=BIGModelingTools.erdiagram). Information regarding installation, can be found in the [Extension Marketplace Guide](https://code.visualstudio.com/docs/editor/extension-marketplace) of VS Code.

**Textual Model**
**New ER Model**

Once the extension is installed a new ER model can be created. Models are created in `.erd` files, refer to the example below to specify a basic model consisting of two entities and a *one-to-many* relationship.
After installation, ER models can be created in `.erd` files. Use the `New Sample ER Model` command in the Command Palette or refer to the example below to get started with a basic model.

```java
// File: example.erd
erdiagram Example
generate=sql
erdiagram Model

entity Customer {
id: int key
name: string
}
notation=default
generate=off

entity Order {
order_number: int key
price: double
entity A {
id key
}

relationship Places {
Customer[1] -> Order[N]
entity B {
id key
}
relationship Rel {
A -> B
}
```

**Diagram**

Open the diagram through the button in the editor or by right-clicking on the `.erd` file.

<img src="https://github.com/borkdominik/bigER/blob/main/docs/img/basic-example.png" width="600"/>
**Open the Diagram**

**Code Generator**
The corresponding *ER Diagram* can be opened by using the button in the editor toolbar, the context menu when right-clicking the file, or by pressing <kbd>Ctrl</kbd>/<kbd>⌘</kbd> + <kbd>O</kbd>.

Code generation is controlled through the `generate` keyword. Since we specified the `sql` value, the SQL code generator is enabled and the generated code contained in the newly created `src-gen/Example.sql` file.
**Learn More**

```sql
CREATE TABLE Customer(
id int,
name string,
PRIMARY KEY (id)
);

CREATE TABLE Order(
price double,
order_number int,
PRIMARY KEY (order_number)
);

CREATE TABLE Places(
id int references Customer(id),
order_number int references Order(order_number),
PRIMARY KEY (id, order_number)
);
```
For more information on how to use the tool, see the [bigER Wiki](https://github.com/borkdominik/bigER/wiki/).

<!-- BUILD INSTRUCTIONS -->
## Build Instructions

**Prerequisites**

- [Node.js](https://nodejs.org/en/) runtime
- [yarn](https://yarnpkg.com/) package manager
- [Java](http://jdk.java.net/) (11+)
- [VS Code](https://code.visualstudio.com/) (v1.50+)
- [Node.js](https://nodejs.org/en/) 16 or above
- [Java](http://jdk.java.net/) JDK 11 or above
- [VS Code](https://code.visualstudio.com/) v1.46 or above
- [yarn](https://yarnpkg.com/)


Download or clone the repository and in the root folder of the project execute the following commands:
Expand All @@ -136,7 +111,7 @@ yarn --cwd webview
yarn --cwd extension
```

After building the project, the extension can be run in VS Code by pressing <kbd>F5</kbd> or through <kbd>Run -> Start Debugging</kbd> from the menu
After building the project, the extension can be run in VS Code by pressing <kbd>F5</kbd> or selecting `Run Start Debugging` from the menu.


<!-- TODO: Add to Wiki
Expand All @@ -154,9 +129,9 @@ Project issues are managed on GitHub, see [Open Issues](https://github.com/borkd

Contributions to the project are always welcome! See the [Contribution Guidelines](https://github.com/borkdominik/bigER/blob/main/docs/CONTRIBUTING.md) for more information.

**Contributers**:
**Contributors**:
- [Philipp-Lorenz Glaser](https://github.com/plglaser) (main developer)
- [Georg Hammerschmied](https://github.com/SchmiedHammer) (multi-notation support)
- [Georg Hammerschmied](https://github.com/SchmiedHammer) (multi-notation support)
- [Hnatiuk Vladyslav](https://github.com/Aksem) (improved edge router)
- [Dominik Bork](https://github.com/borkdominik)

Expand Down
Binary file added docs/img/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions extension/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 borkdominik

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
77 changes: 54 additions & 23 deletions extension/README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,76 @@
# bigER VS Code Extension
# bigER - VS Code Extension

<!-- BADGES -->
<p align="left">
<a href="https://marketplace.visualstudio.com/items?itemName=BIGModelingTools.erdiagram">
<img alt="Visual Studio Marketplace Installs" src="https://img.shields.io/visual-studio-marketplace/i/BIGModelingTools.erdiagram?color=blue" height="20"/>
</a>
<a href="https://marketplace.visualstudio.com/items?itemName=BIGModelingTools.erdiagram">
<img alt="Visual Studio Marketplace Version" src="https://img.shields.io/visual-studio-marketplace/v/BIGModelingTools.erdiagram" height="20"/>
</a>
<a href="https://github.com/borkdominik/bigER">
<img alt="GitHub Build" src="https://img.shields.io/github/workflow/status/borkdominik/bigER/Build" height="20"/>
</a>
<a href="https://github.com/borkdominik/bigER">
<img alt="GitHub Stars" src="https://img.shields.io/github/stars/borkdominik/bigER?style=social" height="20">
</a>
</p>

Entity-Relationship (ER) modeling tool supporting hybrid, textual- and graphical editing, multiple notations, and SQL code generation.
<!-- DESCRIPTION -->
> [Open-source](https://github.com/borkdominik/bigER) **ER Modeling Tool** for [Visual Studio Code](https://code.visualstudio.com/) supporting *hybrid textual- and graphical editing*, *multiple notations*, and *SQL code generation*.

<!-- DEMO -->
<p align="center">
<img src="https://raw.githubusercontent.com/borkdominik/bigER/main/docs/img/tool-screenshot.png" alt="Demo" width="800" />
<img src="https://raw.githubusercontent.com/borkdominik/bigER/main/docs/img/demo.gif" alt="Demo" width="800" />
</p>

**Features:**

- 📝 **Textual Language** for ER modeling with rich-text editing support through the [Language Server Protocol](https://microsoft.github.io/language-server-protocol/).
- 📊 **Diagram View** that is fully synchronized with the textual model, including automatic layout, multi-notation support and an interactive toolbar.
- 🖨️ **Code Generation** for generating SQL tables from the specified ER model and integrate with existing databases.
<!-- FEATURES -->
## Features

- **📝 Textual Language** for the specification of ER models in the textual editor. Assistive *validation* and *rich-text editing* support, enabled with the [Language Server Protocol](https://microsoft.github.io/language-server-protocol/), allows to quickly get familiar with the available language constructs.
- 📊 **Diagram View** that is fully synchronized with the textual model and automatically updates on changes. Also offers an interactive toolbar with *graphical editing actions*, *layout mechanisms*, and *multi-notation support*.
- 🖨️ **Code Generation** to *generate SQL tables* out of the specified ER models and integrate with existing databases.


<!-- GETTING STARTED -->
## Getting Started

After installation, new ER models can be created in `.erd` files. Refer to the example below to specify a basic ER Model consisting of two entities and a one-to-many relationship.
**Requirements**

- VS Code 1.46.0 or above
- Java 11 or above

**New ER Model**

After installation, ER models can be created in `.erd` files. Use the `New Sample ER Model` command in the Command Palette or refer to the example below to get started with a basic model.

```java
erdiagram Example
generate=sql
erdiagram Model

entity Customer {
id: int key
name: string
}
notation=default
generate=off

entity Order {
order_number: int key
price: double
entity A {
id key
}

relationship Places {
Customer[1] -> Order[N]
entity B {
id key
}
relationship Rel {
A -> B
}
```

The diagram can be opened through the button in the editor or right-clicking on the .erd file. See the file at `/src-gen/Example.sql` for the generated SQL code.
**Open the Diagram**

The corresponding *ER Diagram* can be opened by using the button in the editor toolbar, the context menu when right-clicking the file, or by pressing <kbd>Ctrl</kbd>/<kbd>⌘</kbd> + <kbd>O</kbd>.


<!-- LEARN MORE -->
## Learn More

## Learn more
For more information on how to use the tool, see the [bigER Wiki](https://github.com/borkdominik/bigER/wiki/).

See the [GitHub Repository](https://github.com/borkdominik/bigER) and documentation in the [bigER Wiki](https://github.com/borkdominik/bigER/wiki/) to learn more.
Also check out the [GitHub repository](https://github.com/borkdominik/bigER) and available [examples](https://github.com/borkdominik/bigER/tree/main/examples).
23 changes: 14 additions & 9 deletions extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,25 @@
"categories": [
"Programming Languages",
"Visualization",
"Snippets"
"Education"
],
"keywords": [
"Entity Relationship",
"ER Diagram",
"Modeling Tool",
"Data Modeling",
"Diagram",
"Language Server",
"ERD"
"DSL"
],
"repository": {
"type": "git",
"url": "https://github.com/borkdominik/bigER"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/borkdominik/bigER/issues"
},
"license": "SEE LICENSE IN LICENSE",
"preview": false,
"engines": {
"vscode": "^1.46.0"
},
Expand Down Expand Up @@ -85,27 +90,27 @@
},
{
"command": "erdiagram.diagram.center",
"title": "Center selection",
"title": "Center Selection",
"category": "bigER"
},
{
"command": "erdiagram.diagram.export",
"title": "Export diagram to SVG",
"title": "Export Diagram to SVG",
"category": "bigER"
},
{
"command": "erdiagram.diagram.delete",
"title": "Delete selected element",
"title": "Delete Selected Element",
"category": "bigER"
},
{
"command": "erdiagram.model.newEmpty",
"title": "New empty ER Model",
"title": "New Empty ER Model",
"category": "bigER"
},
{
"command": "erdiagram.model.newSample",
"title": "New sample ER Model",
"title": "New Sample ER Model",
"category": "bigER"
}
],
Expand Down
2 changes: 1 addition & 1 deletion webview/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "erdiagram-sprotty-webview",
"version": "0.1.0",
"description": "Webview package for the bigER Modeling Tool",
"description": "Webview package of the bigER Modeling Tool",
"author": {
"name": "Philipp-Lorenz Glaser"
},
Expand Down

0 comments on commit 40e3256

Please sign in to comment.