refactor(find-options)!: remove deprecated join option from find methods#12188
refactor(find-options)!: remove deprecated join option from find methods#12188pkuczynski merged 6 commits intomasterfrom
Conversation
Review Summary by QodoRemove deprecated find options APIs (join, string-based select/relations)
WalkthroughsDescription• Remove deprecated join property from find options interfaces • Remove deprecated string-array syntax for select and relations • Remove JoinOptions interface and related handling code • Migrate all samples and tests to object-based relations syntax • Remove FindOptionsUtils.extractFindManyOptionsAlias() helper method Diagramflowchart LR
A["Deprecated APIs<br/>join, string arrays"] -->|removed| B["FindOneOptions<br/>FindManyOptions"]
C["JoinOptions<br/>interface"] -->|deleted| B
D["FindOptionsSelectByString<br/>FindOptionsRelationByString"] -->|removed| B
E["Sample code<br/>Test code"] -->|migrated to| F["Object-based<br/>relations syntax"]
G["EntityManager<br/>SelectQueryBuilder"] -->|simplified| H["Removed join<br/>handling logic"]
File Changes1. src/find-options/FindOneOptions.ts
|
commit: |
Deploying typeorm with
|
| Latest commit: |
93807bd
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://4b5e15a9.typeorm.pages.dev |
| Branch Preview URL: | https://refactor-remove-deprecated-f.typeorm.pages.dev |
Code Review by Qodo
1. Mongo rejects join filter
|
|
Persistent review updated to latest commit aa3ed31 |
|
Persistent review updated to latest commit 6291560 |
|
Persistent review updated to latest commit ff6041f |
|
Persistent review updated to latest commit 824b829 |
|
Persistent review updated to latest commit 8f87a4d |
|
Persistent review updated to latest commit daf7c80 |
|
Persistent review updated to latest commit bc5a599 |
|
Following #12188 (comment), I'd only remove |
|
Persistent review updated to latest commit abda80c |
Remove the deprecated `join` property from `FindOneOptions` and `FindManyOptions`, along with the `JoinOptions` interface and all related handling code. - Delete `src/find-options/JoinOptions.ts` interface - Remove `join` property from `FindOneOptions` - Remove `join` handling from `SelectQueryBuilder.setFindOptions()` - Remove `extractFindManyOptionsAlias()` and `join` type guard from `FindOptionsUtils` - Remove unused `FindOptionsUtils` import from `EntityManager` - Convert all test and sample `join:` usages to equivalent `relations:` syntax - Add migration guide entry for the removal
abda80c to
0f9eb91
Compare
|
Persistent review updated to latest commit 0f9eb91 |
… suite The "should allow locking a relation of a relation" test relied on the removed join option with innerJoinAndSelect. Since relations only produces LEFT JOINs, PostgreSQL rejects FOR UPDATE on the nullable side. Move the test to the query-builder locking suite using innerJoinAndSelect and expand the migration guide to document when QueryBuilder is needed instead of relations.
…recated-find-options
|
Persistent review updated to latest commit 9e91b53 |
|
Persistent review updated to latest commit 93807bd |
|
Persistent review updated to latest commit fcdb6d0 |
Review Summary by QodoRemove deprecated join option and add runtime validation with migration guide
WalkthroughsDescription• Remove deprecated join option from find methods and interfaces - Delete JoinOptions interface and all related handling code - Remove join property from FindOneOptions - Remove join processing from SelectQueryBuilder.setFindOptions() • Add runtime validation to reject removed join option - Implement rejectJoinOption() in FindOptionsUtils for untyped callers - Apply validation in SelectQueryBuilder and MongoEntityManager • Convert all test and sample code to use relations syntax - Update 20+ test files and 3 sample files - Move nested-relation locking test to QueryBuilder suite • Expand migration guide with detailed conversion examples - Document leftJoinAndSelect → relations mapping - Show QueryBuilder alternatives for other join types - Include PostgreSQL locking considerations Diagramflowchart LR
A["Deprecated join option"] -->|Remove from types| B["FindOneOptions/FindManyOptions"]
A -->|Delete interface| C["JoinOptions.ts"]
A -->|Remove handling| D["SelectQueryBuilder"]
E["Runtime validation"] -->|Add rejectJoinOption| F["FindOptionsUtils"]
F -->|Apply in| D
F -->|Apply in| G["MongoEntityManager"]
H["Test/Sample updates"] -->|Convert to relations| I["20+ test files"]
H -->|Convert to relations| J["3 sample files"]
K["Migration guide"] -->|Document conversions| L["v1 migration guide"]
File Changes1. src/find-options/JoinOptions.ts
|
|
|
Persistent review updated to latest commit fcdb6d0 |
|
Persistent review updated to latest commit 4a1a970 |



Remove the deprecated
joinproperty fromFindOneOptionsandFindManyOptions, along with theJoinOptionsinterface and all related handling code.src/find-options/JoinOptions.tsinterfacejoinproperty fromFindOneOptionsjoinhandling fromSelectQueryBuilder.setFindOptions()extractFindManyOptionsAlias()andjointype guard fromFindOptionsUtilsFindOptionsUtilsimport fromEntityManagerjoin:usages to equivalentrelations:syntax