TypeORM 1.x: upgrading from 0.3 (Node 20+, removed Connection/global APIs, driver changes)
TypeORM 1.x: upgrading from 0.3 (Node 20+, removed Connection/global APIs, driver changes)
TypeORM 1.0.0 shipped 2026-05-19 (current 1.1.1, 2026-09-01). It requires Node 20+, removes Connection and all global helpers, drops string-based find options, sqlite3 and mysql drivers, and now throws on null/undefined where values. A codemod exists.
TypeORM 1.x upgrade from 0.3
As of: 2026-10
Versions
typeorm@1.0.0was released 2026-05-19.1.1.0followed on 2026-07-13 and1.1.1(npmlatest) on 2026-09-01.- The 0.3 line is in maintenance under the npm
legacytag; its newest release is0.3.31(2026-07-13). - Requirements: Node.js 20+ and a JavaScript target of ES2023. On non-Node platforms,
Bufferis replaced withUint8Array.
Automated migration
npx @typeorm/codemod v1 src/ # add --dry to preview
The codemod handles most renames, such as connection to dataSource, and flags patterns it cannot rewrite.
Removed APIs and their replacements
| Removed (0.3) | Use in 1.x |
|---|---|
Connection, ConnectionOptions, ConnectionManager | DataSource, DataSourceOptions |
Global getRepository(), getManager(), getConnection() | dataSource.getRepository(), dataSource.manager |
findByIds([...]) | findBy({ id: In([...]) }) |
findOneById(id) | findOneBy({ id }) |
@EntityRepository, AbstractRepository, getCustomRepository | dataSource.getRepository(E).extend({...}) |
select: ["id"], relations: ["posts"] (string arrays), join find option | select: { id: true }, relations: { posts: true } |
TYPEORM_* env vars / ConnectionOptionsEnvReader | an explicit TS/JS DataSource file |
Also removed: Repository.exist(), @RelationCount, the IoC container system, QueryBuilder.onConflict(), the deprecated orUpdate() overload, and setNativeParameters(). The connection property was also renamed to dataSource on EntityManager, QueryBuilder, QueryRunner, Driver, the metadata classes and the subscriber event objects.
Driver changes
- MySQL/MariaDB: only
mysql2is supported, so remove themysqlpackage. Integer displaywidthandzerofillwere removed.legacySpatialSupportnow defaults tofalse. - SQLite:
sqlite3was dropped andbetter-sqlite3is now the default. ThebusyTimeoutoption was renamed totimeout. - MongoDB: requires driver v7+, and the deprecated connection options were removed.
- SQL Server: the
domainoption was removed. Useauthentication: { type: "ntlm", ... }instead. - The legacy Expo driver and support for old Redis client versions were removed.
Behaviour changes that break silently
invalidWhereValuesBehaviornow throws onnull/undefinedinwhere. Previously the condition was dropped, which could turn into a full-table match. UseIsNull()for intentional NULL checks:
repo.findBy({ deletedAt: IsNull() }); // not { deletedAt: null }
1.1.0 also applies the throw default to write paths and rejects empty where criteria on QueryBuilder update/delete.
- Relations declared
nullable: falseare loaded withINNER JOINinstead ofLEFT JOIN. - Cascade remove on one-to-many relations now works, including with composite primary keys. Code that relied on rows not being cascaded will behave differently.
What to do now
- New projects: use
typeorm@^1.1with aDataSourceand object-syntax find options. - 0.3 projects: upgrade Node, run the codemod, and swap the
sqlite3/mysqlpackages. Then search fornullvalues insidewhereobjects before deploying.