Skip to content

Commit f0911a9

Browse files
committed
Add initial ER Diagram feature using mermaid
1 parent 128ac43 commit f0911a9

36 files changed

+1084
-345
lines changed

.vscode/launch.json

+1-1
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",

README.md

+5-6
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ A VS Code extension to manage Entity Framework migrations.
1414
- Export `DbContext` as SQL script
1515
- View `DbContext` information
1616
- [Scaffold](https://learn.microsoft.com/en-us/ef/core/cli/dotnet#dotnet-ef-dbcontext-scaffold) `DbContext` & entity types
17+
- Generate ER Diagram
1718

1819
## Requirements
1920

@@ -89,9 +90,7 @@ This extension contributes the following settings:
8990
"--project",
9091
"\"$project\"",
9192
"--startup-project",
92-
"\"$project\"",
93-
"--no-color",
94-
"--json"
93+
"\"$project\""
9594
],
9695
"listMigrations": [
9796
"dotnet",
@@ -103,9 +102,7 @@ This extension contributes the following settings:
103102
"--project",
104103
"\"$project\"",
105104
"--startup-project",
106-
"\"$project\"",
107-
"--no-color",
108-
"--json"
105+
"\"$project\""
109106
],
110107
"dbContextInfo": [
111108
"dotnet",
@@ -173,3 +170,5 @@ The EF tools execute application code at design time to get information about th
173170
## License
174171

175172
See [LICENSE.md](./LICENSE.md).
173+
174+
// https://youtu.be/x2nh1vZBsHE?t=4597

icons/references_dark.svg

+12
Loading

icons/references_light.svg

+23
Loading

package-lock.json

+104
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+44-15
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@
6666
"dark": "icons/files_dark.svg"
6767
}
6868
},
69+
{
70+
"command": "entityframework.generateERD",
71+
"title": "Generate ER Diagram",
72+
"icon": {
73+
"light": "icons/references_light.svg",
74+
"dark": "icons/references_dark.svg"
75+
}
76+
},
6977
{
7078
"command": "entityframework.refreshTree",
7179
"title": "Refresh Migrations",
@@ -133,6 +141,10 @@
133141
"command": "entityframework.scaffold",
134142
"when": "false"
135143
},
144+
{
145+
"command": "entityframework.generateERD",
146+
"when": "false"
147+
},
136148
{
137149
"command": "entityframework.addMigration",
138150
"when": "false"
@@ -191,23 +203,33 @@
191203
{
192204
"command": "entityframework.addMigration",
193205
"when": "viewItem == dbContext",
194-
"group": "context@3"
206+
"group": "context@4"
195207
},
196208
{
197209
"command": "entityframework.addMigration",
198210
"when": "viewItem == dbContext",
199-
"group": "inline@3"
211+
"group": "inline@4"
200212
},
201213
{
202214
"command": "entityframework.generateScript",
203215
"when": "viewItem == dbContext",
204-
"group": "context@2"
216+
"group": "context@3"
205217
},
206218
{
207219
"command": "entityframework.generateScript",
208220
"when": "viewItem == dbContext",
221+
"group": "inline@3"
222+
},
223+
{
224+
"command": "entityframework.generateERD",
225+
"when": "viewItem == dbContext",
209226
"group": "inline@2"
210227
},
228+
{
229+
"command": "entityframework.generateERD",
230+
"when": "viewItem == dbContext",
231+
"group": "context@2"
232+
},
211233
{
212234
"command": "entityframework.dbContextInfo",
213235
"when": "viewItem == dbContext",
@@ -302,9 +324,7 @@
302324
"--project",
303325
"\"$project\"",
304326
"--startup-project",
305-
"\"$project\"",
306-
"--no-color",
307-
"--json"
327+
"\"$project\""
308328
],
309329
"listMigrations": [
310330
"dotnet",
@@ -316,9 +336,7 @@
316336
"--project",
317337
"\"$project\"",
318338
"--startup-project",
319-
"\"$project\"",
320-
"--no-color",
321-
"--json"
339+
"\"$project\""
322340
],
323341
"dbContextInfo": [
324342
"dotnet",
@@ -330,9 +348,7 @@
330348
"--project",
331349
"\"$project\"",
332350
"--startup-project",
333-
"\"$project\"",
334-
"--no-color",
335-
"--json"
351+
"\"$project\""
336352
],
337353
"scaffold": [
338354
"dotnet",
@@ -350,9 +366,21 @@
350366
"--context-dir",
351367
"\"$contextDir\"",
352368
"--namespace",
353-
"\"$namespace\"",
354-
"--no-color",
355-
"--json"
369+
"\"$namespace\""
370+
],
371+
"generateERD": [
372+
"dotnet",
373+
"ef",
374+
"dbcontext",
375+
"scaffold",
376+
"\"$connectionString\"",
377+
"\"$provider\"",
378+
"--context",
379+
"\"$context\"",
380+
"--project",
381+
"\"$project\"",
382+
"--output-dir",
383+
"\"$outputDir\""
356384
]
357385
},
358386
"description": "Custom dotnet ef commands."
@@ -389,6 +417,7 @@
389417
"eslint": "^8.30.0",
390418
"eslint-config-prettier": "^8.5.0",
391419
"eslint-plugin-prettier": "^4.2.1",
420+
"file-loader": "^6.2.0",
392421
"prettier": "2.8.1",
393422
"ts-loader": "^9.4.2",
394423
"ts-node": "^10.9.1",

0 commit comments

Comments
 (0)