SIGN IN SIGN UP

One entry point for workspace data and fewer migration-era seams (#24805)

## What

Stacked on #24803 (base retargets to main when it merges). Four
simplifications that fell out of the post-consolidation review, each
removing a migration-era seam:

- **One entry point** — `getRepository` gains a `{ useReplica }` option,
the two API-layer bypasses (`CommonBaseQueryRunnerService`,
`ProcessNestedRelationsHelper`) go through the manager, and
`TwentyOrmModule` stops exporting `WorkspaceDataSourceService`. The
nested-relations helper also stops threading a datasource through four
private methods; it threads nothing, since `useReplica` was already an
argument.
- **One transaction scope** — the two byte-identical scope types
collapse into `WorkspaceTransactionScope`, and
`runInWorkspaceTransaction` hands the datasource scope through untouched
instead of re-wrapping both methods in pass-through lambdas (which also
removes an `as unknown as` cast).
- **No more `ConnectQueryRunner`** — `RelationNestedQueries` builds its
connect target queries itself. The callback existed to decouple the
class from v1 versus v2 query building, a distinction that no longer
exists; its only consumer shed twenty lines of runner plumbing.
- **No more TypeORM cosplay** — the select builder's `expressionMap`
getter (which mimicked TypeORM's shape for four readers that all only
wanted join aliases) becomes a first-class `getJoinAliases(): { name,
isToMany }[]`, and `ExpressionMapLike` is deleted.

## Verification

- `tsgo --noEmit` clean, `oxlint --type-aware` and `oxfmt --check src/`
clean
- twenty-orm, api/common, nested-relations and merge suites pass (93
suites, 835 tests)
- Grep gates: `expressionMap`, `ExpressionMapLike`, `ConnectQueryRunner`
and `WorkspaceDataSourceTransactionScope` no longer appear
- No committed upgrade command is touched


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/twentyhq/twenty/pull/24805?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
C
Charles Bochet committed
db83cad2fbd0a21a9008cfd20662a7f3af80e07a
Parent: 46a5e09
Committed by GitHub <noreply@github.com> on 8/25/2026, 8:33:12 PM