* 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
Adds support to loading entities' relationships with "query" strategy for TreeRepositories
Previously the default method was "join". Implementation is done recursively for n-level
relations
Closes: #9673
* feat: leftJoinAndMapOne and innerJoinAndMapOne now map correctly with QueryBuilder
When joining to a query builder instead of an entity or table name, typeorm now
correctly supports mapping the result to an entity. This introduces a new argument
to the join functions to supply the join attributes with a source of meta data
for the mapping
For example:
const loadedPost = await connection.manager
.createQueryBuilder(Post, "post")
.innerJoinAndMapOne(
"post.tag",
qb => qb.from(Tag, "tag"),
"tag",
"tag.id = post.tagId",
undefined,
// The next argument is new - it helps typeorm know which entity
// to use to complete the mapping for a query builder.
Tag
)
.where("post.id = :id", { id: post.id })
.getOne()
* style: Auto Formatting
* trigger CircleCI
---------
Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com>
Co-authored-by: Dmitry Zotov <dmzt08@gmail.com>
* fix: transform values for FindOperators
Closes: #9381
* refactor: simplify correction
do not transform value, when it is a FindOperator
Closes: #9381
* fix: transform value of FindOperator when it is not a FindOperator
Closes: #9381#9816
* fix: perform transformation on the array instead of each value in case of JsonContains
* fix: remove anti pattern, correct functionality for operators without multiple parameter
* fix: correct linting
* fix: resolve issue when parameterValue is not an instanceof FindOperator
---------
Co-authored-by: ke <ke@sbs.co.at>
* fix: prevent foreign keys support during migration batch under sqlite
Schema changes in migrations batch cannot be done on table which has referring
foreign keys with ON DELETE CASCADE without deleting its content.
Closes: #9770
* Update MigrationExecutor.ts
* Update command.ts
---------
Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com>
When using an Entity column transformer for an object type, the underlying database column may be
sortable, despite the static TypeScript type being an object. The `FindOptionsOrder` typing
should allow sorting on that object property and not require further nesting.
Fixes issue #9895.
* fix: resolves issue with mssql column recreation when length max is in lower case
Closes: #9399
* removed redundant question mark
---------
Co-authored-by: ke <ke@sbs.co.at>
* fix: resolve issues for mssql migration when simple-enum was changed
- Changes are now detected
- Incorrect update Statement was split into a DROP CONSTRAINT and ADD CONSTRAINT Statement
Closes: #7785#9457
* fix: resolve issues for mssql migration when simple-enum was changed
- Changes are now detected
- Incorrect update Statement was split into a DROP CONSTRAINT and ADD CONSTRAINT Statement
Closes: #7785#9457
* code refactoring;
changed `enumName` usage to generated name;
improvements in test;
---------
Co-authored-by: ke <ke@sbs.co.at>
Co-authored-by: Alex Messer <dmzt08@gmail.com>
* refactor: remove date-fns
Since TypeORM only uses one function from the date-fns library
it is unnecessary to install this large package.
* refactor: add DateUtils.parseDateAsISO
* refactor: reintroduced comment
* Added a section on debugging query builder
It covers using getQuery() and getQueryAndParameters() which are both useful when trying to figure out why your query isn't doing what you might expect it should do.
* forgot await
* fix typo
* documented getCount()
getCount() is currently only mentioned in the documentation once, and you're never shown how to use it. This patch adds a little documentation for getCount()
* clarification
* feat: Add support for SQL aggregate functions SUM, AVG, MIN, and MAX to the Repository API
* rename field name to make tests work in oracle
* fix the comments
* update the docs
* escape column name
* address PR comment
* format the code
* fix: add support for mongodb driver v4
This new fix allow support to mongodb driver v4
Closes: #7907
* fix: add support for mongodb driver v4
This new fix allow support to mongodb driver v4
Closes: #7907
---------
Co-authored-by: Matheus Melo Antiquera <matheusantiquera@finchsolucoes.com.br>
* feat: naming strategy for legacy Oracle
This feature is LegacyOracleNamingStrategy which can be used to handle Oracle error ORA-00972.
* feat: naming strategy for legacy Oracle
This feature is LegacyOracleNamingStrategy which can be used to handle Oracle error ORA-00972.
* test: add test that where condition can accepts LessThan with Union
* fix: allow FindOptionsWhere to accept LessThan with Union
* added comment and simplified the type
---------
Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com>