5567 Commits

Author SHA1 Message Date
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
Md. Minhaz Ahamed(mmarifat)
2bfa300996
fix(postgres): resolve alias or table name in upsert/insert or update conditionally (#11452)
* fix: resolve regression in upsert and orUpdate for PostgreSQL driver

This fix addresses a regression introduced in
pull request #11082 by ensuring correct handling of alias names and table names when they are equal or distinct when entities use schema

Closes: #11440

* style: code formatted

* chore: run tests by running through all the drivers

* chore: set enabledDrivers as postgres

* chore: added postgres family members as enabled drivers

* chore: accepted suggestion to remove extra comments

Co-authored-by: Mike Guida <mike@mguida.com>

---------

Co-authored-by: Mike Guida <mike@mguida.com>
2025-06-04 22:39:38 +02:00
Simon Garner
5003aaa7c5
docs: use correct SQL statements in softDelete/restore comments (#11489) 2025-05-22 11:40:31 +12:00
Mike Guida
12a71e4581
chore: version 0.3.24 (#11478) 0.3.24 2025-05-14 12:00:37 -06:00
Alex Azartsev
d325d9e63d
fix: capacitor driver PRAGMA bug (#11467)
* fix: capacitor driver PRAGMA bug

add usage of query method for PRAGMA queries in CapacitorQueryRunner.ts;
add usage of execute method for PRAGMA queries in CapacitorDriver.ts;
PRAGMA statements must be executed with query method in CapacitorQueryRunner.ts to be able to return results used in AbstractSqliteQueryRunner, not just success indicator, otherwise error appears: tableColumn.type.indexOf is not a function.;
PRAGMA statements must be executed with execute method in CapacitorDriver.ts, otherwise error appears: prepareSQL step failed rc: 100 message: another row available

* fix: npm format
2025-05-14 14:27:50 +02:00
Simon Garner
b8dbca515e
fix(mssql): avoid mutating input parameter array values (#11476)
* test(mssql): add test for unwanted mutation of input params

* fix(mssql): avoid mutating input parameter array values

* chore: add comment explaining input array test assertion
2025-05-14 21:41:07 +12:00
Mike Guida
9f889b3490
chore: clarify commit practices (#11472) 2025-05-13 16:37:47 -06:00
Denes Antonio de Souza
144634d4c0
feat(spanner): support insert returning (#11460)
* Update SpannerDriver.ts

* Update package.json

* Update package.json

* Update package.json

* Update package-lock.json

* Update package.json

* #11453

* Revert "Update package.json"

This reverts commit 20f24de10cda62ad0c9a368b14290fbb4f355b32.

* Revert "Update package.json"

This reverts commit bcf6678e95b57570ea526935bb7490c9b11a16da.

* Update package.json

* Revert "Update package-lock.json"

This reverts commit a003e5659336b38b8cade5f1605c17f7c3e59673.

* #11460

* #11460

* FIX/Spanner Numeric type value string

* #11460 Test functional spanner

* test: update returning tests

* refactor: simplify condition

* style: fix lint/format

* test: fix returning test for spanner

---------

Co-authored-by: Lucian Mocanu <alumni@users.noreply.github.com>
2025-05-13 22:45:53 +02:00
Christian Forgács
e9eaf79604
Fix/11466 mssql find operator (#11468)
* chore: enable driver `mssql` for test of issue #3113

* chore: add test case for #11298 to issue #11285 to prevent functionality of #11285

* fix: unhandled find operator with array value for mssql (#11466)

* fixup! fix: unhandled find operator with array value for mssql (#11466)

* Revert "chore: enable driver `mssql` for test of issue #3113"

This reverts commit a302d63eeac5892e920d97705b4230414ef81e6d.

* fixup! chore: add test case for #11298 to issue #11285 to prevent functionality of #11285

---------

Co-authored-by: Christian Forgács <christian@wunderbit.de>
2025-05-13 12:45:06 +12:00
Simon Garner
23bb1ee271
feat: add updateAll and deleteAll methods to EntityManager and Repository APIs (#11459)
* Add updateAll() methods

* Add deleteAll() methods

* Fix softDelete/restore error messages

* Add test for Repository.delete() with criteria

* Add test for Repository.deleteAll() method

* Move/rename “Repository > delete” test files

* Tweak comments

* Add tests for Repository update methods

* Add updateAll and deleteAll to EntityManager API docs

* Add updateAll and deleteAll to Repository API docs

* Fix tests
2025-05-13 12:33:44 +12:00
Simon Garner
a6b61f7645
chore: include warning about update({}) in changelog (#11471)
* chore: include warning about update({}) in changelog

* chore: be more specific about affected methods
2025-05-13 12:22:34 +12:00