# 发布说明

> 英文标题：Release Notes
> 官网原文：https://typeorm.io/docs/releases/1.0/release-notes
> 文档版本：TypeORM v1.1
> 体例：英文原文（EN）与中文译文（ZH）逐块并列，共 40 块

---

<!-- EN -->
# Release Notes 1.0

<!-- ZH -->
# 发布说明 1.0

<!-- EN -->
TypeORM 1.0 is a major release that removes long-deprecated APIs, modernizes platform requirements, and ships dozens of bug fixes and new features accumulated during the 0.3.x cycle.

<!-- ZH -->
TypeORM 1.0 是一个主要版本，它移除了长期弃用的 API、现代化了平台要求，并带来了 0.3.x 周期中积累的数十项 bug 修复与新特性。

<!-- EN -->
## Breaking changes

<!-- ZH -->
## 破坏性变更

<!-- EN -->
> See the [Upgrading Guide](https://typeorm.io/docs/releases/1.0/upgrading-from-0.3) for detailed upgrade instructions.

<!-- ZH -->
> 详细的升级说明请参阅[升级指南](https://typeorm.io/docs/releases/1.0/upgrading-from-0.3)。

<!-- EN -->
### Platform requirements

<!-- ZH -->
### 平台要求

<!-- EN -->
* **Node.js 20+ required** — support for Node.js 16 and 18 has been dropped, and the minimum JavaScript target is now ES2023 ([#11382](https://github.com/typeorm/typeorm/pull/11382) by [@alumni](https://github.com/alumni))
* **`Buffer` polyfill removed** — `Uint8Array` is now used for binary data on non-Node platforms; Node.js `Buffer` (which extends `Uint8Array`) continues to work as before ([#11935](https://github.com/typeorm/typeorm/pull/11935) by [@pujux](https://github.com/pujux))
* **Glob library replaced** — `glob` has been replaced with `tinyglobby` and `rimraf` has been removed, resulting in fewer dependencies ([#11699](https://github.com/typeorm/typeorm/pull/11699) by [@alumni](https://github.com/alumni))
* **Hashing moved to native `crypto`** — the `sha.js` and `uuid` packages have been replaced with the native `crypto` module and `crypto.randomUUID()` ([#11864](https://github.com/typeorm/typeorm/pull/11864) by [@G0maa](https://github.com/G0maa), [#11769](https://github.com/typeorm/typeorm/pull/11769) by [@mag123c](https://github.com/mag123c))

<!-- ZH -->
* **要求 Node.js 20+** —— 不再支持 Node.js 16 和 18，最低 JavaScript 目标现在是 ES2023（[#11382](https://github.com/typeorm/typeorm/pull/11382)，作者 [@alumni](https://github.com/alumni)）
* **移除 `Buffer` polyfill** —— 在非 Node 平台上二进制数据现在使用 `Uint8Array`；Node.js 的 `Buffer`（它继承自 `Uint8Array`）继续照常工作（[#11935](https://github.com/typeorm/typeorm/pull/11935)，作者 [@pujux](https://github.com/pujux)）
* **替换 Glob 库** —— `glob` 已被替换为 `tinyglobby`，`rimraf` 已被移除，依赖更少（[#11699](https://github.com/typeorm/typeorm/pull/11699)，作者 [@alumni](https://github.com/alumni)）
* **哈希改用原生 `crypto`** —— `sha.js` 和 `uuid` 包已被替换为原生 `crypto` 模块和 `crypto.randomUUID()`（[#11864](https://github.com/typeorm/typeorm/pull/11864)，作者 [@G0maa](https://github.com/G0maa)；[#11769](https://github.com/typeorm/typeorm/pull/11769)，作者 [@mag123c](https://github.com/mag123c)）

<!-- EN -->
### Driver changes

<!-- ZH -->
### 驱动变更

<!-- EN -->
* **MySQL / MariaDB: `mysql` package dropped** — only `mysql2` is supported; the `connectorPackage` option has been removed ([#11766](https://github.com/typeorm/typeorm/pull/11766) by [@pkuczynski](https://github.com/pkuczynski))
* **MySQL: `legacySpatialSupport` now defaults to `false`** — standard `ST_GeomFromText`/`ST_AsText` functions are used by default ([#12083](https://github.com/typeorm/typeorm/pull/12083) by [@pkuczynski](https://github.com/pkuczynski))
* **MySQL: `width` and `zerofill` column options removed** — these were deprecated in MySQL 8.0.17 and removed in MySQL 8.4 ([#12084](https://github.com/typeorm/typeorm/pull/12084) by [@pkuczynski](https://github.com/pkuczynski))
* **MySQL: `QueryBuilder.useIndex()` accepts index name(s), not raw SQL** — `useIndex()` now takes either a single index name or an array of names and escapes them as identifiers. Previously the argument was interpolated as a raw, comma-separated SQL fragment, which allowed identifier injection ([#12344](https://github.com/typeorm/typeorm/pull/12344) by [@eddieran](https://github.com/eddieran))
* **SQLite: `sqlite3` dropped, `better-sqlite3` is the default** — the `sqlite3` package is no longer supported; `flags` and `busyTimeout` options have been removed ([#11836](https://github.com/typeorm/typeorm/pull/11836) by [@pkuczynski](https://github.com/pkuczynski))
* **MongoDB: driver v7+ required** — support for MongoDB Node.js driver v5/v6 has been dropped; `stats()` method removed; deprecated connection options removed; internal types are no longer exported ([#12208](https://github.com/typeorm/typeorm/pull/12208) by [@naorpeled](https://github.com/naorpeled), [#12179](https://github.com/typeorm/typeorm/pull/12179) by [@pkuczynski](https://github.com/pkuczynski), [#12120](https://github.com/typeorm/typeorm/pull/12120) by [@pkuczynski](https://github.com/pkuczynski), [#12037](https://github.com/typeorm/typeorm/pull/12037) by [@alumni](https://github.com/alumni))
* **MS SQL Server: `domain` connection option removed** — use `authentication` with NTLM type instead ([#12135](https://github.com/typeorm/typeorm/pull/12135) by [@pkuczynski](https://github.com/pkuczynski))
* **MS SQL Server: `options.isolation` renamed to `options.isolationLevel`** — value format changed from `READ_COMMITTED` to `READ COMMITTED` to match `IsolationLevel` type; `SNAPSHOT` isolation level added ([#12231](https://github.com/typeorm/typeorm/pull/12231) by [@Cprakhar](https://github.com/Cprakhar))
* **SAP HANA: deprecated connection aliases removed** — `hanaClientDriver`, `pool.max`, `pool.requestTimeout`, `pool.idleTimeout`, and others have been removed in favor of their modern equivalents ([#12080](https://github.com/typeorm/typeorm/pull/12080) by [@gioboa](https://github.com/gioboa))
* **Expo: legacy driver removed** — the legacy Expo SQLite driver has been removed; use Expo SDK v52+ with the modern async API ([#11860](https://github.com/typeorm/typeorm/pull/11860) by [@G0maa](https://github.com/G0maa))
* **Redis: legacy client support removed** — only modern Redis client (v4+) is supported for query result caching ([#12057](https://github.com/typeorm/typeorm/pull/12057) by [@G0maa](https://github.com/G0maa))

<!-- ZH -->
* **MySQL / MariaDB：弃用 `mysql` 包** —— 只支持 `mysql2`；`connectorPackage` 选项已移除（[#11766](https://github.com/typeorm/typeorm/pull/11766)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **MySQL：`legacySpatialSupport` 现在默认为 `false`** —— 默认使用标准的 `ST_GeomFromText`/`ST_AsText` 函数（[#12083](https://github.com/typeorm/typeorm/pull/12083)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **MySQL：移除 `width` 和 `zerofill` 列选项** —— 它们在 MySQL 8.0.17 中被弃用，并在 MySQL 8.4 中被移除（[#12084](https://github.com/typeorm/typeorm/pull/12084)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **MySQL：`QueryBuilder.useIndex()` 接受索引名而非原生 SQL** —— `useIndex()` 现在接受单个索引名或名称数组，并把它们作为标识符转义。此前该参数被当作原生的、逗号分隔的 SQL 片段插值，这允许标识符注入（[#12344](https://github.com/typeorm/typeorm/pull/12344)，作者 [@eddieran](https://github.com/eddieran)）
* **SQLite：弃用 `sqlite3`，默认使用 `better-sqlite3`** —— 不再支持 `sqlite3` 包；`flags` 和 `busyTimeout` 选项已移除（[#11836](https://github.com/typeorm/typeorm/pull/11836)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **MongoDB：要求驱动 v7+** —— 不再支持 MongoDB Node.js 驱动 v5/v6；`stats()` 方法已移除；已弃用的连接选项已移除；内部类型不再导出（[#12208](https://github.com/typeorm/typeorm/pull/12208)，作者 [@naorpeled](https://github.com/naorpeled)；[#12179](https://github.com/typeorm/typeorm/pull/12179)，作者 [@pkuczynski](https://github.com/pkuczynski)；[#12120](https://github.com/typeorm/typeorm/pull/12120)，作者 [@pkuczynski](https://github.com/pkuczynski)；[#12037](https://github.com/typeorm/typeorm/pull/12037)，作者 [@alumni](https://github.com/alumni)）
* **MS SQL Server：移除 `domain` 连接选项** —— 请改用 NTLM 类型的 `authentication`（[#12135](https://github.com/typeorm/typeorm/pull/12135)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **MS SQL Server：`options.isolation` 更名为 `options.isolationLevel`** —— 值格式从 `READ_COMMITTED` 改为 `READ COMMITTED` 以匹配 `IsolationLevel` 类型；新增 `SNAPSHOT` 隔离级别（[#12231](https://github.com/typeorm/typeorm/pull/12231)，作者 [@Cprakhar](https://github.com/Cprakhar)）
* **SAP HANA：移除已弃用的连接别名** —— `hanaClientDriver`、`pool.max`、`pool.requestTimeout`、`pool.idleTimeout` 等已被移除，请改用它们现代的等价项（[#12080](https://github.com/typeorm/typeorm/pull/12080)，作者 [@gioboa](https://github.com/gioboa)）
* **Expo：移除旧版驱动** —— 旧版 Expo SQLite 驱动已移除；请使用 Expo SDK v52+ 及其现代异步 API（[#11860](https://github.com/typeorm/typeorm/pull/11860)，作者 [@G0maa](https://github.com/G0maa)）
* **Redis：移除旧版客户端支持** —— 查询结果缓存只支持现代 Redis 客户端（v4+）（[#12057](https://github.com/typeorm/typeorm/pull/12057)，作者 [@G0maa](https://github.com/G0maa)）

<!-- EN -->
### Removed APIs

<!-- ZH -->
### 移除的 API

<!-- EN -->
* **`Connection` and `ConnectionOptions` removed** — use `DataSource` and `DataSourceOptions` instead ([#12022](https://github.com/typeorm/typeorm/pull/12022) by [@alumni](https://github.com/alumni))
* **`.connection` property renamed to `.dataSource`** — the `connection` property on `Driver`, `QueryRunner`, `EntityManager`, `QueryBuilder`, `EntityMetadata`, and all `*Event` subscriber interfaces has been renamed to `dataSource`; a deprecated getter is provided as a bridge ([#12244](https://github.com/typeorm/typeorm/pull/12244), [#12245](https://github.com/typeorm/typeorm/pull/12245), [#12246](https://github.com/typeorm/typeorm/pull/12246), [#12249](https://github.com/typeorm/typeorm/pull/12249) by [@pkuczynski](https://github.com/pkuczynski))
* **`ConnectionManager` and global convenience functions removed** — `createConnection`, `getConnection`, `getManager`, `getRepository`, `createQueryBuilder`, and other globals have been removed ([#12098](https://github.com/typeorm/typeorm/pull/12098) by [@michaelbromley](https://github.com/michaelbromley))
* **`getMongoRepository` and `getMongoManager` globals removed** — use `dataSource.getMongoRepository()` and `dataSource.mongoManager` instead ([#12099](https://github.com/typeorm/typeorm/pull/12099) by [@pkuczynski](https://github.com/pkuczynski))
* **`DataSource.name` removed** — named connections were deprecated in v0.3; `ConnectionOptionsReader.all()` renamed to `get()` ([#12136](https://github.com/typeorm/typeorm/pull/12136) by [@pkuczynski](https://github.com/pkuczynski))
* **`TYPEORM_*` environment variable support removed** — `ConnectionOptionsEnvReader`, `ormconfig.env`, and `dotenv` auto-loading have been removed ([#12134](https://github.com/typeorm/typeorm/pull/12134) by [@pkuczynski](https://github.com/pkuczynski))
* **`findByIds` removed** — use `findBy` with `In` operator instead ([#12114](https://github.com/typeorm/typeorm/pull/12114) by [@pkuczynski](https://github.com/pkuczynski))
* **`findOneById` removed** — use `findOneBy` instead ([#12198](https://github.com/typeorm/typeorm/pull/12198) by [@pkuczynski](https://github.com/pkuczynski))
* **`Repository.exist()` removed** — use `Repository.exists()` instead ([#12131](https://github.com/typeorm/typeorm/pull/12131) by [@pkuczynski](https://github.com/pkuczynski))
* **`AbstractRepository`, `@EntityRepository`, and `getCustomRepository` removed** — use `Repository.extend()` instead ([#12096](https://github.com/typeorm/typeorm/pull/12096) by [@pkuczynski](https://github.com/pkuczynski))
* **`@RelationCount` decorator removed** — use `@VirtualColumn` with a sub-query instead ([#12181](https://github.com/typeorm/typeorm/pull/12181) by [@pkuczynski](https://github.com/pkuczynski))
* **IoC container system removed** — `useContainer()`, `getFromContainer()`, and related types have been removed ([#12180](https://github.com/typeorm/typeorm/pull/12180) by [@pkuczynski](https://github.com/pkuczynski))
* **`readonly` column option removed** — use `update: false` instead ([#12132](https://github.com/typeorm/typeorm/pull/12132) by [@pkuczynski](https://github.com/pkuczynski))
* **`unsigned` on `ColumnNumericOptions` removed** — only affected decimal/float types; integer `unsigned` is unchanged ([#12133](https://github.com/typeorm/typeorm/pull/12133) by [@pkuczynski](https://github.com/pkuczynski))
* **QueryBuilder: `onConflict()`, deprecated `orUpdate()` overload, and `setNativeParameters()` removed** — use `orIgnore()`/`orUpdate()` array signature and `setParameters()` instead ([#12090](https://github.com/typeorm/typeorm/pull/12090) by [@pkuczynski](https://github.com/pkuczynski))
* **QueryBuilder: `printSql()` removed** — it was redundant since all executed queries are already logged through the configured logger; use `getSql()` or `getQueryAndParameters()` to inspect SQL instead ([#12151](https://github.com/typeorm/typeorm/pull/12151) by [@naorpeled](https://github.com/naorpeled), [#12220](https://github.com/typeorm/typeorm/pull/12220) by [@pkuczynski](https://github.com/pkuczynski))
* **QueryBuilder: `WhereExpression` type alias removed** — use `WhereExpressionBuilder` instead ([#12097](https://github.com/typeorm/typeorm/pull/12097) by [@pkuczynski](https://github.com/pkuczynski))
* **QueryBuilder: `replacePropertyNames()` removed** — it was a no-op ([#12178](https://github.com/typeorm/typeorm/pull/12178) by [@pkuczynski](https://github.com/pkuczynski))
* **`join` find option removed** — use `relations` for LEFT JOINs or QueryBuilder for other join types ([#12188](https://github.com/typeorm/typeorm/pull/12188) by [@pkuczynski](https://github.com/pkuczynski))
* **String-based `select` removed** — use object syntax `select: { id: true }` instead of `select: ["id"]` ([#12214](https://github.com/typeorm/typeorm/pull/12214) by [@pkuczynski](https://github.com/pkuczynski))
* **String-based `relations` removed** — use object syntax `relations: { profile: true }` instead of `relations: ["profile"]` ([#12215](https://github.com/typeorm/typeorm/pull/12215) by [@pkuczynski](https://github.com/pkuczynski))
* **Deprecated lock modes removed** — `pessimistic_partial_write` and `pessimistic_write_or_fail` replaced by `pessimistic_write` with `onLocked` option ([#12093](https://github.com/typeorm/typeorm/pull/12093) by [@pkuczynski](https://github.com/pkuczynski))
* **`QueryRunner.loadedTables` and `loadedViews` removed** — use `getTables()` and `getViews()` instead ([#12183](https://github.com/typeorm/typeorm/pull/12183) by [@pkuczynski](https://github.com/pkuczynski))
* **`MigrationExecutor.getAllMigrations()` removed** — use `getPendingMigrations()`, `getExecutedMigrations()`, or `dataSource.migrations` instead ([#12142](https://github.com/typeorm/typeorm/pull/12142) by [@pkuczynski](https://github.com/pkuczynski))
* **`EntityMetadata.createPropertyPath()` static method removed** — internal utility with no public replacement ([#12141](https://github.com/typeorm/typeorm/pull/12141) by [@pkuczynski](https://github.com/pkuczynski))
* **Internal `nativeParameters` plumbing removed** from drivers and query builders ([#12104](https://github.com/typeorm/typeorm/pull/12104) by [@pkuczynski](https://github.com/pkuczynski))
* **Internal `broadcastLoadEventsForAll()` removed** from Broadcaster ([#12137](https://github.com/typeorm/typeorm/pull/12137) by [@pkuczynski](https://github.com/pkuczynski))
* **Internal `DriverUtils.buildColumnAlias()` removed** — use `buildAlias()` instead ([#12138](https://github.com/typeorm/typeorm/pull/12138) by [@pkuczynski](https://github.com/pkuczynski))
* **`RdbmsSchemaBuilder.renameTables()` removed** — empty no-op method that was never called ([#12284](https://github.com/typeorm/typeorm/pull/12284) by [@naorpeled](https://github.com/naorpeled))
* **`EntityMetadata.getValueMap()` `options` parameter removed** — the `skipNulls` option was never functional; remove the third argument ([#12303](https://github.com/typeorm/typeorm/pull/12303) by [@naorpeled](https://github.com/naorpeled))
* **`LegacyOracleNamingStrategy` and `NamingStrategyV03` moved to `@typeorm/legacy-naming-strategies`** — these classes are no longer exported from `typeorm` core; install the separate `@typeorm/legacy-naming-strategies` package and import them from there if you still need them ([#12416](https://github.com/typeorm/typeorm/pull/12416) by [@alumni](https://github.com/alumni))

<!-- ZH -->
* **移除 `Connection` 和 `ConnectionOptions`** —— 请改用 `DataSource` 和 `DataSourceOptions`（[#12022](https://github.com/typeorm/typeorm/pull/12022)，作者 [@alumni](https://github.com/alumni)）
* **`.connection` 属性更名为 `.dataSource`** —— `Driver`、`QueryRunner`、`EntityManager`、`QueryBuilder`、`EntityMetadata` 以及所有 `*Event` 订阅者接口上的 `connection` 属性已更名为 `dataSource`；提供了一个已弃用的 getter 作为过渡（[#12244](https://github.com/typeorm/typeorm/pull/12244)、[#12245](https://github.com/typeorm/typeorm/pull/12245)、[#12246](https://github.com/typeorm/typeorm/pull/12246)、[#12249](https://github.com/typeorm/typeorm/pull/12249)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **移除 `ConnectionManager` 和全局便捷函数** —— `createConnection`、`getConnection`、`getManager`、`getRepository`、`createQueryBuilder` 等全局函数已移除（[#12098](https://github.com/typeorm/typeorm/pull/12098)，作者 [@michaelbromley](https://github.com/michaelbromley)）
* **移除 `getMongoRepository` 和 `getMongoManager` 全局函数** —— 请改用 `dataSource.getMongoRepository()` 和 `dataSource.mongoManager`（[#12099](https://github.com/typeorm/typeorm/pull/12099)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **移除 `DataSource.name`** —— 命名连接在 v0.3 中已弃用；`ConnectionOptionsReader.all()` 更名为 `get()`（[#12136](https://github.com/typeorm/typeorm/pull/12136)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **移除 `TYPEORM_*` 环境变量支持** —— `ConnectionOptionsEnvReader`、`ormconfig.env` 以及 `dotenv` 自动加载均已移除（[#12134](https://github.com/typeorm/typeorm/pull/12134)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **移除 `findByIds`** —— 请改用带 `In` 运算符的 `findBy`（[#12114](https://github.com/typeorm/typeorm/pull/12114)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **移除 `findOneById`** —— 请改用 `findOneBy`（[#12198](https://github.com/typeorm/typeorm/pull/12198)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **移除 `Repository.exist()`** —— 请改用 `Repository.exists()`（[#12131](https://github.com/typeorm/typeorm/pull/12131)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **移除 `AbstractRepository`、`@EntityRepository` 和 `getCustomRepository`** —— 请改用 `Repository.extend()`（[#12096](https://github.com/typeorm/typeorm/pull/12096)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **移除 `@RelationCount` 装饰器** —— 请改用带子查询的 `@VirtualColumn`（[#12181](https://github.com/typeorm/typeorm/pull/12181)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **移除 IoC 容器系统** —— `useContainer()`、`getFromContainer()` 及相关类型已移除（[#12180](https://github.com/typeorm/typeorm/pull/12180)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **移除 `readonly` 列选项** —— 请改用 `update: false`（[#12132](https://github.com/typeorm/typeorm/pull/12132)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **移除 `ColumnNumericOptions` 上的 `unsigned`** —— 仅影响 decimal/float 类型；整数的 `unsigned` 保持不变（[#12133](https://github.com/typeorm/typeorm/pull/12133)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **QueryBuilder：移除 `onConflict()`、已弃用的 `orUpdate()` 重载和 `setNativeParameters()`** —— 请改用 `orIgnore()`/`orUpdate()` 的数组签名以及 `setParameters()`（[#12090](https://github.com/typeorm/typeorm/pull/12090)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **QueryBuilder：移除 `printSql()`** —— 它是多余的，因为所有已执行的查询都已经通过所配置的日志记录器记录；请改用 `getSql()` 或 `getQueryAndParameters()` 来查看 SQL（[#12151](https://github.com/typeorm/typeorm/pull/12151)，作者 [@naorpeled](https://github.com/naorpeled)；[#12220](https://github.com/typeorm/typeorm/pull/12220)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **QueryBuilder：移除 `WhereExpression` 类型别名** —— 请改用 `WhereExpressionBuilder`（[#12097](https://github.com/typeorm/typeorm/pull/12097)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **QueryBuilder：移除 `replacePropertyNames()`** —— 它是一个空操作（[#12178](https://github.com/typeorm/typeorm/pull/12178)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **移除 `join` 查找选项** —— LEFT JOIN 请使用 `relations`，其他连接类型请使用 QueryBuilder（[#12188](https://github.com/typeorm/typeorm/pull/12188)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **移除基于字符串的 `select`** —— 请使用对象语法 `select: { id: true }` 代替 `select: ["id"]`（[#12214](https://github.com/typeorm/typeorm/pull/12214)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **移除基于字符串的 `relations`** —— 请使用对象语法 `relations: { profile: true }` 代替 `relations: ["profile"]`（[#12215](https://github.com/typeorm/typeorm/pull/12215)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **移除已弃用的锁模式** —— `pessimistic_partial_write` 和 `pessimistic_write_or_fail` 被带 `onLocked` 选项的 `pessimistic_write` 取代（[#12093](https://github.com/typeorm/typeorm/pull/12093)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **移除 `QueryRunner.loadedTables` 和 `loadedViews`** —— 请改用 `getTables()` 和 `getViews()`（[#12183](https://github.com/typeorm/typeorm/pull/12183)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **移除 `MigrationExecutor.getAllMigrations()`** —— 请改用 `getPendingMigrations()`、`getExecutedMigrations()` 或 `dataSource.migrations`（[#12142](https://github.com/typeorm/typeorm/pull/12142)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **移除 `EntityMetadata.createPropertyPath()` 静态方法** —— 内部工具，没有公开替代品（[#12141](https://github.com/typeorm/typeorm/pull/12141)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **从驱动和 query builder 中移除内部的 `nativeParameters` 管道**（[#12104](https://github.com/typeorm/typeorm/pull/12104)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **从 Broadcaster 中移除内部的 `broadcastLoadEventsForAll()`**（[#12137](https://github.com/typeorm/typeorm/pull/12137)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **移除内部的 `DriverUtils.buildColumnAlias()`** —— 请改用 `buildAlias()`（[#12138](https://github.com/typeorm/typeorm/pull/12138)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **移除 `RdbmsSchemaBuilder.renameTables()`** —— 一个从未被调用过的空操作方法（[#12284](https://github.com/typeorm/typeorm/pull/12284)，作者 [@naorpeled](https://github.com/naorpeled)）
* **移除 `EntityMetadata.getValueMap()` 的 `options` 参数** —— `skipNulls` 选项从未生效；请移除第三个参数（[#12303](https://github.com/typeorm/typeorm/pull/12303)，作者 [@naorpeled](https://github.com/naorpeled)）
* **`LegacyOracleNamingStrategy` 和 `NamingStrategyV03` 移到 `@typeorm/legacy-naming-strategies`** —— 这些类不再从 `typeorm` 核心包导出；如果你仍然需要它们，请安装独立的 `@typeorm/legacy-naming-strategies` 包并从那里导入（[#12416](https://github.com/typeorm/typeorm/pull/12416)，作者 [@alumni](https://github.com/alumni)）

<!-- EN -->
### Behavioral changes

<!-- ZH -->
### 行为变更

<!-- EN -->
* **Non-nullable relations now use INNER JOIN** — `ManyToOne` and owning `OneToOne` relations marked `nullable: false` now use `INNER JOIN` instead of `LEFT JOIN`, which may exclude rows with orphaned foreign keys ([#12064](https://github.com/typeorm/typeorm/pull/12064) by [@pkuczynski](https://github.com/pkuczynski))
* **`invalidWhereValuesBehavior` defaults to `throw`** — passing `null` or `undefined` in where conditions now throws an error instead of silently ignoring the property; use `IsNull()` for null matching ([#11710](https://github.com/typeorm/typeorm/pull/11710) by [@naorpeled](https://github.com/naorpeled))
* **`invalidWhereValuesBehavior` scoped to high-level APIs only** — QueryBuilder's `.where()`, `.andWhere()`, `.orWhere()` are no longer affected by this setting ([#11878](https://github.com/typeorm/typeorm/pull/11878) by [@naorpeled](https://github.com/naorpeled))
* **`ConnectionOptionsReader` and `FileLogger` paths resolved from `process.cwd()`** — `ConnectionOptionsReader` no longer uses `app-root-path` to locate `ormconfig` files; it searches `process.cwd()` instead. Pass `{ root: "/custom/path" }` to the constructor to override. `FileLogger.logPath` is likewise resolved from `process.cwd()` — use an absolute path when the app is not started from its root folder ([#12257](https://github.com/typeorm/typeorm/pull/12257) by [@alumni](https://github.com/alumni))

<!-- ZH -->
* **非空关系现在使用 INNER JOIN** —— 标记为 `nullable: false` 的 `ManyToOne` 和拥有方 `OneToOne` 关系现在使用 `INNER JOIN` 而不是 `LEFT JOIN`，这可能会排除带有孤儿外键的行（[#12064](https://github.com/typeorm/typeorm/pull/12064)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **`invalidWhereValuesBehavior` 默认为 `throw`** —— 在 where 条件中传入 `null` 或 `undefined` 现在会抛出错误，而不是静默忽略该属性；匹配 null 请使用 `IsNull()`（[#11710](https://github.com/typeorm/typeorm/pull/11710)，作者 [@naorpeled](https://github.com/naorpeled)）
* **`invalidWhereValuesBehavior` 仅作用于高层 API** —— QueryBuilder 的 `.where()`、`.andWhere()`、`.orWhere()` 不再受该设置影响（[#11878](https://github.com/typeorm/typeorm/pull/11878)，作者 [@naorpeled](https://github.com/naorpeled)）
* **`ConnectionOptionsReader` 和 `FileLogger` 的路径从 `process.cwd()` 解析** —— `ConnectionOptionsReader` 不再使用 `app-root-path` 来定位 `ormconfig` 文件；改为搜索 `process.cwd()`。要给构造函数传 `{ root: "/custom/path" }` 来覆盖。`FileLogger.logPath` 同样从 `process.cwd()` 解析——当应用不是从其根文件夹启动时，请使用绝对路径（[#12257](https://github.com/typeorm/typeorm/pull/12257)，作者 [@alumni](https://github.com/alumni)）

<!-- EN -->
## New features

<!-- ZH -->
## 新特性

<!-- EN -->
### Query Builder

<!-- ZH -->
### Query Builder

<!-- EN -->
* **`INSERT INTO ... SELECT FROM ...`** — new `valuesFromSelect()` method on `InsertQueryBuilder` for data migration and transformation queries ([#11896](https://github.com/typeorm/typeorm/pull/11896) by [@Cprakhar](https://github.com/Cprakhar))
* **`returning` option for update/upsert** — repository and entity manager `update()` and `upsert()` methods now support a `returning` option on databases that support `RETURNING` clauses ([#11782](https://github.com/typeorm/typeorm/pull/11782) by [@naorpeled](https://github.com/naorpeled))
* **`ifExists` parameter on all drop methods** — `dropColumn`, `dropIndex`, `dropPrimaryKey`, `dropForeignKey`, `dropUniqueConstraint`, `dropCheckConstraint`, `dropExclusionConstraint`, and their plural variants now accept an `ifExists` flag ([#12121](https://github.com/typeorm/typeorm/pull/12121) by [@pkuczynski](https://github.com/pkuczynski))
* **Explicit resource management for `QueryRunner`** — supports `await using` syntax (TypeScript 5.2+) for automatic cleanup ([#11701](https://github.com/typeorm/typeorm/pull/11701) by [@alumni](https://github.com/alumni))

<!-- ZH -->
* **`INSERT INTO ... SELECT FROM ...`** —— `InsertQueryBuilder` 上新增 `valuesFromSelect()` 方法，用于数据迁移和转换查询（[#11896](https://github.com/typeorm/typeorm/pull/11896)，作者 [@Cprakhar](https://github.com/Cprakhar)）
* **update/upsert 的 `returning` 选项** —— repository 和 entity manager 的 `update()` 与 `upsert()` 方法现在在支持 `RETURNING` 子句的数据库上支持 `returning` 选项（[#11782](https://github.com/typeorm/typeorm/pull/11782)，作者 [@naorpeled](https://github.com/naorpeled)）
* **所有 drop 方法新增 `ifExists` 参数** —— `dropColumn`、`dropIndex`、`dropPrimaryKey`、`dropForeignKey`、`dropUniqueConstraint`、`dropCheckConstraint`、`dropExclusionConstraint` 及其复数形式现在都接受 `ifExists` 标志（[#12121](https://github.com/typeorm/typeorm/pull/12121)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **`QueryRunner` 的显式资源管理** —— 支持 `await using` 语法（TypeScript 5.2+）以自动清理（[#11701](https://github.com/typeorm/typeorm/pull/11701)，作者 [@alumni](https://github.com/alumni)）

<!-- EN -->
### Transactions

<!-- ZH -->
### 事务

<!-- EN -->
* **DataSource-level default isolation level for all drivers** — `DataSourceOptions.isolationLevel` is now honored by every driver that supports transactions, not just SQL Server. Transactions started through the DataSource (explicitly or implicitly for DML) use this level by default ([#12269](https://github.com/typeorm/typeorm/pull/12269) by [@pkuczynski](https://github.com/pkuczynski))
* **Aurora Postgres: transaction isolation level support** — Aurora Postgres now honors the `isolationLevel` option on DataSource and on explicit `startTransaction()` calls ([#12334](https://github.com/typeorm/typeorm/pull/12334) by [@pkuczynski](https://github.com/pkuczynski))
* **Spanner: transaction isolation level support** — Google Spanner now honors the `isolationLevel` option. Spanner's `supportedIsolationLevels` is limited to `REPEATABLE READ` (currently in preview) and `SERIALIZABLE` ([#12335](https://github.com/typeorm/typeorm/pull/12335) by [@pkuczynski](https://github.com/pkuczynski))

<!-- ZH -->
* **所有驱动都支持 DataSource 级默认隔离级别** —— `DataSourceOptions.isolationLevel` 现在被每个支持事务的驱动采纳，而不仅仅是 SQL Server。通过 DataSource 启动的事务（显式的，或 DML 隐式的）默认使用该级别（[#12269](https://github.com/typeorm/typeorm/pull/12269)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **Aurora Postgres：事务隔离级别支持** —— Aurora Postgres 现在会在 DataSource 上以及显式 `startTransaction()` 调用上采纳 `isolationLevel` 选项（[#12334](https://github.com/typeorm/typeorm/pull/12334)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **Spanner：事务隔离级别支持** —— Google Spanner 现在会采纳 `isolationLevel` 选项。Spanner 的 `supportedIsolationLevels` 仅限于 `REPEATABLE READ`（目前处于预览阶段）和 `SERIALIZABLE`（[#12335](https://github.com/typeorm/typeorm/pull/12335)，作者 [@pkuczynski](https://github.com/pkuczynski)）

<!-- EN -->
### Drivers

<!-- ZH -->
### 驱动

<!-- EN -->
* **PostgreSQL: `ADD VALUE` for enum changes** — when adding new enum values, TypeORM now uses the simpler `ALTER TYPE ... ADD VALUE` syntax instead of the 4-step rename-create-migrate-drop approach, when possible ([#10956](https://github.com/typeorm/typeorm/pull/10956) by [@janzipek](https://github.com/janzipek))
* **PostgreSQL: additional extensions** — new `installExtensions` option to install additional PostgreSQL extensions during connection setup ([#11888](https://github.com/typeorm/typeorm/pull/11888) by [@Cprakhar](https://github.com/Cprakhar))
* **PostgreSQL: partial index support** — add support for PostgreSQL partial indexes ([#11318](https://github.com/typeorm/typeorm/pull/11318) by [@freePixel](https://github.com/freePixel))
* **SAP HANA: locking in SELECT** — `FOR UPDATE` and other lock modes are now supported in SAP HANA queries ([#11996](https://github.com/typeorm/typeorm/pull/11996) by [@alumni](https://github.com/alumni))
* **SAP HANA: table comments** — `@Entity({ comment: "..." })` now works with SAP HANA ([#11939](https://github.com/typeorm/typeorm/pull/11939) by [@Cprakhar](https://github.com/Cprakhar))
* **SAP HANA: pool timeout** — new `maxWaitTimeoutIfPoolExhausted` pool option ([#11868](https://github.com/typeorm/typeorm/pull/11868) by [@alumni](https://github.com/alumni))
* **SAP HANA: generated columns** — `@Column({ generatedType: "STORED", asExpression: "..." })` is now supported in SAP HANA ([#12393](https://github.com/typeorm/typeorm/pull/12393) by [@Cprakhar](https://github.com/Cprakhar))
* **SQLite: `jsonb` column type** — SQLite now supports the `jsonb` column type ([#11933](https://github.com/typeorm/typeorm/pull/11933) by [@Cprakhar](https://github.com/Cprakhar))
* **MongoDB: object-based `select` projection** — `find*()` methods now accept the same object-based `select` syntax used by other drivers (`select: { id: true, name: true }`) in addition to the existing string-array form ([#12237](https://github.com/typeorm/typeorm/pull/12237) by [@pkuczynski](https://github.com/pkuczynski))
* **React Native: encryption key** — new option to pass an encryption key for React Native SQLite databases ([#11736](https://github.com/typeorm/typeorm/pull/11736) by [@HtSpChakradharCholleti](https://github.com/HtSpChakradharCholleti))

<!-- ZH -->
* **PostgreSQL：枚举变更使用 `ADD VALUE`** —— 添加新的枚举值时，TypeORM 现在会在可能的情况下使用更简单的 `ALTER TYPE ... ADD VALUE` 语法，而不是"重命名-创建-迁移-删除"四步方案（[#10956](https://github.com/typeorm/typeorm/pull/10956)，作者 [@janzipek](https://github.com/janzipek)）
* **PostgreSQL：额外扩展** —— 新增 `installExtensions` 选项，用于在连接建立期间安装额外的 PostgreSQL 扩展（[#11888](https://github.com/typeorm/typeorm/pull/11888)，作者 [@Cprakhar](https://github.com/Cprakhar)）
* **PostgreSQL：部分索引支持** —— 添加对 PostgreSQL 部分索引的支持（[#11318](https://github.com/typeorm/typeorm/pull/11318)，作者 [@freePixel](https://github.com/freePixel)）
* **SAP HANA：SELECT 中的锁** —— SAP HANA 查询现在支持 `FOR UPDATE` 及其他锁模式（[#11996](https://github.com/typeorm/typeorm/pull/11996)，作者 [@alumni](https://github.com/alumni)）
* **SAP HANA：表注释** —— `@Entity({ comment: "..." })` 现在在 SAP HANA 上可用（[#11939](https://github.com/typeorm/typeorm/pull/11939)，作者 [@Cprakhar](https://github.com/Cprakhar)）
* **SAP HANA：连接池超时** —— 新增 `maxWaitTimeoutIfPoolExhausted` 连接池选项（[#11868](https://github.com/typeorm/typeorm/pull/11868)，作者 [@alumni](https://github.com/alumni)）
* **SAP HANA：生成列** —— `@Column({ generatedType: "STORED", asExpression: "..." })` 现在在 SAP HANA 中受支持（[#12393](https://github.com/typeorm/typeorm/pull/12393)，作者 [@Cprakhar](https://github.com/Cprakhar)）
* **SQLite：`jsonb` 列类型** —— SQLite 现在支持 `jsonb` 列类型（[#11933](https://github.com/typeorm/typeorm/pull/11933)，作者 [@Cprakhar](https://github.com/Cprakhar)）
* **MongoDB：基于对象的 `select` 投影** —— `find*()` 方法现在除了已有的字符串数组形式外，还接受其他驱动所使用的同样的对象式 `select` 语法（`select: { id: true, name: true }`）（[#12237](https://github.com/typeorm/typeorm/pull/12237)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **React Native：加密密钥** —— 新增选项，用于为 React Native SQLite 数据库传入加密密钥（[#11736](https://github.com/typeorm/typeorm/pull/11736)，作者 [@HtSpChakradharCholleti](https://github.com/HtSpChakradharCholleti)）

<!-- EN -->
### Persistence & Upsert

<!-- ZH -->
### 持久化与 Upsert

<!-- EN -->
* **Cascade truncate in `clear()`** — `Repository.clear()` and `EntityManager.clear()` now accept `{ cascade: true }` to issue `TRUNCATE ... CASCADE` on PostgreSQL, CockroachDB, and Oracle ([#11866](https://github.com/typeorm/typeorm/pull/11866) by [@Cprakhar](https://github.com/Cprakhar))
* **Better typing for `increment`/`decrement`** — conditions parameter now uses proper entity-aware types instead of `any` ([#11294](https://github.com/typeorm/typeorm/pull/11294) by [@OSA413](https://github.com/OSA413))

<!-- ZH -->
* **`clear()` 中的级联截断** —— `Repository.clear()` 和 `EntityManager.clear()` 现在接受 `{ cascade: true }`，会在 PostgreSQL、CockroachDB 和 Oracle 上发出 `TRUNCATE ... CASCADE`（[#11866](https://github.com/typeorm/typeorm/pull/11866)，作者 [@Cprakhar](https://github.com/Cprakhar)）
* **`increment`/`decrement` 的类型改进** —— conditions 参数现在使用正确的、感知实体的类型，而不是 `any`（[#11294](https://github.com/typeorm/typeorm/pull/11294)，作者 [@OSA413](https://github.com/OSA413)）

<!-- EN -->
### Column types & Decorators

<!-- ZH -->
### 列类型与装饰器

<!-- EN -->
* **Deferrable support on `@Exclusion`** — mirrors the existing deferrable support on `@Unique` and `@Index` ([#11802](https://github.com/typeorm/typeorm/pull/11802) by [@oGAD31](https://github.com/oGAD31))

<!-- ZH -->
* **`@Exclusion` 上的 deferrable 支持** —— 与 `@Unique` 和 `@Index` 上已有的 deferrable 支持保持一致（[#11802](https://github.com/typeorm/typeorm/pull/11802)，作者 [@oGAD31](https://github.com/oGAD31)）

<!-- EN -->
### Other

<!-- ZH -->
### 其他

<!-- EN -->
* **Automated codemod for v1 migration** — the new `@typeorm/codemod` package automates most breaking changes: run `npx @typeorm/codemod v1 src/` to update imports, API renames, find option syntax, and more ([#12233](https://github.com/typeorm/typeorm/pull/12233) by [@pkuczynski](https://github.com/pkuczynski))
* **Improved ormconfig error handling** — loading failures now log warnings instead of silently failing ([#11871](https://github.com/typeorm/typeorm/pull/11871) by [@Cprakhar](https://github.com/Cprakhar))

<!-- ZH -->
* **面向 v1 迁移的自动化 codemod** —— 新的 `@typeorm/codemod` 包可自动处理大部分破坏性变更：运行 `npx @typeorm/codemod v1 src/` 即可更新导入、API 重命名、查找选项语法等（[#12233](https://github.com/typeorm/typeorm/pull/12233)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **改进的 ormconfig 错误处理** —— 加载失败现在会记录警告，而不是静默失败（[#11871](https://github.com/typeorm/typeorm/pull/11871)，作者 [@Cprakhar](https://github.com/Cprakhar)）

<!-- EN -->
## Bug fixes

<!-- ZH -->
## Bug 修复

<!-- EN -->
### Query generation

<!-- ZH -->
### 查询生成

<!-- EN -->
* **Column alias properly escaped in `orderBy`** — prevents SQL errors when alias names conflict with reserved words ([#12027](https://github.com/typeorm/typeorm/pull/12027) by [@Cprakhar](https://github.com/Cprakhar))
* **`addOrderBy` resolves database column names** — using the database column name (e.g., `created_at`) instead of the property name now works correctly ([#11904](https://github.com/typeorm/typeorm/pull/11904) by [@smith-xyz](https://github.com/smith-xyz))
* **Order subquery column resolution** — fixed "Cannot get metadata for given alias" error when ordering by subquery columns ([#11343](https://github.com/typeorm/typeorm/pull/11343) by [@trannhan0810](https://github.com/trannhan0810))
* **`select` column ordering preserved** — `getQuery()`/`getSql()` now returns columns in the order they were added via `select()` and `addSelect()` ([#11902](https://github.com/typeorm/typeorm/pull/11902) by [@Cprakhar](https://github.com/Cprakhar))
* **`.update()` query generation fixed** — corrected incorrect SQL generation when using QueryBuilder `.update()` ([#11993](https://github.com/typeorm/typeorm/pull/11993) by [@gioboa](https://github.com/gioboa))
* **Upsert SQL generation with table alias** — fixed incorrect column references in upsert queries with table inheritance and custom schemas ([#11915](https://github.com/typeorm/typeorm/pull/11915) by [@Cprakhar](https://github.com/Cprakhar))
* **Limit with joins** — fixed incorrect results when using `skip`/`take` pagination with joins ([#11987](https://github.com/typeorm/typeorm/pull/11987) by [@gioboa](https://github.com/gioboa))
* **Join attributes inside brackets** — fixed join parsing when conditions contain brackets ([#11218](https://github.com/typeorm/typeorm/pull/11218) by [@balkrushna](https://github.com/balkrushna))
* **Disable global `ORDER BY` for aggregate functions** — `repo.max()`, `repo.min()`, etc. no longer produce invalid SQL with an `ORDER BY` clause ([#11925](https://github.com/typeorm/typeorm/pull/11925) by [@Cprakhar](https://github.com/Cprakhar))
* **Pagination subquery includes joined entity PKs** — `leftJoin` with `skip`/`take` now correctly loads related entities ([#11669](https://github.com/typeorm/typeorm/pull/11669) by [@mag123c](https://github.com/mag123c))
* **Alias shortening with camelCase** — the `shorten` method now correctly handles `camelCase_aliases` ([#11283](https://github.com/typeorm/typeorm/pull/11283) by [@OSA413](https://github.com/OSA413))
* **Entity typing for `QueryBuilder.update()`** — the `update(partialEntity)` signature now uses a proper entity-aware type instead of a loose object ([#11296](https://github.com/typeorm/typeorm/pull/11296) by [@OSA413](https://github.com/OSA413))
* **Log query whitespace** — trailing and leading whitespace is no longer included in logged query strings ([#12047](https://github.com/typeorm/typeorm/pull/12047) by [@Cprakhar](https://github.com/Cprakhar))
* **`JsonContains` accepts array values** — `JsonContains([...])` no longer throws and produces the expected `@>` containment predicate on PostgreSQL ([#12420](https://github.com/typeorm/typeorm/pull/12420) by [@kyungseopk1m](https://github.com/kyungseopk1m))
* **MSSQL computed columns join scope** — schema introspection of computed columns is now scoped to the correct table when multiple tables share column names ([#12288](https://github.com/typeorm/typeorm/pull/12288) by [@PreAgile](https://github.com/PreAgile))

<!-- ZH -->
* **`orderBy` 中的列别名被正确转义** —— 避免别名与保留字冲突时出现 SQL 错误（[#12027](https://github.com/typeorm/typeorm/pull/12027)，作者 [@Cprakhar](https://github.com/Cprakhar)）
* **`addOrderBy` 能解析数据库列名** —— 现在使用数据库列名（例如 `created_at`）代替属性名也能正确工作（[#11904](https://github.com/typeorm/typeorm/pull/11904)，作者 [@smith-xyz](https://github.com/smith-xyz)）
* **子查询列排序解析** —— 修复了按子查询列排序时出现 "Cannot get metadata for given alias" 错误的问题（[#11343](https://github.com/typeorm/typeorm/pull/11343)，作者 [@trannhan0810](https://github.com/trannhan0810)）
* **保留 `select` 的列顺序** —— `getQuery()`/`getSql()` 现在按通过 `select()` 和 `addSelect()` 添加的顺序返回列（[#11902](https://github.com/typeorm/typeorm/pull/11902)，作者 [@Cprakhar](https://github.com/Cprakhar)）
* **修复 `.update()` 的查询生成** —— 修正了使用 QueryBuilder `.update()` 时生成错误 SQL 的问题（[#11993](https://github.com/typeorm/typeorm/pull/11993)，作者 [@gioboa](https://github.com/gioboa)）
* **带表别名的 upsert SQL 生成** —— 修复了带表继承和自定义模式的 upsert 查询中列引用错误的问题（[#11915](https://github.com/typeorm/typeorm/pull/11915)，作者 [@Cprakhar](https://github.com/Cprakhar)）
* **带连接的 limit** —— 修复了带连接使用 `skip`/`take` 分页时结果错误的问题（[#11987](https://github.com/typeorm/typeorm/pull/11987)，作者 [@gioboa](https://github.com/gioboa)）
* **括号内的连接属性** —— 修复了条件中包含括号时的连接解析问题（[#11218](https://github.com/typeorm/typeorm/pull/11218)，作者 [@balkrushna](https://github.com/balkrushna)）
* **为聚合函数禁用全局 `ORDER BY`** —— `repo.max()`、`repo.min()` 等不再生成带 `ORDER BY` 子句的非法 SQL（[#11925](https://github.com/typeorm/typeorm/pull/11925)，作者 [@Cprakhar](https://github.com/Cprakhar)）
* **分页子查询包含被连接实体的主键** —— 带 `skip`/`take` 的 `leftJoin` 现在能正确加载关联实体（[#11669](https://github.com/typeorm/typeorm/pull/11669)，作者 [@mag123c](https://github.com/mag123c)）
* **camelCase 别名缩短** —— `shorten` 方法现在能正确处理 `camelCase_aliases`（[#11283](https://github.com/typeorm/typeorm/pull/11283)，作者 [@OSA413](https://github.com/OSA413)）
* **`QueryBuilder.update()` 的实体类型** —— `update(partialEntity)` 签名现在使用正确的、感知实体的类型，而不是松散的对象（[#11296](https://github.com/typeorm/typeorm/pull/11296)，作者 [@OSA413](https://github.com/OSA413)）
* **日志查询空白** —— 记录的查询字符串不再包含首尾空白（[#12047](https://github.com/typeorm/typeorm/pull/12047)，作者 [@Cprakhar](https://github.com/Cprakhar)）
* **`JsonContains` 接受数组值** —— `JsonContains([...])` 不再抛出错误，并在 PostgreSQL 上生成预期的 `@>` 包含谓词（[#12420](https://github.com/typeorm/typeorm/pull/12420)，作者 [@kyungseopk1m](https://github.com/kyungseopk1m)）
* **MSSQL 计算列的连接作用域** —— 当多张表共享列名时，计算列的结构自省现在限定在正确的表上（[#12288](https://github.com/typeorm/typeorm/pull/12288)，作者 [@PreAgile](https://github.com/PreAgile)）

<!-- EN -->
### Relations & Eager loading

<!-- ZH -->
### 关系与急加载

<!-- EN -->
* **Orphaned one-to-many children with non-nullable FK are now deleted** — when saving a one-to-many relation with cascade and replacing children, orphaned rows with a non-nullable FK are now deleted instead of failing with a constraint violation; nullable FK rows are still nullified as before ([#11982](https://github.com/typeorm/typeorm/pull/11982) by [@naorpeled](https://github.com/naorpeled))
* **Eager relations now respect `relationLoadStrategy: "query"`** — eager relations are loaded via separate queries when the `"query"` strategy is set, instead of always using JOINs ([#11326](https://github.com/typeorm/typeorm/pull/11326) by [@SharkSharp](https://github.com/SharkSharp), [#12256](https://github.com/typeorm/typeorm/pull/12256) by [@pkuczynski](https://github.com/pkuczynski))
* **Self-referencing relation alias collision** — self-referencing relations with `relationLoadStrategy: "query"` no longer produce incorrect SQL due to alias collision ([#11066](https://github.com/typeorm/typeorm/pull/11066) by [@campmarc](https://github.com/campmarc))
* **Eager relations no longer joined twice** — explicitly specifying an eager relation in `relations` no longer causes duplicate JOINs ([#11991](https://github.com/typeorm/typeorm/pull/11991) by [@veeceey](https://github.com/veeceey))
* **Save with eagerly loaded relations** — fixed save failures when an entity has eagerly loaded relations ([#11975](https://github.com/typeorm/typeorm/pull/11975) by [@gioboa](https://github.com/gioboa))
* **Columns with `select: false` no longer returned by read queries** — columns marked with `select: false` are now correctly excluded from `find` and query-builder results; use `addSelect` to opt-in. Note that `select: false` only controls what is loaded from the database on a read — the in-memory entity returned by `repository.save()` (and the reference you passed in) is left untouched, so any value you supplied is still available on it after persistence ([#11944](https://github.com/typeorm/typeorm/pull/11944) by [@gioboa](https://github.com/gioboa), [#12501](https://github.com/typeorm/typeorm/pull/12501) by [@tada5hi](https://github.com/tada5hi))
* **Subquery with `joinMapOne` methods** — fixed incorrect behavior when using join map methods ([#11943](https://github.com/typeorm/typeorm/pull/11943) by [@gioboa](https://github.com/gioboa))
* **Relation IDs in nested embedded entities** — fixed `TypeError: Cannot set properties of undefined` when mapping relation IDs within embedded entities ([#11942](https://github.com/typeorm/typeorm/pull/11942) by [@Cprakhar](https://github.com/Cprakhar))
* **`RelationIdLoader` alias handling** — uses `DriverUtils.getAlias` to prevent alias trimming by databases with short identifier limits ([#11228](https://github.com/typeorm/typeorm/pull/11228) by [@te1](https://github.com/te1))
* **`*-to-many` in `createPropertyPath`** — removed incorrect error handling that prevented certain relation configurations ([#11119](https://github.com/typeorm/typeorm/pull/11119) by [@ThbltLmr](https://github.com/ThbltLmr))
* **Cascade remove on `OneToMany` with composite primary keys** — `cascade: ["remove"]` now correctly propagates the delete to child entities when the target has a composite PK; previously `CascadesSubjectBuilder` never marked these children as `mustBeRemoved`, causing FK constraint violations ([#12286](https://github.com/typeorm/typeorm/pull/12286) by [@pkuczynski](https://github.com/pkuczynski))
* **`withDeleted` propagated to relation-id loader for many-to-many recover** — recovering a soft-removed entity with many-to-many relations no longer tries to re-insert existing junction rows; `RelationIdLoader` now includes soft-deleted entities when the parent query has `withDeleted` set ([#12287](https://github.com/typeorm/typeorm/pull/12287) by [@pkuczynski](https://github.com/pkuczynski))

<!-- ZH -->
* **带非空外键的孤儿一对多子对象现在会被删除** —— 保存带级联的一对多关系并替换子对象时，带非空外键的孤儿行现在会被删除，而不是因约束冲突而失败；可空外键的行仍像以前一样被置空（[#11982](https://github.com/typeorm/typeorm/pull/11982)，作者 [@naorpeled](https://github.com/naorpeled)）
* **急加载关系现在遵循 `relationLoadStrategy: "query"`** —— 设置 `"query"` 策略时，急加载关系会通过独立查询加载，而不是总是使用 JOIN（[#11326](https://github.com/typeorm/typeorm/pull/11326)，作者 [@SharkSharp](https://github.com/SharkSharp)；[#12256](https://github.com/typeorm/typeorm/pull/12256)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **自引用关系别名冲突** —— 使用 `relationLoadStrategy: "query"` 的自引用关系不再因别名冲突而生成错误 SQL（[#11066](https://github.com/typeorm/typeorm/pull/11066)，作者 [@campmarc](https://github.com/campmarc)）
* **急加载关系不再被连接两次** —— 在 `relations` 中显式指定一个急加载关系不再导致重复的 JOIN（[#11991](https://github.com/typeorm/typeorm/pull/11991)，作者 [@veeceey](https://github.com/veeceey)）
* **带急加载关系的保存** —— 修复了实体带有急加载关系时的保存失败问题（[#11975](https://github.com/typeorm/typeorm/pull/11975)，作者 [@gioboa](https://github.com/gioboa)）
* **`select: false` 的列不再被读查询返回** —— 标记为 `select: false` 的列现在会正确地从 `find` 和 query-builder 结果中排除；使用 `addSelect` 选择性加入。注意 `select: false` 只控制读取时从数据库加载什么——`repository.save()` 返回的内存中实体（以及你传入的引用）保持不变，因此你提供的任何值在持久化之后仍然可用（[#11944](https://github.com/typeorm/typeorm/pull/11944)，作者 [@gioboa](https://github.com/gioboa)；[#12501](https://github.com/typeorm/typeorm/pull/12501)，作者 [@tada5hi](https://github.com/tada5hi)）
* **配合 `joinMapOne` 方法的子查询** —— 修复了使用 join map 方法时的错误行为（[#11943](https://github.com/typeorm/typeorm/pull/11943)，作者 [@gioboa](https://github.com/gioboa)）
* **嵌套嵌入实体中的关系 ID** —— 修复了在嵌入实体内映射关系 ID 时出现 `TypeError: Cannot set properties of undefined` 的问题（[#11942](https://github.com/typeorm/typeorm/pull/11942)，作者 [@Cprakhar](https://github.com/Cprakhar)）
* **`RelationIdLoader` 别名处理** —— 使用 `DriverUtils.getAlias` 以防止标识符长度限制较短的数据库截断别名（[#11228](https://github.com/typeorm/typeorm/pull/11228)，作者 [@te1](https://github.com/te1)）
* **`createPropertyPath` 中的 `*-to-many`** —— 移除了阻止某些关系配置的错误错误处理（[#11119](https://github.com/typeorm/typeorm/pull/11119)，作者 [@ThbltLmr](https://github.com/ThbltLmr)）
* **带复合主键的 `OneToMany` 上的级联删除** —— 当目标有复合主键时，`cascade: ["remove"]` 现在能正确地把删除传播给子实体；此前 `CascadesSubjectBuilder` 从未把这些子对象标记为 `mustBeRemoved`，导致外键约束冲突（[#12286](https://github.com/typeorm/typeorm/pull/12286)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **`withDeleted` 传播到多对多恢复的关系 id 加载器** —— 恢复带多对多关系的软删除实体时不再尝试重新插入已存在的中间表行；当父查询设置了 `withDeleted` 时，`RelationIdLoader` 现在会包含软删除的实体（[#12287](https://github.com/typeorm/typeorm/pull/12287)，作者 [@pkuczynski](https://github.com/pkuczynski)）

<!-- EN -->
### Persistence

<!-- ZH -->
### 持久化

<!-- EN -->
* **Upsert with `update: false` or `generatedType`** — upsert now correctly handles columns that should not be updated ([#12030](https://github.com/typeorm/typeorm/pull/12030) by [@gioboa](https://github.com/gioboa))
* **Value transformers applied to `FindOperator`s** — `ApplyValueTransformers` now correctly transforms values inside `FindOperator` instances like `In`, `Between`, etc. ([#11172](https://github.com/typeorm/typeorm/pull/11172) by [@ZimGil](https://github.com/ZimGil))
* **Soft deletion no longer updates already soft-deleted rows** — `softDelete` and `softRemove` now skip rows that are already soft-deleted ([#10705](https://github.com/typeorm/typeorm/pull/10705) by [@hassanmehdi98](https://github.com/hassanmehdi98))
* **Entity merge respects `null` values** — merging into an entity no longer silently drops `null` property values ([#11154](https://github.com/typeorm/typeorm/pull/11154) by [@knoid](https://github.com/knoid))
* **Map/object comparison** — fixed incorrect change detection for Map and plain object column values ([#10990](https://github.com/typeorm/typeorm/pull/10990) by [@mgohin](https://github.com/mgohin))
* **Date transformer change detection** — fixed false-positive dirty detection with date value transformers ([#11963](https://github.com/typeorm/typeorm/pull/11963) by [@gioboa](https://github.com/gioboa))
* **Child mpath update** — tree entity mpath is now correctly updated when re-parenting, even with soft-deleted parents ([#10844](https://github.com/typeorm/typeorm/pull/10844) by [@JoseCToscano](https://github.com/JoseCToscano))
* **Closure junction table schema/database propagation** — schema and database settings are now correctly propagated to closure junction tables ([#12110](https://github.com/typeorm/typeorm/pull/12110) by [@pkuczynski](https://github.com/pkuczynski))
* **Virtual property handling in schema builder** — schema builder no longer attempts to create columns for virtual properties ([#11000](https://github.com/typeorm/typeorm/pull/11000) by [@skyran1278](https://github.com/skyran1278))
* **Nameless `TableForeignKey` drop** — dropping a foreign key without an explicit name no longer fails ([#10744](https://github.com/typeorm/typeorm/pull/10744) by [@taichunmin](https://github.com/taichunmin))
* **`getPendingMigrations` no longer creates the migrations table** — checking for pending migrations no longer has side effects ([#11672](https://github.com/typeorm/typeorm/pull/11672) by [@pkuczynski](https://github.com/pkuczynski))
* **Many-to-many `deferrable` foreign keys** — `@ManyToMany` now honors the `deferrable` option on the junction table's foreign keys ([#11924](https://github.com/typeorm/typeorm/pull/11924) by [@smith-xyz](https://github.com/smith-xyz))
* **Composite foreign key column order** — schema builder sorts referenced columns in composite foreign keys to match the referenced primary key index order, preventing MySQL / MSSQL / SAP HANA from rejecting the constraint ([#12280](https://github.com/typeorm/typeorm/pull/12280) by [@pkuczynski](https://github.com/pkuczynski))
* **User-defined shared join columns preserved in change set** — explicit `@JoinColumn` entries shared between relations are no longer dropped during persistence ([#12354](https://github.com/typeorm/typeorm/pull/12354) by [@PreAgile](https://github.com/PreAgile))

<!-- ZH -->
* **带 `update: false` 或 `generatedType` 的 upsert** —— upsert 现在能正确处理那些不应被更新的列（[#12030](https://github.com/typeorm/typeorm/pull/12030)，作者 [@gioboa](https://github.com/gioboa)）
* **值转换器应用于 `FindOperator`** —— `ApplyValueTransformers` 现在能正确转换 `In`、`Between` 等 `FindOperator` 实例内部的值（[#11172](https://github.com/typeorm/typeorm/pull/11172)，作者 [@ZimGil](https://github.com/ZimGil)）
* **软删除不再更新已软删除的行** —— `softDelete` 和 `softRemove` 现在会跳过已经软删除的行（[#10705](https://github.com/typeorm/typeorm/pull/10705)，作者 [@hassanmehdi98](https://github.com/hassanmehdi98)）
* **实体合并尊重 `null` 值** —— 合并进实体时不再静默丢弃值为 `null` 的属性（[#11154](https://github.com/typeorm/typeorm/pull/11154)，作者 [@knoid](https://github.com/knoid)）
* **Map/对象比较** —— 修复了 Map 和普通对象列值的变更检测错误（[#10990](https://github.com/typeorm/typeorm/pull/10990)，作者 [@mgohin](https://github.com/mgohin)）
* **日期转换器变更检测** —— 修复了带日期值转换器时的误报脏检测（[#11963](https://github.com/typeorm/typeorm/pull/11963)，作者 [@gioboa](https://github.com/gioboa)）
* **子 mpath 更新** —— 重新指定父节点时，树形实体的 mpath 现在会被正确更新，即使父节点是软删除的（[#10844](https://github.com/typeorm/typeorm/pull/10844)，作者 [@JoseCToscano](https://github.com/JoseCToscano)）
* **闭包中间表的模式/数据库传播** —— 模式和数据库设置现在会正确传播到闭包中间表（[#12110](https://github.com/typeorm/typeorm/pull/12110)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **结构构建器中的虚拟属性处理** —— 结构构建器不再尝试为虚拟属性创建列（[#11000](https://github.com/typeorm/typeorm/pull/11000)，作者 [@skyran1278](https://github.com/skyran1278)）
* **无名 `TableForeignKey` 的删除** —— 删除没有显式名称的外键不再失败（[#10744](https://github.com/typeorm/typeorm/pull/10744)，作者 [@taichunmin](https://github.com/taichunmin)）
* **`getPendingMigrations` 不再创建迁移表** —— 检查待执行迁移不再有副作用（[#11672](https://github.com/typeorm/typeorm/pull/11672)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **多对多 `deferrable` 外键** —— `@ManyToMany` 现在会在中间表的外键上采纳 `deferrable` 选项（[#11924](https://github.com/typeorm/typeorm/pull/11924)，作者 [@smith-xyz](https://github.com/smith-xyz)）
* **复合外键列顺序** —— 结构构建器会对复合外键中被引用的列排序，使其与被引用主键的索引顺序一致，避免 MySQL / MSSQL / SAP HANA 拒绝该约束（[#12280](https://github.com/typeorm/typeorm/pull/12280)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **变更集中保留用户定义的共享连接列** —— 多个关系之间共享的显式 `@JoinColumn` 条目不再在持久化过程中被丢弃（[#12354](https://github.com/typeorm/typeorm/pull/12354)，作者 [@PreAgile](https://github.com/PreAgile)）

<!-- EN -->
### Driver-specific fixes

<!-- ZH -->
### 驱动专属修复

<!-- EN -->
* **PostgreSQL: `timestamptz` persistence/hydration** — `timestamp with time zone` columns now persist and hydrate correctly ([#11774](https://github.com/typeorm/typeorm/pull/11774) by [@Minishlink](https://github.com/Minishlink))
* **PostgreSQL: geometric type re-save** — point/circle values are now normalized on persist to avoid invalid input errors when re-saving hydrated objects ([#11857](https://github.com/typeorm/typeorm/pull/11857) by [@Cprakhar](https://github.com/Cprakhar))
* **PostgreSQL/CockroachDB: tables with quoted names** — fixed handling of tables with special characters in names ([#10993](https://github.com/typeorm/typeorm/pull/10993) by [@iskalyakin](https://github.com/iskalyakin))
* **PostgreSQL: sequential query execution** — queries are now executed sequentially on the same connection to avoid `pg` 8.19.0 deprecation warnings, including remaining relation-load and persistence paths ([#12105](https://github.com/typeorm/typeorm/pull/12105) by [@pkuczynski](https://github.com/pkuczynski), [#12421](https://github.com/typeorm/typeorm/pull/12421) by [@kyungseopk1m](https://github.com/kyungseopk1m))
* **MySQL: PolarDB-X 2.0 version detection** — `getVersion()` no longer returns `undefined` for PolarDB-X 2.0 ([#11837](https://github.com/typeorm/typeorm/pull/11837) by [@Missna](https://github.com/Missna))
* **MongoDB: `ObjectIdColumn` property name translation** — `findOneBy({ id: value })` now correctly translates to `_id` in MongoDB queries ([#12200](https://github.com/typeorm/typeorm/pull/12200) by [@pkuczynski](https://github.com/pkuczynski))
* **MongoDB: embedded arrays of nested documents** — correctly processes embedded arrays within nested document structures ([#10940](https://github.com/typeorm/typeorm/pull/10940) by [@mciuchitu](https://github.com/mciuchitu))
* **SQLite: simple-enum arrays** — `simple-enum` columns with `array: true` no longer fail with CHECK constraint errors ([#11865](https://github.com/typeorm/typeorm/pull/11865) by [@Cprakhar](https://github.com/Cprakhar))
* **SAP HANA: `Date` parameter escaping** — JS `Date` values are now passed as query parameters instead of being embedded in SQL strings ([#11867](https://github.com/typeorm/typeorm/pull/11867) by [@alumni](https://github.com/alumni))
* **CockroachDB: structured query results in txn retry** — the `useStructuredResult` flag is now preserved during CockroachDB transaction retry replay ([#11861](https://github.com/typeorm/typeorm/pull/11861) by [@naorpeled](https://github.com/naorpeled))
* **Cordova: query rows affected** — query results now include the count of affected rows ([#10873](https://github.com/typeorm/typeorm/pull/10873) by [@jacobg](https://github.com/jacobg))
* **PostgreSQL / CockroachDB: enum value declaration order** — enum values are now loaded in their declared order, so generated migrations no longer churn when nothing has changed ([#12404](https://github.com/typeorm/typeorm/pull/12404) by [@pkuczynski](https://github.com/pkuczynski))
* **Expo: auto-load `expo-sqlite`** — the Expo driver loads `expo-sqlite` through `loadDependencies()`, removing the need to pass the module explicitly ([#12363](https://github.com/typeorm/typeorm/pull/12363) by [@pkuczynski](https://github.com/pkuczynski))

<!-- ZH -->
* **PostgreSQL：`timestamptz` 持久化/水合** —— `timestamp with time zone` 列现在能正确持久化和读取（[#11774](https://github.com/typeorm/typeorm/pull/11774)，作者 [@Minishlink](https://github.com/Minishlink)）
* **PostgreSQL：几何类型重复保存** —— point/circle 值现在会在持久化时被规范化，避免重新保存已读取对象时出现非法输入错误（[#11857](https://github.com/typeorm/typeorm/pull/11857)，作者 [@Cprakhar](https://github.com/Cprakhar)）
* **PostgreSQL/CockroachDB：带引号表名的表** —— 修复了名称中含特殊字符的表的处理（[#10993](https://github.com/typeorm/typeorm/pull/10993)，作者 [@iskalyakin](https://github.com/iskalyakin)）
* **PostgreSQL：顺序执行查询** —— 现在查询会在同一连接上顺序执行，以避免 `pg` 8.19.0 的弃用警告，包括其余的关系加载和持久化路径（[#12105](https://github.com/typeorm/typeorm/pull/12105)，作者 [@pkuczynski](https://github.com/pkuczynski)；[#12421](https://github.com/typeorm/typeorm/pull/12421)，作者 [@kyungseopk1m](https://github.com/kyungseopk1m)）
* **MySQL：PolarDB-X 2.0 版本检测** —— `getVersion()` 对 PolarDB-X 2.0 不再返回 `undefined`（[#11837](https://github.com/typeorm/typeorm/pull/11837)，作者 [@Missna](https://github.com/Missna)）
* **MongoDB：`ObjectIdColumn` 属性名转换** —— `findOneBy({ id: value })` 现在能在 MongoDB 查询中正确转换为 `_id`（[#12200](https://github.com/typeorm/typeorm/pull/12200)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **MongoDB：嵌套文档的嵌入数组** —— 正确处理嵌套文档结构中的嵌入数组（[#10940](https://github.com/typeorm/typeorm/pull/10940)，作者 [@mciuchitu](https://github.com/mciuchitu)）
* **SQLite：simple-enum 数组** —— 带 `array: true` 的 `simple-enum` 列不再因 CHECK 约束错误而失败（[#11865](https://github.com/typeorm/typeorm/pull/11865)，作者 [@Cprakhar](https://github.com/Cprakhar)）
* **SAP HANA：`Date` 参数转义** —— JS `Date` 值现在作为查询参数传递，而不是被嵌入 SQL 字符串中（[#11867](https://github.com/typeorm/typeorm/pull/11867)，作者 [@alumni](https://github.com/alumni)）
* **CockroachDB：事务重试中的结构化查询结果** —— `useStructuredResult` 标志现在会在 CockroachDB 事务重试重放期间被保留（[#11861](https://github.com/typeorm/typeorm/pull/11861)，作者 [@naorpeled](https://github.com/naorpeled)）
* **Cordova：查询影响行数** —— 查询结果现在包含受影响行数（[#10873](https://github.com/typeorm/typeorm/pull/10873)，作者 [@jacobg](https://github.com/jacobg)）
* **PostgreSQL / CockroachDB：枚举值声明顺序** —— 枚举值现在按其声明顺序加载，因此在没有任何变化时生成的迁移不再反复变动（[#12404](https://github.com/typeorm/typeorm/pull/12404)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **Expo：自动加载 `expo-sqlite`** —— Expo 驱动通过 `loadDependencies()` 加载 `expo-sqlite`，不再需要显式传入该模块（[#12363](https://github.com/typeorm/typeorm/pull/12363)，作者 [@pkuczynski](https://github.com/pkuczynski)）

<!-- EN -->
### Other

<!-- ZH -->
### 其他

<!-- EN -->
* **CLI `init` command** — no longer crashes when `package.json` does not exist ([#11947](https://github.com/typeorm/typeorm/pull/11947) by [@gioboa](https://github.com/gioboa)); published package now correctly includes `devDependencies` needed for scaffolding ([#12281](https://github.com/typeorm/typeorm/pull/12281) by [@pkuczynski](https://github.com/pkuczynski)); no longer runs `npm install` during init, so it works in offline or non-Node project setups ([#12386](https://github.com/typeorm/typeorm/pull/12386) by [@alumni](https://github.com/alumni))
* **Deno `process` import** — fixed incorrect import for the `process` dependency on Deno ([#11248](https://github.com/typeorm/typeorm/pull/11248) by [@yohannpoli](https://github.com/yohannpoli))
* **Query stack traces preserved for MySQL/MSSQL** — driver errors now retain the originating call site, making query failures easier to debug ([#12056](https://github.com/typeorm/typeorm/pull/12056) by [@Cprakhar](https://github.com/Cprakhar))

<!-- ZH -->
* **CLI `init` 命令** —— `package.json` 不存在时不再崩溃（[#11947](https://github.com/typeorm/typeorm/pull/11947)，作者 [@gioboa](https://github.com/gioboa)）；发布的包现在正确包含脚手架所需的 `devDependencies`（[#12281](https://github.com/typeorm/typeorm/pull/12281)，作者 [@pkuczynski](https://github.com/pkuczynski)）；init 期间不再运行 `npm install`，因此在离线或非 Node 项目环境中也能工作（[#12386](https://github.com/typeorm/typeorm/pull/12386)，作者 [@alumni](https://github.com/alumni)）
* **Deno `process` 导入** —— 修复了 Deno 上 `process` 依赖的错误导入（[#11248](https://github.com/typeorm/typeorm/pull/11248)，作者 [@yohannpoli](https://github.com/yohannpoli)）
* **为 MySQL/MSSQL 保留查询堆栈跟踪** —— 驱动错误现在会保留最初的调用位置，让查询失败更容易调试（[#12056](https://github.com/typeorm/typeorm/pull/12056)，作者 [@Cprakhar](https://github.com/Cprakhar)）

<!-- EN -->
## Security fixes

<!-- ZH -->
## 安全修复

<!-- EN -->
* **SQL injection prevention** — parameterized queries and escaped identifiers are now used across all drivers for schema introspection and DDL methods, preventing SQL injection via database/schema/table/column names ([#12207](https://github.com/typeorm/typeorm/pull/12207) by [@pkuczynski](https://github.com/pkuczynski), [#12197](https://github.com/typeorm/typeorm/pull/12197) by [@pkuczynski](https://github.com/pkuczynski), [#12185](https://github.com/typeorm/typeorm/pull/12185) by [@pkuczynski](https://github.com/pkuczynski))
* **OrderBy condition validation** — QueryBuilder `orderBy` and `addOrderBy` now validate condition values at runtime, preventing injection via order expressions ([#12217](https://github.com/typeorm/typeorm/pull/12217) by [@pkuczynski](https://github.com/pkuczynski))
* **`.limit()` validated on Update/SoftDelete query builders** — non-numeric values passed to `.limit()` now throw at call time instead of being interpolated into SQL ([#12436](https://github.com/typeorm/typeorm/pull/12436) by [@smith-xyz](https://github.com/smith-xyz))

<!-- ZH -->
* **SQL 注入防护** —— 所有驱动的结构自省和 DDL 方法现在都使用参数化查询和转义后的标识符，防止通过数据库/模式/表/列名进行 SQL 注入（[#12207](https://github.com/typeorm/typeorm/pull/12207)，作者 [@pkuczynski](https://github.com/pkuczynski)；[#12197](https://github.com/typeorm/typeorm/pull/12197)，作者 [@pkuczynski](https://github.com/pkuczynski)；[#12185](https://github.com/typeorm/typeorm/pull/12185)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **OrderBy 条件校验** —— QueryBuilder 的 `orderBy` 和 `addOrderBy` 现在会在运行时校验条件值，防止通过排序表达式注入（[#12217](https://github.com/typeorm/typeorm/pull/12217)，作者 [@pkuczynski](https://github.com/pkuczynski)）
* **在 Update/SoftDelete query builder 上校验 `.limit()`** —— 传给 `.limit()` 的非数字值现在会在调用时抛出错误，而不是被插值进 SQL（[#12436](https://github.com/typeorm/typeorm/pull/12436)，作者 [@smith-xyz](https://github.com/smith-xyz)）

<!-- EN -->
## Performance improvements

<!-- ZH -->
## 性能改进

<!-- EN -->
* **PostgreSQL / CockroachDB: batched DROP in `clearDatabase()`** — consolidates individual DROP statements into single batched queries, significantly reducing round-trips during test setup ([#12164](https://github.com/typeorm/typeorm/pull/12164), [#12159](https://github.com/typeorm/typeorm/pull/12159) by [@pkuczynski](https://github.com/pkuczynski))

<!-- ZH -->
* **PostgreSQL / CockroachDB：`clearDatabase()` 中批量 DROP** —— 把单独的 DROP 语句合并成单条批量查询，显著减少测试准备期间的往返次数（[#12164](https://github.com/typeorm/typeorm/pull/12164)、[#12159](https://github.com/typeorm/typeorm/pull/12159)，作者 [@pkuczynski](https://github.com/pkuczynski)）
