1074 Commits

Author SHA1 Message Date
Artem Kustikov
2681051f78
feat(mssql): support 'vector' type for MS SQL Server (#11732) 2025-11-12 21:22:20 +01:00
Piotr Kuczynski
6381c8d519
docs: fix typos in the js documentation (#11754) 2025-11-09 21:57:31 +01:00
Piotr Kuczynski
08a9397491
lint: fix offenses for @typescript-eslint/no-unused-vars rule in tests folder (#11755) 2025-11-09 21:54:36 +01:00
Kishan Kumar
d7867ebff1
feat: manage MongoDB SOCKS5 proxy settings (#11731) 2025-10-20 23:14:32 +02:00
chen
925dee002b
feat: entity schema support trees (#11606) 2025-09-29 10:36:35 +02:00
Piotr Kuczynski
4f05718237
feat: add support for jsonpath column type in PostgreSQL (#11684) 2025-09-26 18:56:53 +02:00
Lucian Mocanu
c16ef63db7
chore: update dependencies (#11666) 2025-09-19 18:34:39 +02:00
Michael Bromley
34d87149ec
Revert "fix: do not create junction table metadata when it already exists (#11114)" (#11660)
This reverts commit 3c26cf18a77b5b0cd7c15c811fc3d0a43af32e47.
2025-09-19 11:03:18 +02:00
David Höck
974ead202d
fix: JSON parsing for mysql2 client library (#8319) (#11659) 2025-09-19 10:34:17 +02:00
Naor Peled
a49f612289
feat(postgres): support vector/halfvec data types (#11437) 2025-09-18 22:12:07 +03:00
Naor Peled
96ea431eb7
feat: add new undefined and null behavior flags (#11332)
- added configurable handling for null/undefined in where clauses (ignore, SQL NULL, or throw) across queries, query builders, and repository/entity-manager methods
2025-09-18 08:41:16 +03:00
Lucian Mocanu
8b76e1af74
feat(mysql): add support for MySQL 9 / MariaDB 12 (#11575) 2025-09-17 09:08:31 +02:00
Simon Garner
3fac86b60e
fix: update tests to reflect migration template changes (#11653) 2025-09-17 08:37:12 +02:00
Lucian Mocanu
22b26d1153
feat: allow VirtualColumns to be initially non-selectable (#11586) 2025-08-18 21:28:55 +03: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
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
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
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
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
Lucian Mocanu
ead4f98ee4
fix: improve async calls on disconnect (#11523) 2025-06-19 00:43:38 +02: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
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
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
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
Eliya Cohen
c464ff87cb
feat: add tagged template for executing raw SQL queries (#11432)
* Added a new SQL tagged template feature for executing raw SQL queries with automatic parameter handling.

---------

Co-authored-by: Simon Garner <simon@equalogic.com>
2025-05-09 13:19:40 +12:00
Lucian Mocanu
fadad1a74c
fix: cleanup after streaming in sap hana (#11399) 2025-05-01 22:48:09 +02:00
Caíque de Castro Soares da Silva
61a6f971af
fix: prevent error when replication is undefined (#11423)
* fix: prevent error when replication is undefined

* fix format

* add test

* update test name

* fix test

* fix test

* skip test

* add unit test

* fix unit test

* fix unit test
2025-04-25 14:30:42 +02:00
Ievgen Makukh
fe71a0c3e4
perf(query-runner): use Date.now() intead of +new Date() (#10811)
* perf(query-runner): use Date.now() intead of +new Date()

* perf: use Date.now() instead of new Date().getTime()

---------

Co-authored-by: Lucian Mocanu <alumni@users.noreply.github.com>
Co-authored-by: Mike Guida <mike@mguida.com>
2025-04-15 13:18:22 -06:00
iliagrvch
046aebe696
feat: Add query timeout support for MySql (#10846)
Add "enableQueryTimeout" option to MysqlConnectionOptions. When enabled the value of "maxQueryExecutionTime" will be passed to mysql driver as query timeout.

---------

Co-authored-by: Mike Guida <mike@mguida.com>
2025-04-15 12:17:04 -06:00
Mike Guida
45577df8b7
test: remove unused type parameter from decorators (#11412)
Remove unused `type` parameter from functions supplied to decorators in tests and sample code. This resolves 477 eslint unused var warnings.

All changes are modifying functions in test or sample code of the following style:

1. `@OneToMany((type) => Entity, ...)` to `@OneToMany(() => Entity)`
2. `@ManyToOne((type) => Entity, ...)`
3. `@ManyToMany((type) => Entity, ...)`
4. `@OneToOne((type) => Entity, ...) `

Note that we don't actually ever call this function with an argument.
2025-04-14 09:25:31 -06:00
Pieter Wigboldus
7c5ea99b31
feat: generate ESM migrations via esm flag (#10802)
Including jsdoc for typehinting
Add esm as an option in the migrate cli
Update the documentation for the JS migrations

fixes #10801

Co-authored-by: Mike Guida <mike@mguida.com>
2025-04-04 12:05:33 -06:00
Yevhen Komarov
6ebae3b795
feat: add new foreign key decorator, and entity schemas options (#11144)
* feat: add new foreign key decorator, and entity schemas options

This new feature adds the ability to create foreign key constraints without entity relations, using `@ForeignKey()` decorator or entity schema options.

Closes: #4569
2025-04-04 10:22:40 +13:00
Benjamin Renoux
72c6991680
fix: incorrect table alias in insert orUpdate with Postgres driver (#11082)
* fix: resolve issues in insert query orUpdate method with postgres driver

This fix make use of table name alias in WHERE clause of onUpdate method with postgres driver to avoid throwing error

Closes: #11077

* test: update insert on conflict test

---------

Co-authored-by: Lucian Mocanu <alumni@users.noreply.github.com>
2025-04-02 02:31:52 +02:00
Lucian Mocanu
3d79786a92
fix: version detection for Postgres derived variants (#11375) 2025-04-01 21:54:27 +02:00
Lucian Mocanu
460ef023ba
fix(sap): normalize deprecated/removed data types in SAP HANA Cloud (#11356)
* fix(sap): SAP HANA Cloud data types

* fix(sap): fall back to regular index when fulltext is not supported

* fix: remove dead code
2025-04-01 20:54:54 +02:00
Lucian Mocanu
863caf1471
fix: sql escape issues identified by CodeQL (#11338)
* fix: sql escape issues identified by CodeQL

* fix: random generation in sample code
2025-04-01 10:38:36 +02:00
ertl
bcaa0bf071
fix: bulk insert NULL values in Oracle (#11363)
resolve issue with bulk insert of NULL values for non VARCHAR2 types in Oracle.
2025-03-31 21:35:03 -06:00
Lucian Mocanu
fb06662bea
build: setup SAP HANA tests (#11347)
* build: setup SAP HANA tests

* test: fix/skip failing SAP HANA tests

* fix(sap): rename schema
2025-03-29 22:35:44 +01:00
Lucian Mocanu
6ba408214e
build: improve test workflow (#11361) 2025-03-26 22:10:19 +01:00
Muhammad Ghayas Baig
834e85692f
fix: FindOptionsSelect to use correct type when property is an object (#11355)
* fix: FindOptionsSelectProperty or boolean when Property is object

* fix: add test cases for find options select

* fix: use simple-json for tests
2025-03-25 15:40:42 +05:00
Lucian Mocanu
00d5639efb
chore: update dependencies (#11339)
* style: sort package json

* chore: update dependencies

* fix: update dependencies added by the init command

* fix: restore node 16/18 compatibility

* docs: update package description

* chore: remove unused dependencies
2025-03-21 19:57:18 +02:00
Lucian Mocanu
8c2b2ae240
style: lint repository (#11346)
* style: lint uncommon rules

* style: fix `no-wrapper-object-types`

* fix: type errors after Object -> object change

* style: fix `prefer-const`

* build: add eslint/prettier exclusions
2025-03-20 22:15:39 +02:00
Mike Guida
de8eb04c72
build: run format in ci (#11342)
* style: run format on existing files

* build: run format in ci

* build: add format:ci to check formatting in ci
2025-03-20 20:27:09 +02:00
John Chan
b0ea913f4e
feat(postgres): support macaddr8 column type
Signed-off-by: John Chan <john.chan@sgwireless.com>
2025-03-19 16:13:12 +05:00
Oleg "OSA413" Sokolov
5d6d893662
test: fix and run tests on Windows (#11257)
* Skip tests that don't work on Windows

* Bring back tests on Windows

* Skip the test on all platforms exept Windows

* Make the test run only on Windows

* Add simple winodws test

* fix cli test on Windows

* let's see if this test passes on linux

* limit test to Windows and run format

* Add withPlatform test helper

* Mock platform in file path tests using withPlatform()

* Fix test: relative paths should not change on non-win32 platforms

* Lowercase relative path on non-win32 platform

* test: add better-sqlite3 and sqlite for Windows tests

---------

Co-authored-by: Simon Garner <simon@equalogic.com>
2025-03-14 16:01:46 +05:00