Skip to content

EntityDescriptor.Ddl: the CREATE script for an EF Core entity's table - #1109

Merged
jeremydmiller merged 1 commit into
mainfrom
gh-5339-entity-ddl
Nov 2, 2026
Merged

jeremydmiller merged 1 commit into
mainfrom
gh-5339-entity-ddl

Conversation

@jeremydmiller

Copy link
Copy Markdown
Member

Adds EntityDescriptor.Ddl, the parallel of DocumentMappingDescriptor.Ddl, for JasperFx/wolverine#5339. CritterWatch's EF Core Explorer can show an entity's table, keys, indexes and foreign keys but not the script that creates them; Wolverine.EntityFrameworkCore will fill this in from the model.

  • Defaults to ""; empty for a view-mapped entity or a non-relational provider.
  • It is the model's script, not the database's.
  • Additive only, no breaking change.

Tests: new EntityDescriptorTests (default + JSON round trip), 2/2; CoreTests 812 passed, 1 skipped.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DCggXgxnG3EBXoR9rrq37U

Parallel of DocumentMappingDescriptor.Ddl, so monitoring tools can show the
script that creates an EF Core entity's table, keys, foreign keys and indexes.
Wolverine.EntityFrameworkCore fills it in (JasperFx/wolverine#5339).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DCggXgxnG3EBXoR9rrq37U
@jeremydmiller
jeremydmiller merged commit 3469d83 into main Nov 2, 2026
1 check passed
mlh758 pushed a commit to mlh758/wolverine that referenced this pull request Nov 3, 2026
…escriptor.Ddl

DbContextUsageFactory diffs the design-time model against nothing once per
snapshot (IMigrationsModelDiffer, the same services GenerateCreateScript uses),
filters the CreateTable / CreateIndex / AddForeignKey operations per entity
table, and generates them with IMigrationsSqlGenerator. No connection is
opened. A non-relational provider, a view-mapped entity or any failure leaves
Ddl empty without costing the rest of the snapshot.

Needs EntityDescriptor.Ddl from JasperFx/jasperfx#1109 and a JasperFx pin bump.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DCggXgxnG3EBXoR9rrq37U
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant