Skip to content

[Snyk] Upgrade typeorm from 0.2.24 to 0.3.31 - #1637

Open
andreiraca wants to merge 2 commits into
mainfrom
snyk-upgrade-88634490b592647bc91ef3089f6c6051
Open

[Snyk] Upgrade typeorm from 0.2.24 to 0.3.31#1637
andreiraca wants to merge 2 commits into
mainfrom
snyk-upgrade-88634490b592647bc91ef3089f6c6051

Conversation

@andreiraca

Copy link
Copy Markdown

snyk-top-banner

Snyk has created this PR to upgrade typeorm from 0.2.24 to 0.3.31.

ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.


  • The recommended version is 770 versions ahead of your current version.

  • The recommended version was released 23 days ago.

Issues fixed by the recommended upgrade:

Issue Score Exploit Maturity
high severity SQL Injection
SNYK-JS-TYPEORM-17391479
218 No Known Exploit
high severity Prototype Pollution
SNYK-JS-TYPEORM-590152
218 Mature
high severity Arbitrary Code Injection
SNYK-JS-TYPEORM-18170276
218 Proof of Concept
medium severity SQL Injection
SNYK-JS-TYPEORM-13746469
218 Proof of Concept
critical severity Function Call With Incorrect Argument Type
SNYK-JS-SHAJS-12089400
218 Proof of Concept
medium severity Prototype Pollution
SNYK-JS-HIGHLIGHTJS-1045326
218 No Known Exploit
medium severity Regular Expression Denial of Service (ReDoS)
SNYK-JS-HIGHLIGHTJS-1048676
218 No Known Exploit

Breaking Change Risk

Merge Risk: High

Notice: This assessment is enhanced by AI.

Release notes
Package name: typeorm

@andreiraca

Copy link
Copy Markdown
Author

Merge Risk: High

The upgrade from TypeORM version 0.2.24 to 0.3.31 is a major version jump that introduces significant and numerous breaking changes. This is not a simple upgrade and will require substantial code refactoring, particularly around database connection and data access patterns.

Key Breaking Changes:

  • DataSource API: The most significant change is the deprecation of createConnection() and getConnection(). You must now initialize and manage your database connection using the new DataSource object. This impacts how the application starts and how database configuration is handled.
  • Repository and Method Deprecations: Several widely-used methods have been deprecated or removed. getRepository() is deprecated, and methods like findOne(id) have had their signatures changed. The findAndCount method has been removed entirely and must be replaced with separate find and count calls.
  • Configuration Files: Support for ormconfig.json is deprecated. Configuration should be managed within the DataSource options object, typically in a datasource.ts file.
  • Query and Find Options: The join option within FindOptions (used in find methods) is deprecated. Complex queries with joins must now be written using the QueryBuilder.
  • CLI and Migrations: The command-line interface has been updated to work with the new DataSource configuration, requiring changes to package.json scripts for generating and running migrations.

Source: TypeORM Changelog, Migration discussions

Recommendation: This upgrade cannot be merged without a dedicated refactoring effort. Developers must carefully follow a migration guide to transition from the old connection and repository patterns to the new DataSource-centric approach. All database queries, especially those involving joins or deprecated methods, will need to be reviewed and updated.

Notice 🤖: This content was augmented using artificial intelligence. AI-generated content may contain errors and should be reviewed for accuracy before use.

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.

2 participants