Skip to content

Commit e3c5f21

Browse files
authored
Merge pull request #28 from badsyntax/er-diagram
Add ER Diagram feature using mermaid
2 parents 128ac43 + fdbb7b7 commit e3c5f21

File tree

79 files changed

+11966
-1160
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+11966
-1160
lines changed

.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@
2222
"no-throw-literal": "warn",
2323
"semi": "off"
2424
},
25-
"ignorePatterns": ["out", "dist", "**/*.d.ts"]
25+
"ignorePatterns": ["out", "dist", "**/*.d.ts", "*.js", "webview-ui"]
2626
}

.github/workflows/main.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,16 @@ jobs:
3434
run: npm ci
3535
- name: Lint
3636
run: npm run lint
37-
- name: Build
37+
- name: Install webview-ui NPM Packages
38+
run: npm ci
39+
working-directory: ./webview-ui
40+
- name: Lint webview-ui
41+
run: npm run lint
42+
working-directory: ./webview-ui
43+
- name: Build webview-ui
44+
run: npm run build
45+
working-directory: ./webview-ui
46+
- name: Package extension
3847
run: npm run package
3948
- name: Prepare test project
4049
run: |

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ dist
55
sample_dotnet
66
.wdio-vscode-service
77
out
8+
webview-ui

.vscode/extensions.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"dbaeumer.vscode-eslint",
44
"amodio.tsl-problem-matcher",
55
"esbenp.prettier-vscode",
6-
"streetsidesoftware.code-spell-checker"
6+
"streetsidesoftware.code-spell-checker",
7+
"Tobermory.es6-string-html"
78
]
89
}

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"request": "launch",
88
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
99
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
10-
"preLaunchTask": "${defaultBuildTask}"
10+
"preLaunchTask": "npm: compile"
1111
},
1212
{
1313
"name": "Extension Tests",

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
"entityframework",
5454
"NLCR",
5555
"Pseudoterminal",
56+
"quickpick",
5657
"richardwillis",
5758
"Testrunner",
5859
"waitfor",

.vscodeignore

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,31 @@
1-
.vscode/**
2-
.vscode-test/**
1+
**/.vscode/**
2+
**/.vscode-test/**
33
out/**
44
node_modules/**
55
src/**
6-
.gitignore
6+
**/.gitignore
77
.yarnrc
8-
webpack.config.js
8+
**/webpack.config.js
99
**/tsconfig.json
10+
**/tsconfig.node.json
1011
**/.eslintrc.json
1112
**/*.map
1213
**/*.ts
13-
.prettierrc.js
14-
.prettierignore
14+
**/.prettierrc.js
15+
**/.prettierrc.cjs
16+
**/.prettierignore
1517
.gitattributes
1618
.editorconfig
1719
.github/**
1820
images/**
1921
sample_dotnet/**
2022
.wdio-vscode-service/**
23+
24+
webview-ui/src/**
25+
webview-ui/build/index.html
26+
webview-ui/public/**
27+
webview-ui/index.html
28+
webview-ui/README.md
29+
webview-ui/package.json
30+
webview-ui/package-lock.json
31+
webview-ui/node_modules/**

README.md

Lines changed: 41 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ A VS Code extension to manage Entity Framework migrations.
66

77
<img src="./images/treeview-screenshot.png" width="460" alt="Entity Framework Migrations" />
88

9+
## Requirements
10+
11+
- [dotnet sdk](https://dotnet.microsoft.com/download)
12+
- [efcore tools](https://learn.microsoft.com/en-us/ef/core/cli/dotnet)
13+
- [Microsoft.EntityFrameworkCore.Design](https://www.nuget.org/packages/Microsoft.EntityFrameworkCore.Design) must be installed in one of the projects
14+
915
## Features
1016

1117
- List migrations by [`DbContext`](https://learn.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.dbcontext)
@@ -14,12 +20,13 @@ A VS Code extension to manage Entity Framework migrations.
1420
- Export `DbContext` as SQL script
1521
- View `DbContext` information
1622
- [Scaffold](https://learn.microsoft.com/en-us/ef/core/cli/dotnet#dotnet-ef-dbcontext-scaffold) `DbContext` & entity types
23+
- Generate ER Diagram (Requires EF Core 7+)
1724

18-
## Requirements
25+
### ER Diagram
1926

20-
- [dotnet sdk](https://dotnet.microsoft.com/download)
21-
- [efcore tools](https://learn.microsoft.com/en-us/ef/core/cli/dotnet)
22-
- [Microsoft.EntityFrameworkCore.Design](https://www.nuget.org/packages/Microsoft.EntityFrameworkCore.Design) must be installed in one of the projects
27+
A [`Mermaid`](https://mermaid.js.org/syntax/entityRelationshipDiagram.html) [`.t4`](https://learn.microsoft.com/en-us/ef/core/managing-schemas/scaffolding/templates) template will be installed into the project. You can ignore this file (by adding it to `.gitignore`), or add it to source control. The template file is used to generate the ER Diagram, feel free to customise it. If you delete it, it will be regenerated next time you generate an ER Diagram.
28+
29+
<img src="./images/er-diagram.png" width="640" alt="Entity Framework Migrations" />
2330

2431
## Extension Settings
2532

@@ -89,9 +96,7 @@ This extension contributes the following settings:
8996
"--project",
9097
"\"$project\"",
9198
"--startup-project",
92-
"\"$project\"",
93-
"--no-color",
94-
"--json"
99+
"\"$project\""
95100
],
96101
"listMigrations": [
97102
"dotnet",
@@ -103,9 +108,7 @@ This extension contributes the following settings:
103108
"--project",
104109
"\"$project\"",
105110
"--startup-project",
106-
"\"$project\"",
107-
"--no-color",
108-
"--json"
111+
"\"$project\""
109112
],
110113
"dbContextInfo": [
111114
"dotnet",
@@ -117,9 +120,7 @@ This extension contributes the following settings:
117120
"--project",
118121
"\"$project\"",
119122
"--startup-project",
120-
"\"$project\"",
121-
"--no-color",
122-
"--json"
123+
"\"$project\""
123124
],
124125
"scaffold": [
125126
"dotnet",
@@ -137,16 +138,40 @@ This extension contributes the following settings:
137138
"--context-dir",
138139
"\"$contextDir\"",
139140
"--namespace",
140-
"\"$namespace\"",
141-
"--no-color",
142-
"--json"
141+
"\"$namespace\""
142+
],
143+
"generateERD": [
144+
"dotnet",
145+
"ef",
146+
"dbcontext",
147+
"scaffold",
148+
"\"$connectionString\"",
149+
"\"$provider\"",
150+
"--context",
151+
"\"$context\"",
152+
"--project",
153+
"\"$project\"",
154+
"--output-dir",
155+
"\"$outputDir\"",
156+
"--use-database-names"
143157
]
144158
}
145159
}
146160
```
147161

148162
</details>
149163

164+
- `entityframework.erDiagram.ignoreTables`: A list of tables to ignore from the ER Diagram
165+
<details><summary>Example</summary>
166+
167+
```json
168+
{
169+
"entityframework.erDiagram": {
170+
"ignoreTables": [".*Tracking$"]
171+
}
172+
}
173+
```
174+
150175
- `entityframework.env`: Custom environment variables
151176
<details><summary>Example</summary>
152177

icons/references_dark.svg

Lines changed: 12 additions & 0 deletions
Loading

icons/references_light.svg

Lines changed: 23 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)