5646 Commits

Author SHA1 Message Date
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
Mike Guida
6d1c4f0186
build: ensure coveralls flag-name is unique by db, node and client versions (#11461) 2025-05-12 15:36:10 -06:00
Mike Guida
1198dc2934
chore: add note about breaking change in 0.3.23 (#11469) 2025-05-12 12:48:20 -06:00
Mike Guida
39a6562a64
refactor: remove unused NamingStrategyNotFoundError (#11462) 2025-05-12 09:18:58 -06:00
Lukasz Otczyk
15de733e28
perf: improve save performance during entities update
Co-authored-by: Lukasz Otczyk <lukasz.otczyk@nexontis.com>
2025-05-11 22:37:46 +03:00
Naor Peled
2168441e6c
fix(ci): resolve pkg.pr.new publish failure
Co-authored-by: AmirHossein Sakhravi <amirhosseinpr184@gmail.com>
2025-05-11 19:53:08 +03:00
Maxim Bronnikov
a213bbd215
chore: Add husky and lint-staged (#11448)
Co-authored-by: maxbronnikov10 <maxbronnikov2004@gmail.com>
2025-05-08 21:53:45 -06: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
Michael Bromley
80e9b3004a
chore: Version 0.3.23 (#11439) 0.3.23 2025-05-07 12:03:48 +02:00
Maxim Bronnikov
b94dfb3e31
fix: update/delete/softDelete by criteria of condition objects (#10910)
Co-authored-by: maxbronnikov10 <maxbronnikov2004@gmail.com>
2025-05-06 15:30:05 -06:00
Mike Guida
3ffeea590f
docs: clarify where to add tests (#11438) 2025-05-05 12:39:07 -06:00
Naor Peled
274bdf2e1a
feat: publish PR releases using pkg.pr.new 2025-05-02 23:09:42 +03:00
Lucian Mocanu
fadad1a74c
fix: cleanup after streaming in sap hana (#11399) 2025-05-01 22:48:09 +02:00
TanguyPoly
b9842e3be9
fix: beforeQuery promises not awaited before query execution (#11086)
* fix: beforeQuery promises not awaited before query execution

Closes: #11085

* fix: run format

Closes: #11085

* fix: apply same beforeQuery & afterQuery logic to all drivers

* fix: use a different broadcaster for BeforeQuery / AfterQuery

* fix: BeforeQuery / AfterQuery event types

* fix: move broadCasterResult.wait in finally block

* fix: remove duplicated broadcasterResult.wait in ReactNativeQueryRunner

* fix: fix prettier issue

* fix: implemented requested changes

* fix: broken sqlite tests

* Revert "fix: broken sqlite tests"

This reverts commit 4bacd5f4b55bb09297e9086decefe62f08ceead0.

* Revert "fix: implemented requested changes"

This reverts commit 1d2f59bf2bf8ec276f84bcd8b840ca5420c4088f.

* review: undefined type at the end

* fix: move database connection logic outside of the promise bloc

---------

Co-authored-by: Lucian Mocanu <alumni@users.noreply.github.com>
2025-05-01 09:16:32 +12:00
Mike Guida
9464e6522a
build: setup testing matrix for postgres 14 and 17 (#11433) 2025-04-30 10:25:56 -06:00
Mohamed Nader Baccari
a61654e079
fix: change how array columns are compared on column changed detection (#11269)
* fix: change how array columns are compared on column changed detection

Closes: #5967

* add tests with date array colum

* Normalize date arrays before comparing
2025-04-30 11:33:12 +12: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
Michael Dippery
b9ddd14298
docs: Correct "its" -> "it's" (#11428) 2025-04-25 09:58:01 +02:00
Roman Ostolosh
24a0369673
docs: update repository additional chunk option usage example (#11282)
* docs: update repository additional chunk option usage example

* Update docs/repository-api.md

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

* Update docs/repository-api.md

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

---------

Co-authored-by: Jovana Đurić <63621526+jovanadjuric@users.noreply.github.com>
Co-authored-by: Mike Guida <mike@mguida.com>
2025-04-17 22:31:07 +02:00
Pieter Wigboldus
4c8fc3a7cb
feat: add FormattedConsoleLogger (#11401)
* fix: Build ESM migrations for JS

Including jsdoc for typehinting
Add esm as an option in the migrate cli
Update the documentation for the JS migrations

Closes: #10801

* fix: Fix the migration documentation

* Cleanup the types in the migrations

* Add the formatted sql console

* Add the formatSql to the logger

* Update src/logger/FormattedConsoleLogger.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Make names in test more consistent

* Add a sub query example

* Set the language to the sql formatter

* Import SqlLanguage as a type from sql-formatter

* Remove empty console log

* Remove console log

* Add the dataSourceType

* Remove js extension from import

* Use another package to format the SQL in the logging

Same package as we use to generate the migrations

* Not need to add all the spaces in the log

* Fix the expected formatted queries

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-04-16 18:55:23 +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
Ariel Barabas
673f06549c
refactor: define Position type for GeoJSON objects (#11259) 2025-04-15 12:53:19 -06:00