5634 Commits

Author SHA1 Message Date
thisnamewasnottaken
122b683840
fix: mssql datasource testonborrow not affecting anything (#10589)
* Remove outdated pool.testOnBorrow references.

* Remove invalid testonborrow option. factory. options are not imported or typed.
2024-01-02 11:50:24 +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
Dukezo
a939654c95
fix: remove dynamic require calls (#10196) 2023-12-29 21:35:14 +05:00
Lukasz Otczyk
f6b87e3ee1
perf: improve SapQueryRunner performance (#10198)
Use async API exposed by SAP driver

Co-authored-by: Lukasz Otczyk <lukasz.otczyk@nexontis.com>
2023-12-29 21:30:45 +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
Corey Shupe
2dc9624d00
fix: mongodb resolves leaked cursor (#10316)
This change resolves a leaked cursor used to avoid
    a stack overflow during entity transformation.

    Closes: #10315
2023-12-29 20:20:49 +05:00
ertl
3af891a8e6
feat: use node-oracledb 6 (#10285)
* chore: increase oracledb version

* feat: optionally use thick client

BREAKING CHANGE: With node-oracledb the thin client is used as default. Added a option to use the thick client. Also added the option to specify the instant client lib

closes: #10277

* fix: make thick driver the default, to assure an easy transition from version 5 to 6

* fix: make thin driver default again

Since there should be no problems with oracle db version >= 12.1
For oracle db < 12.1 the thick client must be used.

* chore: increase oracledb to 6.1.0

* chore: increase oracledb to 6.2.0 and added new option binaryDir

* refactor: fix linting

* update oracledb to 6.3.0
2023-12-29 20:20:34 +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
sschneider-ihre-pvs
65858f3a17
feat: enabled CTE for oracle driver (#10319) 2023-12-29 16:31:48 +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
Julien MUNIO
cf7147fa7c
fix: remove date-fns in favor of DayJs (#10306)
* Migration of DateUtils to DayJs

* lint

---------

Co-authored-by: julien.munio-ext <julien.munio-ext@arkema.com>
2023-12-29 16:22:55 +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
ales-albert-kilbergr
bfc1cc5ab4
fix: serialize bigint when building a query id #10336 (#10337)
* fix: serialize bigint when building a query id

* style: update formatting
2023-12-29 16:16:03 +05:00
Christopher Kiessling
6d5b5d9ba6
docs: update the docs to keep in line with the example (#10387) 2023-12-29 16:13:43 +05:00
Muhammad Salman Afzal
7de4890265
fix: deletedAt column leaking as side effect of object update while creating a row (#10435) 2023-12-29 16:11:16 +05:00
Alperen Serkan Aksöz
7a58bbf4ea
docs: typo fixed in the manager.findAndCountBy documentation (#10396) 2023-12-29 15:56:32 +05:00
Samuel Lukes
f4e6eaf155
feat: add concurrent indexes for postgres (#10442) 2023-12-29 15:52:49 +05:00
Peter
75ec8f2032
fix: bump better-sqlite3 version range (#10452) 2023-12-29 15:48:19 +05:00
YoungKi Lyu
95a7337143
docs: fix orderBy of Spatial columns (#10568) 2023-12-29 15:47:07 +05:00
Tomas Heky Hekrla
ad5bf11a91
fix: mongodb - undefined is not constructor (#10559) 2023-12-29 15:40:27 +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
Dmitry Zotov
aa8d24cf00
build: removed Node.js 14 from CircleCi (#10576) 2023-12-29 15:30:42 +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
Alec Brunelle
3647b269cc
feat: support for MongoDB 6.x (#10545)
The return value of `findOneAndX` family of MongoDB methods
now includes `null` when no document is found. This is a
breaking change from the previous behavior of returning
a result with metadata describing when a document is not found.
See: https://github.com/mongodb/node-mongodb-native/blob/HEAD/etc/notes/CHANGES_6.0.0.md
2023-12-29 15:22:28 +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
krylovaaleksandra
8af533f79f
fix: caching always enabled not caching queries (#10524)
* Update SelectQueryBuilder.ts

fix https://github.com/typeorm/typeorm/issues/10500

* fix formatting

---------

Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com>
2023-12-29 15:18:26 +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
SeongBin Kim
122c897a2f
fix: add error handling for missing join columns (#10525)
Closes: #7034
2023-12-29 15:10:31 +05:00
Steve Foster
d76b546929
docs: update redis cache client options (#10521)
Between v3 and v4 in node-redis the client options changed for a collection of socket related
paramaters. In the caching documentation the v3 format for used for `host` and `socket`. When
following the documented example the redis client would default to `localhost` even when a
different value for `host` was specified.

Closes: #9987
2023-12-29 15:03:02 +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
seungwonleee
4173e51dd8
docs: update delete-query-builder.md (#10519)
For previous examples typescript error occurs in createQueryBuilder that says “Argument of type 'string' is not assignable to parameter of type 'QueryRunner'.ts(2345)”.
If you check the type of createQueryBuilder, the string cannot come as the first argument.
The types of createQueryBuilder are as follows.
myDataSource.createQueryBuilder<ObjectLiteral>(entityClass: EntityTarget<ObjectLiteral>, alias: string, queryRunner?: QueryRunner | undefined):
2023-12-29 14:52:03 +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
Shabanov Ivan
48f5f85d68
feat: allow to use custom type witch extends object type for find where argument (#10475)
* Allow to use with custom types

* Fix

---------

Co-authored-by: Ivan Shabanov <mail@ivanshabanov.pro>
2023-12-29 13:20:06 +05:00
Jonathan Dumaine
3cf938efc0
fix: add BaseEntity to model-shim (#10503) 2023-12-29 13:13:16 +05:00
seungwonleee
c8ec5429eb
docs: update select-query-builder.md (#10520)
To use alias as the first argument in the createQueryBuilder method, the entity must be imported into the getRepository method to be used.
2023-12-29 13:11:16 +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
Corey Shupe
ebd61d1440
feat: expose countDocuments in mongodb (#10314) 2023-09-30 15:09:58 +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
Akshay Barad
b8af97a31d
docs: update example-with-express.md (#10374) 2023-09-30 14:48:08 +05:00
Mohamed Akram
ba7ad3c69b
fix: circular dependency breaking node.js 20.6 (#10344)
Closes: #10338
2023-09-30 14:47:07 +05:00
Erik McKelvey
8d0e7f98c3
docs: fix naming consistency (#10383) 2023-09-30 14:44:38 +05:00