5577 Commits

Author SHA1 Message Date
Prateek Hegde
9cdfb20b12
chore: bump sha.js from 2.4.11 to 2.4.12 (fix security issue: CVE-2025-9288) (#11639)
* chore: bump sha.js from 2.4.11 to 2.4.12 (fix security issue: CVE-2025-9288)

* test: add unit tests for hash() to ensure sha.js upgrade compatibility

- Verify SHA1 output for known inputs
- Test truncation with options.length
- Handle empty string input
- Confirm deterministic behavior for identical inputs

* removed .only from test/unit/util/string-utils.ts to run all the unit tests

* fix(hash): ensure negative or zero options.length returns full hash

- Updated hash() to only truncate when options.length > 0
- Prevents accidental truncation when options.length is negative
- Maintains expected behavior for full-length hash

* added strict +ve number input validation for hash()

* simplified the logic to check number len before applying slice() in StringUtils.ts->hash()

---------

Co-authored-by: Prateek Hegde <prateek.hegde@deliverysolutions.co>
Co-authored-by: Prateek Hegde <prateek@Prateeks-MacBook-Pro.local>
2025-09-10 09:19:54 +12:00
jeremyteyssedre
1f904675f4
fix(query-builder): handle empty result set when offset exceeds total (#11634)
* fix(query-builder): handle empty result set when offset exceeds total

* fix: lazy count can still be trusted when the result set is empty
2025-09-06 10:36:38 +12:00
Mackenzie Salisbury
6965fa2082
fix: Add package.json exports for react-native (#11623) 2025-08-30 16:04:25 +12:00
Copilot
6930dab301
docs: add llms.txt to documentation site (#11622)
* Initial plan

* Add docusaurus-plugin-generate-llms-txt to TypeORM docs

Co-authored-by: naorpeled <6171622+naorpeled@users.noreply.github.com>

* Replace docusaurus-plugin-generate-llms-txt with SignalWire package

Co-authored-by: naorpeled <6171622+naorpeled@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: naorpeled <6171622+naorpeled@users.noreply.github.com>
2025-08-29 14:32:56 +03:00
dependabot[bot]
39ab7cce97
build(deps): bump sha.js from 2.4.11 to 2.4.12 in /sample/playground (#11617)
Bumps [sha.js](https://github.com/crypto-browserify/sha.js) from 2.4.11 to 2.4.12.
- [Changelog](https://github.com/browserify/sha.js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/crypto-browserify/sha.js/compare/v2.4.11...v2.4.12)

---
updated-dependencies:
- dependency-name: sha.js
  dependency-version: 2.4.12
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-29 14:31:36 +03:00
Lucian Mocanu
22b26d1153
feat: allow VirtualColumns to be initially non-selectable (#11586) 2025-08-18 21:28:55 +03:00
Bartłomiej Rutkowski
b6ffd462dd
perf: Cache package.json location between getNearestPackageJson invocations (#11580)
* perf: Cache package.json location between invocation

Cache package.json location to improve performance of migrations with a lot of files

Closes: #4136

* refactor: Use map. Move tests to appropriate files

Move tests and use Map instead of object as per review comments

* test: Check number of invocations in test

Change test to assert number of stat and readFile calls

* test: Change assert for CI

Added assertion to make both local and CI work

* Create package.json in test

* Create file only if not existed before

* test: Fix test assertion based on platform

* test: Change package.json type

* ci: Trigger tests

---------

Co-authored-by: Bartlomiej Rutkowski <brutkowski@tilt.app>
2025-08-18 21:16:55 +03:00
Michael Bromley
4d204adf56
chore: Release v0.3.26 (#11602) 0.3.26 2025-08-18 17:32:25 +01:00
chen
d1e3950907
feat: support virtual columns in entity schema (#11597)
* feat: add entity mode virtual-property

* test: virtual columns
2025-08-16 18:06:00 +03:00
Stevan
16983132d3
docs: fix reload option typo (#11601) 2025-08-16 15:39:56 +02:00
chen
0b767e833d
docs: added @piying/orm extension to readme (#11596)
* docs: added "piying-orm" extension to readme

* docs: added "piying-orm" extension to readme
2025-08-16 12:18:29 +03:00
白墨
ec26eae824
fix(platform[web worker]): improve globalThis variable retrieval for browser environment (#11495) 2025-08-14 23:12:20 +03:00
Arseny Yankovsky
6e9f20d4d9
fix: regtype is not supported in aurora serverless v2 (#11568) 2025-08-05 09:31:39 +02:00
Park Jin Woong
17cf837ba9
feat(11528): add Redis 5.x support with backward compatibility wite peer dependency to allow (#11585)
* feat: add Redis 5 support to cache implementation

- Add version detection for Redis client to handle API differences
- Support Redis 5 Promise-based API while maintaining backward compatibility
- Update methods to use appropriate API based on Redis version
- Add tests for Redis 5 compatibility

Redis 5 introduced Promise-based API as default, replacing the callback-based
API. This change detects the Redis version and uses the appropriate API calls
to ensure compatibility with Redis 3, 4, and 5.

Closes #11528

* feat: add Redis 5 support to cache implementation

Implement automatic version detection for Redis client libraries to support
Redis 3, 4, and 5 seamlessly. The implementation uses runtime API testing
to determine the appropriate Redis client behavior without breaking existing
functionality.

Changes include:
  - Dynamic Redis version detection based on client API characteristics
  - Promise-based API support for Redis 5.x
  - Backward compatibility with Redis 3.x and 4.x callback-based APIs
  - Safe fallback mechanism defaulting to Redis 3 behavior
  - Updated peer dependency to include Redis 5.x versions

The cache implementation now automatically adapts to the installed Redis version, ensuring optimal performance and compatibility across all supported Redis client versions while maintaining full backward compatibility.

* fix: delete wrong migration guide

* feat: add package-lock.json

* refactor: optimize Redis client creation to reduce memory usage
Eliminate unnecessary Redis client recreation by using explicit tempClient
variable management, reducing potential client instances while maintaining
full Redis 3/4/5 compatibility and accurate version detection.

* refactor: improve Redis version detection to avoid cache pollution
Replace test key creation method with client method signature analysis
to prevent potential cache pollution and improve performance.

* style: apply Prettier formatting to RedisQueryResultCache.ts
2025-08-01 17:30:41 +02:00
Lucian Mocanu
8097d1ab84
docs: fix redirect to mongodb page (#11584) 2025-07-29 17:09:43 +02:00
Lucian Mocanu
23fcde24ee
docs: separate driver-specific documentation (#11581) 2025-07-28 10:28:51 +02:00
Lucian Mocanu
d57fe3bd85
fix(mysql): set stringifyObjects implicitly (#11574) 2025-07-20 23:28:03 +02:00
Vampire
f351757a15
fix: resolve array modification bug in QueryRunner drop methods (#11564)
* fix: resolve array modification bug in QueryRunner drop methods

Fix iteration bug in QueryRunner implementations where dropping multiple
database objects (columns, indices, foreign keys, unique constraints) would
skip elements due to in-place array modification during iteration.

The issue occurred when methods like dropColumns(), dropIndices(),
dropForeignKeys(), and dropUniqueConstraints() iterated over arrays while
simultaneously modifying them by removing elements. This caused a classic
"off-by-one" iteration bug where alternate elements would be skipped.

Changes:
- Update all affected QueryRunner drop methods to iterate over a shallow
  copy of the input array using [...array] spread syntax
- Add comprehensive regression tests in test/github-issues/11563/
- Test coverage includes all affected drivers: Postgres, MySQL, SQL Server,
  Oracle, CockroachDB, Spanner, SAP, and Aurora MySQL

Affected drivers:
- SpannerQueryRunner
- PostgresQueryRunner
- MysqlQueryRunner
- SqlServerQueryRunner
- OracleQueryRunner
- CockroachQueryRunner
- SapQueryRunner
- AuroraMysqlQueryRunner

Closes #11563

* fix: create multiple indices same column

* chore: functional tests instead of github issues
2025-07-09 08:23:47 +02:00
Rhydian
1737e97d1a
fix(mysql): support Alibaba AnalyticDB returning version() column name in getVersion() (#11555) 2025-07-08 21:45:21 +02:00
Ragy Hosny
3c26cf18a7
fix: do not create junction table metadata when it already exists (#11114)
* fix: do not include already user defined junction tables in entityMetaData
2025-07-08 22:15:35 +12:00
Abdul Aziz Al Basyir
a4c9dd8943
chore: change test badge from test.yml to commit-validation.yml (#11560) 2025-07-06 12:54:54 +02:00
Antti
66ee307784
fix: preserve useIndex when cloning a QueryExpressionMap (or a QueryBuilder) (#10679)
* fix: preserve useIndex when cloning a QueryExpressionMap

Closes #10678

* test: add test related to issue #10678
2025-07-04 23:16:50 +02:00
Mohamed Akram
1ea3a5eb06
fix: support for better-sqlite3 v12 (#11557) 2025-07-03 20:35:13 +02:00
Lucian Mocanu
aebc7ebc67
feat(sap): use the native driver for connection pooling (#11520)
* feat(sap): use the native driver for connection pooling

* Add pool error handler
2025-07-01 23:43:12 +02:00
Emmanuel Quincerot
5904ac3db2
perf: avoid unnecessary count on getManyAndCount (#11524)
* perf: avoid unnecessary count on getManyAndCount

Skip count query when it can be deduced from the
number of returned rows. This will avoid one round
trip and could be very helpful on pagination when the
limit is not reached.
2025-06-24 09:08:51 +12:00
Lucian Mocanu
01dddfef97
fix: add stricter type-checking and improve event loop handling (#11540)
* refactor: minor type improvements

* chore: add type-checked eslint rules

* fix: enable no-misused-promises

* fix: enable no-floating-promises

* fix: enable await-thenable

* fix: enable require-await

* fix: enable no-misused-new

* refactor: enable no-namespace

* refactor: enable tseslint eslint recommended

* code review
2025-06-22 11:51:29 +02:00
Lucian Mocanu
abf8863a53
feat(sap): add support for REAL_VECTOR and HALF_VECTOR data types in SAP HANA Cloud (#11526)
* feat(sap): add support for REAL_VECTOR data type

* feat(sap): add support for HALF_VECTOR data type
2025-06-22 01:43:10 +02:00
Lucian Mocanu
f2d2236218
fix(oracle): pass duplicated parameters correctly to the client when executing a query (#11537) 2025-06-21 14:05:15 +02:00
Oleg "OSA413" Sokolov
70057de7e7
test(ci): force mocha to exit on stuck process (#11538) 2025-06-21 16:54:00 +05:00
Michael Bromley
1bcf05552f
chore: Remove manual trigger on publish workflow (#11536) 2025-06-19 21:15:13 +02:00
Michael Bromley
bdb8326ad7
chore: Release 0.3.25 (#11535) 0.3.25 2025-06-19 18:08:24 +02:00
Lucian Mocanu
ead4f98ee4
fix: improve async calls on disconnect (#11523) 2025-06-19 00:43:38 +02:00
Lucian Mocanu
b1e93f736d
chore(ci): simplify workflows (#11530)
* chore(ci): reorganize workflows

* chore(ci): prevent duplicate commit validation in PRs

* code review fixes

* code review #2
2025-06-18 14:58:34 +02:00
Mohamed Nader Baccari
42e7cbe7da
fix: fix null pointer exception on date array column comparison (#11532)
* fix: fix null pointer exception on date array column comparison

Follow up to https://github.com/typeorm/typeorm/pull/11269 which was
calling Array.map without validating if the array was null. Now only
normalize if both values (entity and database) are not null.

Closes: https://github.com/typeorm/typeorm/issues/11514

* clean test
2025-06-18 09:05:39 +12:00
Yevhen Komarov
63a3b9abc1
fix: multiple relations with same column name(s) generate invalid SELECT statement (#11400)
* fix: Multiple relations with same columns cause invalid SQL to be generated
Closes: #1668, #9788,  #9814, #10121, #10148, #11109, #11132, #11180

* refactor: extract cloneObject util

* fix: improve cloneObject

* test: remove duplicate tests

* test: transformed the test: add City, Country, and Order entities with composite foreign key relations,

* test: change to composite primary key

---------

Co-authored-by: Lucian Mocanu <alumni@users.noreply.github.com>
2025-06-17 18:38:16 +02:00
Simon Garner
af9ecc09cc
docs: add heading to Getting Started page (#11531) 2025-06-17 18:49:06 +12:00
gongAll
ce23d4648e
fix(tree-entity): closure junction table primary key definition should match parent table (#11422)
* fix #9600 https://github.com/typeorm/typeorm/issues/9600

* implement tests.

* implement tests.

* implement tests.

* move tests fo functional tab.
implement remaining tests.
implement remaining fields.

* fix code rabbit detected errors.

* add MySQL-specific type checks to closure-table tests

* split closure-table tests for MySQL-specific scenarios

* remove redundant MySQL type checks from closure-table tests

* move MySQL-specific closure-table tests to a separate file

---------

Co-authored-by: Gonçalo Alves <goncalo.alves@knowledgeworks.pt>
Co-authored-by: gioboa <giorgiob.boa@gmail.com>
2025-06-17 09:08:08 +12:00
Lucian Mocanu
03faa7867e
chore(docs): improve website generation config (#11527) 2025-06-14 09:39:49 +02:00
Mike Guida
42913b95d7
docs: add note about using YugabyteDB to docs (#11521) 2025-06-11 13:36:23 -06:00
David Höck
86f12c9226
feat(docs): add Plausible analytics script to Docusaurus config (#11517)
* feat(docs): add Plausible analytics script to Docusaurus config

* feat(docs): conditionally include Plausible analytics script based on environment
2025-06-10 13:08:42 +02:00
David Höck
1391b5a789
chore: update workflows to ignore changes in docs directory (#11518)
* chore: update workflows to ignore changes in docs directory

Added paths-ignore configuration to CodeQL, preview, and test workflows to prevent unnecessary runs when only documentation files are modified.

* chore: remove paths-ignore for docs in preview workflow
2025-06-10 13:08:29 +02:00
Giorgio Boa
930eefd758
fix: fix up doc search workflow (#11513) 2025-06-06 18:27:10 +02:00
Naor Peled
4b0ffeeb33
docs: new website initial commit
Co-authored-by: Giorgio Boa <35845425+gioboa@users.noreply.github.com>
Co-authored-by: Jovana Đurić <63621526+jovanadjuric@users.noreply.github.com>
Co-authored-by: jovanadjuric <mat.jovana@gmail.com>
Co-authored-by: Mike Guida <mike@mguida.com>
Co-authored-by: gioboa <giorgiob.boa@gmail.com>
2025-06-06 18:03:25 +03:00
Lucian Mocanu
eb3093d03a
chore: improve linting (fixup) (#11511) 2025-06-05 22:42:27 +02:00
Lucian Mocanu
61753b1adf
chore: improve linting (#11510) 2025-06-05 21:40:45 +02:00
Giorgio Boa
65d5a00ef1
feat: add typesense/docsearch-scraper (#11424) 2025-06-05 21:06:07 +02:00
DinoDeveloper
24c3e38c51
fix: add collation update detection in PostgresDriver (#11441)
* fix(postgres): collation not updated in DB when changed in entity

Closes: #8647

* test: issue #8647

* test: add enableDrivers, combine seperated cases

* test: update test name

* test: remove unnecessary characters in test case

* style: fix formatting

* style: fix comments typo
2025-06-05 15:25:43 +02:00
KimYeonghun
413f0a68c8
fix: handle limit(0) and offset(0) correctly in SelectQueryBuilder (#11507)
* fix: handle limit(0) and offset(0) correctly in SelectQueryBuilder

- Fix JavaScript falsy value issue where limit(0) was treated as undefined
- Now limit(0) correctly generates 'LIMIT 0' SQL clause instead of being ignored
- Add helper functions hasLimit/hasOffset to distinguish between undefined and 0
- Add comprehensive test cases for zero value handling in limit/offset/take/skip
- Prevents potential security issue where limit(0) returned all records

Fixes potential data exposure when limit(0) was intended to return empty result

* fix: prettier formatting

* test: expand test coverage for LIMIT/OFFSET edge cases and regression prevention
2025-06-05 14:40:58 +02:00
Sakura
a9c16ee66d
feat: add upsert support for Oracle, SQLServer and SAP HANA (#10974) 2025-06-05 08:45:45 +02:00
Denes Antonio de Souza
07d7913be7
feat(spanner): use credentials from connection options (#11492)
* #11442

* Npm Format

* JSON Array update command Spanner - FIX

* Revert "JSON Array update command Spanner - FIX"

This reverts commit 56a28e575686dcee770b5601041b7d76e3a3a5e2.
2025-06-04 22:55:12 +02:00