Skip to content

feat(core): add support for Table-Per-Type inheritance#7137

Open
B4nan wants to merge 1 commit intomasterfrom
tpt-inheritance
Open

feat(core): add support for Table-Per-Type inheritance#7137
B4nan wants to merge 1 commit intomasterfrom
tpt-inheritance

Conversation

@B4nan
Copy link
Member

@B4nan B4nan commented Jan 30, 2026

Implements Table-Per-Type inheritance strategy where each entity in an inheritance hierarchy gets its own dedicated table. Child tables have a FK to parent table using the same PK value.

@Entity({ inheritance: 'tpt' })
abstract class Integration { ... }

@Entity()
class FooIntegration extends Integration { ... }

Closes #1575

@codecov
Copy link

codecov bot commented Jan 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.69%. Comparing base (d244a94) to head (70c84d9).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #7137    +/-   ##
========================================
  Coverage   99.69%   99.69%            
========================================
  Files         250      250            
  Lines       21154    21582   +428     
  Branches     5344     5161   -183     
========================================
+ Hits        21089    21517   +428     
  Misses         65       65            

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@B4nan B4nan force-pushed the tpt-inheritance branch 8 times, most recently from 683d9b7 to daaefe6 Compare February 1, 2026 00:11
@B4nan B4nan marked this pull request as ready for review February 1, 2026 00:36
@B4nan B4nan force-pushed the tpt-inheritance branch 12 times, most recently from c1cd276 to ff5ec58 Compare February 1, 2026 15:35
Implements Table-Per-Type inheritance strategy where each entity in an inheritance hierarchy gets its own dedicated table. Child tables have a FK to parent table using the same PK value.

```ts
@entity({ inheritance: 'tpt' })
abstract class Integration { ... }

@entity()
class FooIntegration extends Integration { ... }
```

Closes #1575
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.

Implement TPT inheritance

1 participant