* 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>
* 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>
* 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.
* 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>
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.
* 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>
* 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.
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
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.
* 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
* 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>
* 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
* fix: correct encode mongodb auth credentials
when use the special character `@` into mongodb password result in unauthorized because the it has no encoding
Closes: #9885
* we need to close connections at the end
* fixed js issue
* adjust import statement
* style: run prettier
---------
Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com>
* fix: Convert the join table ID to the referenceColumn ID type
* test: add auto-increment-id-as-string test
* style: format auto-increment-id-as-string test
* fix: add support for mongodb driver v5
This new fix allow support to mongodb driver v5
Closes: #7907
* refactor: remove callback from MongoDriver connect
* fix: check for propertyName in transform
* fix: add support for mongodb driver v5
This new fix allow support to mongodb driver v5
Closes: #7907
* feat: mongodb 5.2.0 typings
* fix: instanceof ObjectId check
Instanceof check now no longer references to just the
type but the loaded class ref instead.
* test: fix test name to mongodb v5
---------
Co-authored-by: Matheus Melo Antiquera <matheusantiquera@finchsolucoes.com.br>
Co-authored-by: tgrassl <grassl.timon@gmail.com>
Co-authored-by: Matheus Melo Antiquera <matheus.melo.a@hotmail.com>
* test: cli init with local typeorm package
Uses the locally built files instead of the typeorm
package published to npmjs. This enables testing project
initialisation with unreleased typeorm package versions.
* fix: enable init cli to be testable w non-releases
* small optimization in driver utils - shortening alias become a bit faster
* added entity metadatas as a map into DataSource for search optimization purposes
* ultra small optimization - looks like symbols work slow. Need to re-think its usage
* small optimizations to improve performance
* replace property names optimization
* tsc error fix
* big optimization - now replacePropertyNames executed only for the final SQL query
* trying to fix the bug in select query builder with orders not being properly replaced with their aliaces
* fixing tests