5602 Commits

Author SHA1 Message Date
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
Mohammad Rayyan
35a3a7f049
docs: added missing import in select-query-builder.md (#10385)
The example for the deleteAt was missing from the import in example of soft delete
2023-09-30 14:44:06 +05:00
Rafi Shamim
9471bfcebc
build: update CockroachDB version to v23.1.9 (#10346)
The previous version is going out of support.
2023-09-22 18:50:52 +05:00
dependabot[bot]
befe4f9cbf
build(deps-dev): bump mongodb from 5.4.0 to 5.8.0 (#10321)
Bumps [mongodb](https://github.com/mongodb/node-mongodb-native) from 5.4.0 to 5.8.0.
- [Release notes](https://github.com/mongodb/node-mongodb-native/releases)
- [Changelog](https://github.com/mongodb/node-mongodb-native/blob/v5.8.0/HISTORY.md)
- [Commits](https://github.com/mongodb/node-mongodb-native/compare/v5.4.0...v5.8.0)

---
updated-dependencies:
- dependency-name: mongodb
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-02 14:52:09 +05:00
Mohammad Rayyan
6378b21119
docs: update select-query-builder.md (#10297)
In the line 315 there was a mistake due to which the technical sense of the sentence was lost. I corrected the typo.
2023-09-02 14:49:44 +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
Jose Toscano
c6f608d3e8
fix: resolve issue building eager relation alias for nested relations (#10004)
* fix: resolve issue building eager relation alias for nested relations

Fix alias error for nested relations. When loading eager relations from
nested levels only the first level was handled through the alias builder

Closes: #9944

* fix: update test: issue-9944 to include postgres

Add postgress as enabled driver for test "issue-9944"

* fix: resolve issue building eager relations withput parsing for "." to get relations

Fix alias error for nested relations by usinf relation.propertyName instead of relation.propertyPath
By using property path, we would have to parse for "." to get the nested relations, but that could
bring issued with column names that had dots within the name.
2023-08-19 20:44:22 +05:00
Guilherme Nogueira
78b2f4805c
feat: implements QueryFailedError generic for driverError typing (#10253)
* chore: linting result

* feat: implements generic to driver error
2023-08-19 20:40:15 +05:00
Juraj Čarnogurský
201342d150
fix: loading datasource unable to process a regular default export (#10184)
The solution to `loadDataSource` was probably designed to adapt to various forms of exports coming from ormconfig.js however it failed to adapt to a very regular case where you just do `module.exports = new DataSource({ ... })` resulting in `Error: Given data source file must contain export of a DataSource instance`

Fixes #8810
2023-08-19 20:39:16 +05:00
Sean McGivern
d937f6106a
fix: scrub all comment end markers from comments (#10163)
This was only removing the first comment end marker, so it was still
possible to generate invalid SQL with the comment method.
2023-08-19 20:36:33 +05:00
Nicolas ROGER
9f8899f56c
fix: improve helper for cli for commands missing positionals (#10133)
* fix: improve helper for cli for commands missing positionals

Add positionals to:
 - MigrationCreateCommand
 - MigrationGenerateCommand
 - SubscriberCreateCommand
 - EntityCreateCommand

* fix: re-enable migration-create/generate tests
2023-08-19 20:34:32 +05:00
hunjin-choi
ca29c0ff8e
feat: modify repository.extend method for chaining repositories (#10256)
* modify repository.extend method. so chainning call this method is possible

* npm run format

* add @ts-ignore at a line

* Object.assign is no more needed

* change code to remove @ts-ignore
2023-08-19 20:32:35 +05:00
Nicklas Laine Overgaard
fbd45dba32
fix: using async datasource to configure typeorm (#10170)
Rather than trying to detect wheter the passed in thing is a promise, we
can simply await it. The `await` operator is defined in such way that if the
thing is not awaitable we simply get the value back

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await#return_value
2023-08-19 20:28:18 +05:00
grainrigi
f8fa1fd821
fix: ignore changes for columns with update: false in persistence (#10250)
Closes: #10249
2023-08-19 20:22:35 +05:00
Daniel Stumme
c8ee5b1d1a
feat: add support for mssql server DefaultAzureCredential usage (#10246) 2023-08-19 18:02:43 +05:00
Matthias Lindinger
7adbc9bdc7
fix: add missing export for View class (#10261) 2023-08-19 17:56:54 +05:00
Nadia Karlinsky
df7c06948c
feat: add MSSQL disableAsciiToUnicodeParamConversion option and tests (#10161)
This adds a new property `disableAsciiToUnicodeParamConversion` to `SqlServerConnectionOptions` to
control whether the `MssqlParameter` types char, varchar, and text are converted to their unicode
equivalents, nchar, nvarchar, and ntext. This defaults to false, maintaining the current behavior.

Closes:  #10131
2023-08-19 17:51:39 +05:00
Raphael Pinto
e72a9da30e
docs: add the some options on Oracle documentation (#10182)
This commit adds the options serviceName and sid on
data-source-options documentation.

Related to #10181
2023-08-19 17:29:17 +05:00
richardvinc
e36aa6ccc3
docs: typo on given example (#10166)
fix typo on given example. it should log `entity`, instead of `post`
2023-08-19 17:27:17 +05:00
Lidhya Jeejan
6b61724cf4
docs: corrected the typos and grammatical errors in README.md (#10145)
Corrected the typos and grammatical errors.
2023-08-19 17:24:45 +05:00
YoungKi Lyu
fcb9904f24
fix: upgrade ts-node version to latest(10.9.1) version (#10143) 2023-08-19 17:22:50 +05:00
Murali
8740adbe9e
docs: update usage of query runner with query builder (#10093)
Co-authored-by: Murali <murali.kambhampati@agxworld.com>
2023-08-19 17:20:37 +05:00
Cody Tseng
ff6e8751d9
docs: change implements to extends (#10219) 2023-07-22 12:52:43 +05:00
dependabot[bot]
dff2d53b4e
build(deps-dev): bump word-wrap from 1.2.3 to 1.2.4 (#10220)
Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-22 12:45:12 +05:00
Umed Khudoiberdiev
a909d5b697 version bump 0.3.17 2023-06-20 12:47:22 -07:00
juliengbt
b1a3a39504
fix: #10040 TypeORM synchronize database even if it is up to date (#10041)
* test: #10040 TypeORM synchronize database even if it is up to date

* formating

* fix: TypeORM synchronize database even if it is up to date #10040
2023-06-20 12:38:55 -07:00
Felix Gohla
7108cc6f71
chore: use new CircleCI convenience images (#10101)
This commit updates the CircleCI images to the new convenience images
(cimg/... instead of circleci/...), as the old ones were deprecated.
Sadly, they do not come with major-only tags.
See the following blog post for more information:
https://circleci.com/docs/next-gen-migration-guide/

Also, the apt cache was not updated before downloading additional
packages.
Thus, an update of the apt cache should fix getting the right packages.

Related to #10100
2023-06-20 07:36:35 -07:00
pro100kryto
f5d43975db
fix: add missing await (#10084) 2023-06-19 11:10:47 -07:00
Felix Gohla
d4607a8672
test: fix test from #9034 with STI for Oracle (#10037)
Oracle does not have a `onUpdate: 'CASCADE'` option.
Thus, the test fixtures had to be adapted.
Checking for the correct `onUpdate` actions for Oracle was introduced in #9786.
2023-05-10 14:40:15 +05:00
Umed Khudoiberdiev
abb9079f2b version bump 0.3.16 2023-05-09 23:57:55 +05:00
AlexMesser
607d6f9595
fix: added transaction retry logic in cockroachdb (#10032)
* added transaction retry logic in cockroachdb

* added option to control max transaction retries;
added delay before transaction retry;
updated docs;

* fixes in retry logic

* enable storing queries after retrying transaction
2023-05-09 23:46:07 +05:00
LoneRifle
8795c864e8
fix: support More/LessThanOrEqual in relations (#9978)
* test(select-buildwhere): exercise More/LessThanOrEqual for relations

Extract the relevant test suite from functional/find-options, modifying
the tests to use the equivalent More/LessThanOrEqual operators

* fix(select-buildwhere): support More/LessThanOrEqual for relations

Tweak `buildWhere()` to recognise more find operators and output
the SQL equivalent

- Recognise `moreThanOrEqual` and `lessThanOrEqual`, in addition to
  `moreThan` and `lessThan`
- If the find operator ends with `OrEqual`, append `=` to the
  SQL operator

* code style change

---------

Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com>
2023-05-09 22:32:41 +05:00
Felix Gohla
06c1e98ae2
fix: create correct children during cascade saving entities with STI (#9034)
* test: test saving disciminators STI, cascading

This commit adds an test for checking whether discriminators are saved
correctly when saving a field with cascade that uses
Single-Table-Inheritance.

Related to: #7758

* fix: Create correct children with STI

This commit fixes the `create` function for EntityManager and Repository
to create entities of correct type when using Single Table Inheritance.
Refactors the otherwise repeated code into a new function on
EntityMetadata.

Related to: #7758

* test: check STI type setting discriminator manually

Related to: #9033

* feature: allow setting discriminator value manually

This commit allows using an instance of a base class in a
Single Table Inheritance scenario and setting the discriminator value
manually.

Related to: #9033

* test: test saving disciminators with trees in STI

This commit adds an test for checking whether discriminators are saved
correctly when saving a tree that also uses Single-Table-Inheritance.

Related to: #7758

* fix: Create correct children with STI and trees

This commit fixes the `create` function for EntityManager and TreeRepository
to create entities of correct type when using Single Table Inheritance
and complex inheritance with Trees.

Related to: #7758
2023-05-09 22:14:01 +05:00