1932 Commits

Author SHA1 Message Date
Lucian Mocanu
af7ac1c6d8
chore: migrate to ESLint flat config (#11205) 2024-12-29 16:33:46 +01:00
Joel Stimson
19a6954d8b
chore: Lint on GitHub actions (#11177) 2024-12-18 11:44:18 +01:00
Oleg "OSA413" Sokolov
53f253d527
test: redo cockroachdb to service-container GHA and update its version to latest (24) (#11190) 2024-12-16 08:33:00 +01:00
Oleg "OSA413" Sokolov
af603ae5cf
test: Expand node version matrix to node16, node18, and node20 (#11183) 2024-12-14 08:51:17 +01:00
Oleg "OSA413" Sokolov
b535cbd1bf
style: Apply formatting (#11175) 2024-12-11 09:51:02 +01:00
jeisberg
83567f5334
fix: composite key save issue (#10672)
* chore(TypeORM): Create test case to uncover TypeORM composite key save issue

* chore(TypeORM): Revert package.json test script alteration

* fix the issue

* fixed regression in 1551

* fixed test to prevent issues with auto increment when inserting rows in a different order

* fixed test to prevent issues with auto increment when inserting rows in a different order

---------

Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com>
2024-02-02 13:41:37 +05:00
Niels Stinissen
d0b76703cc
feat: add postgres multirange column types (#10627)
* feat: add postgres multirange column types

Adds int4-, int8-, num-, ts-, tstz-, date-multirange column types for postgres
Update docs to include multirange column types
Update functional column-types-postgres test to test multirange column types

Closes: #10556

* style: run npm run format

---------

Co-authored-by: Dmitry Zotov <dmzt08@gmail.com>
2024-01-26 11:33:16 +05:00
Shu Nonaka
54d8d9efe9
fix: hangup when load relations with relationLoadStrategy: query (#10630)
* fix: createQueryBuilder to accept queryRunner
* fix: modify to use queryRunner when retrieving relations (#10481)
* test: add testcases
2024-01-26 11:28:19 +05:00
Alexey Pelykh
dd49a254dc
fix: don't escape indexPredicate (#10618)
* fix: don't escape indexPredicate

* style: npm run format
2024-01-26 11:26:12 +05:00
Andrei Nikolaev
99d8249e45
fix: type inferencing of EntityManager#create (#10569)
* fix: type inferencing of EntityManager#create

* test: type inferencing of EntityManager#create (#10569)
2024-01-26 11:17:01 +05:00
Markus Fürer
e22481904a
style: Enable some linter rules (#10592)
* style: 🚨 enable some linter rules

* Revert "style: 🚨 enable some linter rules"

This reverts commit 239fa2deb7aaf22cfac4bbb1369d6d973327efd4.

* revert:  revert role "prefer-const"

* revert:  enable linter warnings

* style: 🚨 enable rule "no-extra-boolean-cast"

* revert:  disable rule "no-empty"

* style: 🚨 add linter rule "no-useless-escape"

* style: 🚨 add linter rule "no-unsafe-optional-chaining"
2024-01-26 11:06:15 +05:00
Maarten Sijmkens
f232ba7808
fix: include asExpression columns in returning clause (#10632)
* fix: include asExpression columns in returning clause

Closes: #8450

* test: add test for issue #8450
2024-01-26 10:41:58 +05:00
Alessio Napolitano
8aa8690f94
fix: resolve issue CREATE/DROP Index concurrently (#10634)
Closes: #10626
2024-01-26 10:38:30 +05:00
ertl
7e85460f10
feat: add json type support for Oracle (#10611)
* refactor: remove oracle docker tests and update DEVELOPER.md

Since oracle runs at thin mode now. Now extra docker tests are needed

* chore: increase oracle version to 21c

* feat: add json column types to oracle

* fix: try to resolve pipeline issue to increase oracle waiting time

* fix: try remove networks from oracle to fix pipeline

* fix: add container name

* fix: add missing oracledb driver in package-lock.json

* fix: corrected tests

* fix: remove tests, since only work with old oracle db

* fix: correct tests

* fix: remove deprecated types

* fix: add missing grant for materialized views

* fix: oracle-isolation.ts test

* fix: issue-3363.ts test

* fix: schema in tests
2024-01-26 10:27:28 +05:00
Kazuki Matsuo
4493db4d1b
feat: add table comment for postgres (#10613) 2024-01-26 10:23:11 +05:00
Kobe Kwanten
15de46fd5d
revert "feat: nullable embedded entities (#10289)" (#10614)
This reverts commit e67d7041387df78c69599c1d3c880389a935ffbf.
2024-01-08 22:20:36 +05:00
Lucian Mocanu
c22e30f1d2
build: set TS compile target to ES2021 (#10595)
* build: set TS compile target to ES2021

* docs: update minimum supported node version

* build: use @tsconfig/node16
2024-01-04 09:57:12 +05:00
sinkhaha
338df16439
feat: add support for table comment in MySQL (#10017)
* feat: add table comment

* feat: resolve conflict

* feat: del auroraMysql comment

* feat: add changeTableComment method for MySQL

* feat: QueryRunner subclass add  changeTableComment Implementation

* oracle implement changeTableComment

* add test

* feat: loadTables support comment

* feat: rename

* feat: update mysql changeTableComment

* fix: fix conflict

* feat: add table comment

* feat: resolve conflict

* feat: del auroraMysql comment

* feat: add changeTableComment method for MySQL

* feat: QueryRunner subclass add  changeTableComment Implementation

* oracle implement changeTableComment

* add test

* feat: loadTables support comment

* feat: rename

* feat: update mysql changeTableComment

---------

Co-authored-by: sinkhaha <1468709606@qq.com>
2024-01-03 13:49:33 +05:00
Dmitry Zotov
15bc8876f8
build: update CircleCI config & repair failing tests (#10590)
* updated CircleCI config

* fixed failing test

* fixed failing test

* fixed failing test

* fixed failing test

* fixed CockroachDB enum sync;
removed redundant await;
fixed failing tests;

* fixing failing tests

* fixing failing tests

* added check for empty commands

* fixed failing tests

* fixed failing tests

* fixed failing test
2024-01-03 13:32:17 +05:00
Deep khurana
a00b1df68f
feat: implement OR operator (#10086)
* feat: implement or operator

This new feature enables typeorm to allow use multiple operators joining with or

Closes: #10054

* feat: implement or operator

Completed code formating using command.

Closes: #10054

* feat: implement or operator

Completed the documentation update.

Closes: #10054

* feat: implement or operator

Renamed Or operator file name.

Closes: #10054

* feat: implement or operator

Renamed Or operator file name.

Closes: #10054

* feat: implement or operator

Renamed Or operator file name.

Closes: #10054

* feat: implement or operator

Renamed Or operator.

Closes: #10054
2024-01-02 15:01:01 +05:00
Andrea Mouraud
173910ed79
fix: should automatically cache if alwaysEnable (#10137)
Closes: #9910
2024-01-02 13:03:22 +05:00
Nicolas ROGER
73ee70b331
fix: correctly keep query.data from ormOption for commit / rollback subscribers (#10151) 2024-01-02 13:01:50 +05:00
Andrea Mouraud
e67d704138
feat: nullable embedded entities (#10289)
* feat: nullable embedded entities

* fix: ignore embedded columns if not selected

* test: update tests with changed behaviour

* test: replace integer with varchar for cockroachdb

* docs: add documentation

* fix: nested embedded entities

* test: update nested embedded entities behaviour
2024-01-02 12:29:41 +05:00
Minh Nguyên
5c28154cbe
feat: BeforeQuery and AfterQuery events (#10234)
* feat: add query events

Co-authored-by: mnguyen081002 <3langn@gmail.com>
Co-authored-by: andrewda <andrew@dassonville.dev>

* fix: functional cache

* test: added test for issue-3302

* refactor: use broadcasterResult.wait()

* test: use sandbox to restoring

* test: fix test from #3302 with cockroachdb

* docs: add beforeQuery and afterQuery documents

---------

Co-authored-by: andrewda <andrew@dassonville.dev>
Co-authored-by: Dmitry Zotov <dmzt08@gmail.com>
2024-01-02 12:23:25 +05:00
Markus Fürer
b188c1e634
chore: initial setup of ESLint (#10203)
* build: 👷 Initial setup of ESLint

* build: 👷 show erros as warnings

* refactor: ♻️ example of rule "no-var"

* build: 🚨 add rule "no-unsafe-optional-chaining"
2024-01-02 12:04:37 +05:00
Gazy Mahomar
25e6ecdfd2
fix: nested transactions issues (#10210)
* fix: nested transactions issues

* Forgot test description

---------

Co-authored-by: Dmitry Zotov <dmzt08@gmail.com>
2024-01-02 12:03:28 +05:00
Tait Clarridge
3cda7ec39d
feat: add isolated where statements (#10213)
- Add `isolateWhereStatements` to the `BaseDataSourceOptions` object
  and automatically isolate where statements in the query builder
  if it is true
2024-01-02 11:54:43 +05:00
Alessio Napolitano
dc1bfed6d5
fix: resolve issues on upsert (#10588)
* fix: resolve issues on upsert

Closes: #10587

* fix: test 10563 multiple foreach

* run format

* removed only
2024-01-02 11:49:24 +05:00
Clinton Blackburn
bafcd1709b
feat: exposed entity and criteria properties on EntityNotFoundError (#10202)
These properties can be used by consumers to aid in rendering human-readable error messages.
2023-12-29 21:30:06 +05:00
Tolga Paksoy
b53e410e5a
fix: empty objects being hydrated when eager loading relations that have a @VirtualColumn (#10432)
* test: add scenario for #10431

* fix: empty objects being hydrated by unselected virtual properties
2023-12-29 21:18:11 +05:00
kyoungmin kim
d41930f0d6
fix: logMigration has incorrect logging condition (#10323)
* fix: logMigration has correct logging condition

Closes: #10322

* fix: add test description

Closes: #10322
2023-12-29 20:16:40 +05:00
Dinko Osrecki
f6bb6711e2
feat: support mssql@10 (#10356)
* feat: add support for mssql@10

Add mssql@10 to peerDependency, alongside mssql@9.
Update tests to use latest version of mssql and Node v16.

Closes: #10340

* fixed failing test

---------

Co-authored-by: Alex Messer <dmzt08@gmail.com>
2023-12-29 19:46:52 +05:00
Lukas Spiss
fdb9866ad2
fix: update UpdateDateColumn on upsert (#10458)
Closes: #9015
2023-12-29 19:21:57 +05:00
Szymon Bretner
696e688d00
fix: SQLite simple-enum column parsing (#10550) 2023-12-29 19:16:33 +05:00
Joren Vandeweyer
a4900ae15f
fix: extend GiST index with range types for Postgres driver (#10572)
* fix: extend spatial column types for postgres driver

Extend spatial column type with range types for postgres. This fixes a bug when using spatial indices.

Closes: #10567

* format

* remove only from test, ready for pr

* changed a way how we determine index type

---------

Co-authored-by: Dmitry Zotov <dmzt08@gmail.com>
2023-12-29 19:09:30 +05:00
Harry Brundage
72b1d1b865
feat: ability to change default replication mode (#10419)
* Add a replication test suite

* Allow overriding the default destination for read queries when using replication

For many applications that want to use read slaves, data consistency isn't super important, and so all reads can be sent by default to a read slave. For some applications though, it's only select queries that can be sent to read slaves as end-users of the application expect data consistency almost everywhere. This new setting lets apps like those change the default such that query builders need to opt *in* to sending to a read slave, instead of opt out.
2023-12-29 19:06:58 +05:00
Nemanja Stanic
b6b46fb133
feat: add exists and exists by (#10291)
This PR deprecates `exist` in favor of `exists` and `existsBy`.
2023-12-29 16:29:02 +05:00
Fawzi Abdulfattah
6c918ea392
fix: resolve issue queryBuilder makes different parameter identifiers for same parameter (#10327)
Closes: #7308
2023-12-29 16:19:55 +05:00
Marco Ellwanger
af77a5d0ac
fix: default value in child table/entity column decorator for multiple table inheritance is ignored for inherited columns (#10563) (#10564) 2023-12-29 15:37:13 +05:00
Gabriel Kim
cf37f1370b
fix: migrations on indexed TIMESTAMP WITH TIME ZONE Oracle columns (#10506)
ignore auto-generated virtual columns and attempt to map them into
their respective reference columns

Closes: #10493
2023-12-29 15:26:12 +05:00
michaelzaytsev
39fdcf651f
fix: resolve issue of generating migration for numeric arrays repeatedly (#10471)
Closes: #10043
2023-12-29 15:19:46 +05:00
strongpauly
ae006af501
feat: entityId in InsertEvent (#10540)
Co-authored-by: Paul Potsides <paul@koble.ai>
2023-12-29 15:16:32 +05:00
Dinko Osrecki
ccb9aff89a
test: fix migration-generate test suite (#10361)
* test: fix migration-generate test suite

WIP

Closes: #10360

* fixed mssql test hang;
added option to disable process exit;

---------

Co-authored-by: Alex Messer <dmzt08@gmail.com>
2023-12-29 15:02:44 +05:00
Lucian Mocanu
45e31cc57a
feat: implement column comments for SAP HANA (#10502)
* feat: implement column comments for SAP HANA

* test: improve schema tests for SAP HANA
2023-12-29 15:01:23 +05:00
Lucian Mocanu
7e9cead8a3
feat: implement streaming for SAP HANA (#10512) 2023-12-29 14:53:30 +05:00
Gabriel Kim
89c525761d
feat: user-defined index name for STI discriminator column (#10509)
avoid index duplication on the discriminator column when using STI
and explicitly defining an index for it

Closes: #10496
2023-12-29 14:50:52 +05:00
Gabriel Kim
b240d87f34
feat: custom STI discriminator value for EntitySchema (#10508)
add discriminator value metadata to EntitySchema

Closes: #10494
2023-12-29 14:43:59 +05:00
Rafi Shamim
d184d8598c
test: stop using unsafe CockroachDB setting (#10404)
Disabling the raft log is going to be disallowed in CockroachDB. Also,
this setting wasn't having any effect, since the tests use an in-memory
cluster.
2023-10-05 09:03:51 +05:00
growms
e296063b12
fix: ManyToMany ER_DUP_ENTRY error (#10343)
* fix: ensure comparing EntityMapIds in `buildForSubjectRelation`

I have found the issue (for me at least). In the method `buildForSubjectRelation` of `ManyToManySubjectBuilder`, in order to know if it is needed to insert the relation rows `databaseRelatedEntityIds` is compared with `relatedEntityRelationIdMap` (line 154). The problem is that `databaseRelatedEntityIds` is not always an "EntityIdMap". If one is overloading the entity in the `afterLoad` event of an EventSubscriber for example the line 102 :
`const databaseRelatedEntityValue = relation.getEntityValue(subject.databaseEntity);` will return an "enhanced" object with additional properties. To fix this, in this commit, we ensure that `databaseRelatedEntityIds` is containing an "EntityIdMap".

Closes #5704

* refactor:  describe.only -> describe

removes describe.only.

* style: npm run format

format code.

* Update issue-5704.ts

refactor: typo on post title

---------

Co-authored-by: blemoine <services+bitbucket@blemoine.pro>
2023-09-30 15:04:27 +05:00
Zivvvv
022d2b5f62
fix: aggregate function throw error when column alias name is set (#10035)
* fix: aggregate function throw error when column alias name is set

Closes: #9927
2023-08-19 20:52:03 +05:00