-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add support for SQL aggregate functions SUM, AVG, MIN, and MAX to the Repository API #9737
Conversation
8ab821b
to
2371f6e
Compare
0cb49f6
to
798d620
Compare
798d620
to
8c630e0
Compare
/** | ||
* Pick only the keys that match the Type `U` | ||
*/ | ||
export type PickKeysByType<T, U> = string & |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the point of string &
here? it completely makes useless the next code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
without the string
this type evaluates to string | number | symbol
, since those are the key types any object can have. Forcing T
to extends from ObjectLiteral
doesn't help either.
I can remove the string &
here, but then we need to use String(columnName)
in this.connection.driver.escape
in callAggregateFun
.
Adding string &
helps prevent users passing in numbers and symbols (which would fail).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found out the issue in case when field in the model has custom column name in the database. For example, field name balanceValue
, but in the table it is balance_value
. TS force me set balanceValue
but generated SQL contains the wrong field at the end.
8c630e0
to
0635d26
Compare
Thanks. Can you please format the code, since lint has failed. |
Thank you for contribution! 🎉 |
[Now we can use aggregate functions directly over the repository API](typeorm/typeorm#9737)
[Now we can use aggregate functions directly over the repository API](typeorm/typeorm#9737)
…he Repository API (typeorm#9737) * 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
[Now we can use aggregate functions directly over the repository API](typeorm/typeorm#9737)
.select( | ||
`${fnName}(${this.connection.driver.escape( | ||
String(columnName), | ||
)})`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* feat: added opaque types support over primitives in find-options (typeorm#9560) * added opaque types support over primitives in find-options * removed lock-verify because of its deprecation * fixing auto type mapping * docs: improve zh docs (typeorm#9575) * docs: general grammer (typeorm#9574) * Github issue templates converted to forms (typeorm#9434) * Update and rename bug-report.md to bug-report.yml * Update and rename documentation-issue.md to documentation-issue.yml * Update and rename feature-request.md to feature-request.yml * checkboxes * Update feature-request.yml * Update feature-request.yml Co-authored-by: AlexMesser <dmzt08@gmail.com> * feat: allow peerDependency of better-sqlite3 version 8.x.x (typeorm#9564) closes typeorm#9563 * docs: removed unnecessary slash in comments (typeorm#9533) * fix: pass fake flag to undoLastMigration (typeorm#9562) Closes: typeorm#9561 * build(deps): bump decode-uri-component from 0.2.0 to 0.2.2 (typeorm#9590) Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2. - [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases) - [Commits](SamVerschueren/decode-uri-component@v0.2.0...v0.2.2) --- updated-dependencies: - dependency-name: decode-uri-component dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: correctly return insertId for react-native (typeorm#9554) * fix: the mpath is incorrect when the parent of the tree entity is null (typeorm#9535) * fix: the mpath is incorrect when the parent of the tree entity is null * lint: code format * fix: findTrees not have children * test: add unit test * style: format code * fix: unit test * fix: unit test * fix: unit test * docs: add in an example for 4526 (typeorm#9538) * docs: add in an example for 4526 * small fixes Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com> * feat: "And" operator in FindOptions (typeorm#9489) Closes typeorm#3113 * fix: left instead of inner join for where or + optional relations (typeorm#9516) * fix: typings for Repository.extend function (typeorm#9396) additionally remove duplicated TreeRepository.extend method * feat: index support for materialized views of PostgreSQL (typeorm#9414) * feat: Added new indices attribute to View * feat: Added view indices methods Such as dropViewIndex, addViewIndices, addViewIndex Added "View" type in some parameters of methods * feat: Added view indices support when creating new indices and dropping old indices * ref: Renamed "table" to "view" in log when dropping view index * feat: changed order of schema sync operations To create a new view index, a view has to be created first. * feat: removed unreachable code A view object don't have its indices when creation. The indices are added to the view through the createViewIndex method. * feat: Added view when returning TableIndex * feat: Added view paths as argument in getViews on log method * feat: Created createViewIndexSql This method reuses code from createIndexSql, but eliminates the isSpatial part, because a viewColumn doesn't support this attribute. * fix: Added missing columns const to createViewIndexSql * feat: Removed isSpatial attribute when returning TableIndex * feat: Added unit tests * fix: Dropped current index to leave unique index on indices array There was a bug that when asserting the unique index, it would compare with the previous index, even when explicitly selecting the unique index in the indices array. * ref: lint files * feat: added "postgres" in enabledDrivers attribute This is to enable only PostgreSQL for the tests * feat: added doc for materialized view indices * ref: lint files * feat: Added new method to create mat. view indices This new method goes after creating the views. Aditionally, the views are now created at the end (as it was before) * ref: prettify files * feat: revamped tests Replaced previous unit tests with more significant ones * docs: Improve comprehension of update repository API (typeorm#9417) * Improve comprehension of update repository API Because the previous doc example was `await repository.update({ firstName: "Timber" }, { firstName: "Rizzrak" })`, I got confused and reversed the **WHERE** condition and the actual **change**. This change is just a suggestion to avoid that kind of confusion * Apply the same doc suggestion change to the entity manager update API * feat: upsert options conflictPaths as Entity keys (typeorm#9365) * feature: upsert options conflictPaths as Entity keys * feature: upsert options conflictPaths as object * feature: upsert options conflictPaths as object Co-authored-by: Pavel <pavel@loanbase.com> * docs: update "migrate:show error code" description (typeorm#9476) * feat: add id in migrate:show command logging (typeorm#9475) * feat: add Open DB Flags and URI DB Name in SQLite (typeorm#9468) * Add the open database flags for sqlite3. * Check for URI before trying to create the DB dir. * Spacing. * Add the sqlite open connection flags. * Spacing. Co-authored-by: Adrian Burlacu <adrian.burlacu@live.com> * fix: assign isInitialized: true at the end of .initialize() method (typeorm#9455) * fix: cacheId not used when loading relations with take (typeorm#9469) * fix: cacheId not used loading relations The cacheId is set to undefined for the main request used for pagination when we load related entities * fix: tests * feat: add parseInt8 option to postgres driver. Closes typeorm#9341 (typeorm#9435) * feat: add parseInt8 option to postgres driver * chore: formatting * Revert "fix: assign isInitialized: true at the end of .initialize() method (typeorm#9455)" (typeorm#9591) This reverts commit 81fc9a9. * fix: fixed outdated `init` command (typeorm#9422) * fix: Updating the samples current version of typeorm. The cli sample was using the getRepository version in the UserController and in the current versions of the typeorm it was deprecated. Basically I changed the code to the current version using AppDataSource. * fix: improving code and fixing bugs I made several changes to the functions because they had bugs, such as the id being a "string" instead of a "number", the "userRepository" methods being outdated and checking the code to see if the user exists before doing some executions * feat: migration:generate successful exit the process with zero code (typeorm#9288) * fix: disable transactionSupport option for CordovaDriver (typeorm#9391) * fix: disable transaction support for cordova driver the cordova-sqlite-storage plugin does not support transactions. fc4133c introduced an exception when starting a transactions but did not disable the transactionSupport in general leading to errors when using the `save` and `remove` method of the `EntityPersistExecutor`. With this PR the `EntityPersistExecutor` will respect the drivers `transactionSupport` option. * docs: add note on transaction limitations for cordova driver * feat: implement exists query method (typeorm#9303) Adding `Exists` method to query builder and EntityManager, to check whether a row exists given the conditions Closes: typeorm#2815 Co-authored-by: mortzprk <mortz.prk@gmail.com> * feat: Add synchronize to @jointable (typeorm#9442) * feat: Add synchronize option to @jointable Add synchronize option to @jointable. It allows to ignore JoinTable when syncing and generating migrations. Closes typeorm#3443 * removed only * lint fix Co-authored-by: Bartlomiej Rutkowski <brutkowski@tilt.app> Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com> Co-authored-by: Alex Messer <dmzt08@gmail.com> * lint fix * feat: allow for partial index conditions for on conflict statments in postgres (typeorm#8971) * feat: allow for partial index conditions for on conflict statments in postgres * fix: change variable to match postgres documentation and convert from array to string type * fix: generalize use of index predicate. add documentation and expand test cases * lint fix Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com> Co-authored-by: Alex Messer <dmzt08@gmail.com> * fixed latest typescript-related issue * feat: allow per-migration control over transaction behavior (typeorm#9459) Closes typeorm#7087 * fix : primary constraint name undefined error (typeorm#9576) * fix : primary constraint name undefined erorr for PostgresQueryRunner.ts * Update src/driver/postgres/PostgresQueryRunner.ts Co-authored-by: leo-jnesis <55386067+leo-jnesis@users.noreply.github.com> Co-authored-by: AlexMesser <dmzt08@gmail.com> Co-authored-by: leo-jnesis <55386067+leo-jnesis@users.noreply.github.com> * version bump * docs: fix missing ) (typeorm#9629) * fix: DataSource.setOptions doesn't properly update the database in the drivers (typeorm#9635) * make sure we update database in the driver if it was dynamically set (via dataSource.setOptions) * removed validation for database since we definitely shouldn't have it in the constructor, database can be set later on (e.g. datasource.setOptions) * fix: multiple select queries during db sync in sqlite (typeorm#9639) * fixed multiple select queries during db sync in sqlite * docs: correct typo (typeorm#9655) * docs: correct a typo (typeorm#9651) * docs: correct typo (typeorm#9643) * Create SECURITY.md * fix: allow to pass ObjectLiteral in mongo find where condition (typeorm#9632) Closes: typeorm#9518 * feat: support busy_timeout param parameter for sqlite (typeorm#9623) Co-authored-by: sinkhaha <1468709606@qq.com> * fix: materialized hints support for cte (typeorm#9605) Fix implementation of materialized hints in common table expressions Previous behavior did not account for NOT MATERIALIZED hints, also placed materialized hints in wrong place (before "AS") Co-authored-by: Adrian Parry <adrian.parry@reign.cl> * fix: synchronizing View with schema broken for oracle (typeorm#9602) * fix view+schema broken for oracle * apply prettier * fixed missing schema in loadViews(); added test (with .only) * removed .only Co-authored-by: James Jurach <James.Jurach@apiture.com> Co-authored-by: Alex Messer <dmzt08@gmail.com> * removed titles from issue templates * docs: fix some typo in migration document (typeorm#9667) * feat: support time travel queries, upsert, enums, spatial types in cockroachdb (typeorm#9128) * feature: adds support for enum type (fixes typeorm#9068) * temporarily ran package to test on different repo * playing around - bumped version * Revert "playing around - bumped version" This reverts commit 7df4adb. * Revert "temporarily ran package to test on different repo" This reverts commit 48f394e. * feat: add support for geometry data type * feature: properly hydrate enum array values * feature: adds support for geography and geometry for cockroachdb * bugfix: fixes issue with primary generated columns being invalid column type (fixes typeorm#8532) * Revert "bugfix: fixes issue with primary generated columns being invalid column type (fixes typeorm#8532)" This reverts commit e00cdb0. * bugfix: type casts to string when using ANY * feature: cast geometry/geography to geojson * feature: added references to srid * bugfix: prevent error if trying to close already closed connection * feature: added cockrachodb as part of postgres family * feature: ensures support for spatial columns for cockroachdb * feature: adds support for UPSERT for CockroachDB (fixes typeorm#9199) * minor: added TODO; unsure how to achieve this * feature: adds support for time travelling queries for cockroachdb * bugfix: only run time travel query on SELECT statements * refactor: changed UsertType from 'upsert' to 'primary-key' since this is more logical * feature: added posibility to set timeTravelQuery to false, instead of the parameter function; help for disabling time travel queries during tests * feature: allow timeTravelQueries in find* queries * bugfix: when using timetravel queries with joinAttributes it now prevents error 'AS OF SYSTEM TIME must be in top level' error * lint * minor fix * fixed failing test * implemented ENUM type; added tests; * fixed failing tests * fixed failing test * fixed spatial types synchronization; implemented spatial indices; added tests for spatial columns; * refactored Time Travel Query functionality; removed TTQ from find options; added tests for TTQ; * added docs for Time Travel Queries * minor changes * added GeoJSON types; other minor fixes; * updated docs * updated docs Co-authored-by: Dmitry Zotov <dmzt08@gmail.com> * refactor: remove a deprecated function (typeorm#9702) * fix: remove unnecessary .js extension in imports (typeorm#9713) * fix: remove extension when importing file * removed unnecessary .js extension in imports --------- Co-authored-by: Dmitry Zotov <dmzt08@gmail.com> * chore: add *.iml to .gitignore (typeorm#9707) * test: Add test to prove that issue typeorm#2331 is resolved (typeorm#9688) * test: update multiple nested embedded entities (typeorm#9696) * test: update multiple nested embedded entities Closes: typeorm#1200 * test: update multiple nested embedded entities - fix for ORA-00972 - shorter names Closes: typeorm#1200 * test: correct test name for issue 1200 Closes: typeorm#1200 * fix: overriding caching settings when alwaysEnabled is true (typeorm#9731) * 9023-2 Fix cache overriding option * 9023-2 Fix format * docs: update many-to-many-relations.md (typeorm#9736) * build(deps): bump http-cache-semantics from 4.1.0 to 4.1.1 (typeorm#9758) Bumps [http-cache-semantics](https://github.com/kornelski/http-cache-semantics) from 4.1.0 to 4.1.1. - [Release notes](https://github.com/kornelski/http-cache-semantics/releases) - [Commits](kornelski/http-cache-semantics@v4.1.0...v4.1.1) --- updated-dependencies: - dependency-name: http-cache-semantics dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: Fix grammar error in no migrations found log (typeorm#9754) * docs: Fix grammar error in the first paragraph. (typeorm#9759) docs: Fix grammar (verbal agreement) error in the first paragraph. * feat: allow mysql2 v3 as peerDependency (typeorm#9747) Closes typeorm#9714 * fix: make sure "require" is defined in the environment * fix: redundant Unique constraint on primary join column in Postgres (typeorm#9677) * test: one migration for PrimaryColumn and JoinColumn in pg * fix: stop postgres from creating unique on PrimaryColumn with JoinColumn * fix: resolve issue with "simple-enum" synchronization in SQLite (typeorm#9716) * fix: resolve issue with "simple-enum" in sqlite Closes: typeorm#9715 * trying to re-trigger CircleCI tests --------- Co-authored-by: Dmitry Zotov <dmzt08@gmail.com> * fix: improved `FindOptionsWhere` behavior with union types (typeorm#9607) * 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> * fix: sql expression when `where` parameter is empty array (typeorm#9691) Closes: typeorm#9690 Co-authored-by: Dmitry Zotov <dmzt08@gmail.com> * feat: naming strategy for legacy Oracle (typeorm#9703) * 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. * feat: add find operator json contains (typeorm#9665) * feature: add find operator json contains * add test --------- Co-authored-by: Игорь Сары <isary@MacBook-Pro-Igor.local> Co-authored-by: dzvyagin <dzvyagin@team.amocrm.com> * docs: update cli related docs (typeorm#9659) - remove cli.entitiesDir description - remove cli.subscribersDir description - remove cli from Data Source Options example - extend migration:run examples with -- -d path-to-datasource-config - extend migration:revert examples with -- -d path-to-datasource-config - extend migration:show examples with -- -d path-to-datasource-config - extend migration:create examples with path-to-migrations-dir/migrationName Co-authored-by: Stefan <stefi@sprintingsoftware.com> * feat: support enableWal for the better-sqlite3 driver (typeorm#9619) * fixed wrong callback definition in tests * fix: Incorrect enum default value when table name contains dash character (typeorm#9685) * fix: get enum default value * chore: format * fix: add support for mongodb v4 (typeorm#9450) * fix: add support for mongodb driver v4 This new fix allow support to mongodb driver v4 Closes: typeorm#7907 * fix: add support for mongodb driver v4 This new fix allow support to mongodb driver v4 Closes: typeorm#7907 --------- Co-authored-by: Matheus Melo Antiquera <matheusantiquera@finchsolucoes.com.br> * Revert "fix: add support for mongodb v4 (typeorm#9450)" (typeorm#9762) This reverts commit 8150525. * fix: incorrect sorting of entities with multi-inheritances (typeorm#9406) * Fixed sorting of entities with multi-inheritances * prettier * added test case --------- Co-authored-by: Alex Messer <dmzt08@gmail.com> * removed unnecessary .js extension in imports * refactor: use abstract logger to reduce duplicate code (typeorm#9751) * feat(platform-tools): add more logging functions * refactor(logger): add `AbstractLogger` to reduce duplicate code --------- Co-authored-by: Christian Forgács <christian@wunderbit.de> * feat: update mssql dependency and other dependencies as well (typeorm#9763) * updating dependencies * fixing circleci config * reverting mongodb version back * increasing cli commands test timeout * feat: support for SQL aggregate functions SUM, AVG, MIN, and MAX to the Repository API (typeorm#9737) * 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 * version bump * fix: react-native doesn't properly work in ESM projects because of circular dependency (typeorm#9765) * fix: use forward slashes when normalizing path (typeorm#9768) Fixes typeorm#9766 * docs: documented getCount() method (typeorm#9847) * 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 * docs: update relations-faq (typeorm#9879) Proposed a better safe-type workaround for circular dependencies. * docs: update many-to-many-relations.md (typeorm#9861) Fixing typescript code. * docs: added a documentation section on debugging query builder (typeorm#9846) * 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 * refactor: remove date-fns package (typeorm#9634) * 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 * build(deps): bump jsonwebtoken and mssql (typeorm#9700) Bumps [jsonwebtoken](https://github.com/auth0/node-jsonwebtoken) to 9.0.0 and updates ancestor dependency [mssql](https://github.com/tediousjs/node-mssql). These dependencies need to be updated together. Updates `jsonwebtoken` from 8.5.1 to 9.0.0 - [Release notes](https://github.com/auth0/node-jsonwebtoken/releases) - [Changelog](https://github.com/auth0/node-jsonwebtoken/blob/master/CHANGELOG.md) - [Commits](auth0/node-jsonwebtoken@v8.5.1...v9.0.0) Updates `mssql` from 7.3.0 to 9.0.1 - [Release notes](https://github.com/tediousjs/node-mssql/releases) - [Changelog](https://github.com/tediousjs/node-mssql/blob/master/CHANGELOG.txt) - [Commits](tediousjs/node-mssql@v7.3.0...v9.0.1) --- updated-dependencies: - dependency-name: jsonwebtoken dependency-type: indirect - dependency-name: mssql dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: resolve issues for mssql migration when simple-enum was changed * 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: typeorm#7785 typeorm#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: typeorm#7785 typeorm#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> * fix: resolves issue with mssql column recreation (typeorm#9773) * fix: resolves issue with mssql column recreation when length max is in lower case Closes: typeorm#9399 * removed redundant question mark --------- Co-authored-by: ke <ke@sbs.co.at> * feat: allow type FindOptionsOrderValue for order by object property (typeorm#9895) (typeorm#9896) 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 typeorm#9895. * fixing failing test * feat: Broadcast identifier for removed related entities (typeorm#9913) * Initial commit * Pending changes exported from your codespace * Revert changes * Fix format * test: when calling AVG on an integer column, MS SQL Server returns an int. (typeorm#9784) In this case, 50 instead of 50.5. Apparently the ANSI standard for SQL is silent on this issue, so either behavior should be considered acceptable. * fix: loading tables with fk in sqlite query runner (typeorm#9875) Closes: typeorm#9266 * fix: improve EntityNotFound error message in QueryBuilder.findOneOrFail (typeorm#9872) * fix: EntityNotFound error message in QueryBuilder.findOneOrFail * change test * change test * change test * fix: proper default value on generating migration when default value is a function calling [Postgres] (typeorm#9830) Co-authored-by: Dmytro Boiko <dmitriy.b@tracktica.com> * docs: update migrations docs (typeorm#9828) * feat: add support for STI on EntitySchema (typeorm#9834) * feat: add support for STI on EntitySchema Closes: typeorm#9833 * fix: run prettier --------- Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com> * fix: use object create if entity skip constructor is set (typeorm#9831) * feat: add support for json datatype for sqlite (typeorm#9744) * fix: prevent foreign key support during migration batch under sqlite (typeorm#9775) * 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: typeorm#9770 * Update MigrationExecutor.ts * Update command.ts --------- Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com> * fix: transform values for FindOperators typeorm#9381 (typeorm#9777) * fix: transform values for FindOperators Closes: typeorm#9381 * refactor: simplify correction do not transform value, when it is a FindOperator Closes: typeorm#9381 * fix: transform value of FindOperator when it is not a FindOperator Closes: typeorm#9381 typeorm#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> * feat: leftJoinAndMapOne and innerJoinAndMapOne map result to entity (typeorm#9354) * 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: handles "query" relation loading strategy for TreeRepositories (typeorm#9680) 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: typeorm#9673 * fix: firstCapital=true not working in camelCase() function * feat: QueryBuilder performance optimizations (typeorm#9914) * 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 * version bump * fix: wrong dependency version in init command * fix: drop xml & yml connection option support (typeorm#9930) * version bump * added package lock * ci: wait if oracle db is enabled in test suite (typeorm#9946) * test: cli init with local typeorm package (typeorm#9926) * 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 * feat: support for the latest mongodb v5 (typeorm#9925) * fix: add support for mongodb driver v5 This new fix allow support to mongodb driver v5 Closes: typeorm#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: typeorm#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> * fix: SelectQueryBuilder builds incorrectly escaped alias in Oracle when used on entity with composite key (typeorm#9668) * Update SelectQueryBuilder.ts Bug fix, In case a unique alias is created in first query then result was not getting mapped properly. * lint fix --------- Co-authored-by: Dmitry Zotov <dmzt08@gmail.com> * chore: better console.log (typeorm#9924) * refactor: combine sqlite json and simple-json handling (typeorm#9937) * docs: wrong documentation on QueryBuilder.getCount() (typeorm#9935) * fix: make cache optional fields optional (typeorm#9942) This patch allows the getFromCache caller to only pass in identifier or query field, as getFromCache already handles the identifier and query field checks Co-authored-by: ru.c <ru@shuffle.com> * fix: prevent unique index identical to primary key (all sql dialects) (typeorm#9940) Co-authored-by: Lucian Mocanu <lucian.mocanu@nexontis.com> * fixed compiler error * version bump * docs: issue typeorm#8860 (typeorm#9951) * fixed: issue typeorm#8860 * example looks rough --------- Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com> * fix: add directConnection options to MongoDB connection (typeorm#9955) Co-authored-by: afournier <afournier@solocal.com> * docs: update entity-manager-api.md (typeorm#9956) typo: const timber = await manager.findOne(User, { firstName: "Timber" }) → const timber = await manager.findOneBy(User, { firstName: "Timber" }) Co-authored-by: Jo YoHan <37216082+oxyrinchus@users.noreply.github.com> * fix: resolve duplicate subscriber updated columns (typeorm#9958) Closes: typeorm#9948 * fix: select + addOrderBy broke in 0.3.14 (typeorm#9961) * added test for typeorm#9960 * fixing the issue * limiting only to postgres because of NULLS FIRST syntax * lint * refactor: query methods should accept generic for return type (typeorm#9957) * query should accept generics * Update DataSource.ts * feat: mariadb uuid inet4 inet6 column data type support (typeorm#9845) * feat: mariadb inet4, inet6, uuid data type support * refactor: cleanup unnecessary methods * style: mysqldriver formatting * fix: handle length column metadata mariadb uuid * fix: 8832 test suite to verify errors correctly * style: fix 8832 test formatting * fix: 8832 error testing cleanup * fix: remove defaulting column type feature * style: fix formatting * fix: remove unnecessary dbms error test * fix: remove unused import in test * fix: ensure defaulting uuid generation column type * fix: mongodb typings breaks the browser version (typeorm#9962) * fix: exclude mongodb typings from browser Closes: typeorm#9959 fix: delete unnessecary dummy file * another fix for bson typings problem in browser --------- Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com> * revert: "refactor: remove date-fns package (typeorm#9634)" This reverts commit 1fcd9f3 * fix: allow json as alias for longtext mariadb (typeorm#10018) * fix: express option bug in init command (typeorm#10022) * Fix express option bug in init command * fixed esm support in command * fix linter --------- Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com> * fix: RelationIdLoader has access to queryPlanner when wrapped in transaction (typeorm#9990) fix issue - createQueryBuilder in repository loses queryplanner when wrapped in txn upsteam until RelationIdLoader Closes: typeorm#9988 * fix: add `trustServerCertificate` option to `SqlServerConnectionOptions` (typeorm#9985) * fix: add missing 'trustServerCertificate' option to SqlServerConnectionOptions interface Closes: typeorm#8093 * docs: add `trustServerCertificate` description to mssql data source options docs * fix: consistency between jsdoc and docs --------- Co-authored-by: jrybarczyk <jrybarczyk@exclusiveresorts.com> * fix: added instanceName to options (typeorm#9968) * added instanceName to options * run prettier --------- Co-authored-by: Jens Horch <horch@hector.de> * fix: for running cli-ts-node-esm use exit code from child process (typeorm#10030) Use child process exit code in parent process to properly indicate that child process (migration running) fails Closes: typeorm#10029 * fix: add onDelete option validation for oracle (typeorm#9786) * fix: add onDelete option validation for oracle Closes: typeorm#9189 * refactor: move fk validation logic to EntityMetadataValidator.ts * fix: skip assertion for other databases * fix: styles --------- Co-authored-by: ke <ke@sbs.co.at> * fix: convert the join table ID to the referenceColumn ID type (typeorm#9887) * 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: correct encode mongodb auth credentials (typeorm#10024) * fix: correct encode mongodb auth credentials when use the special character `@` into mongodb password result in unauthorized because the it has no encoding Closes: typeorm#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: create correct children during cascade saving entities with STI (typeorm#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: typeorm#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: typeorm#7758 * test: check STI type setting discriminator manually Related to: typeorm#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: typeorm#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: typeorm#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: typeorm#7758 * fix: support More/LessThanOrEqual in relations (typeorm#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> * fix: added transaction retry logic in cockroachdb (typeorm#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 * version bump * test: fix test from typeorm#9034 with STI for Oracle (typeorm#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 typeorm#9786. * fix: add missing await (typeorm#10084) * chore: use new CircleCI convenience images (typeorm#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 typeorm#10100 * fix: typeorm#10040 TypeORM synchronize database even if it is up to date (typeorm#10041) * test: typeorm#10040 TypeORM synchronize database even if it is up to date * formating * fix: TypeORM synchronize database even if it is up to date typeorm#10040 * feat: Added back fork spanner changes * fix lock version --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com> Co-authored-by: smile1sky <82568280+smile-sky20@users.noreply.github.com> Co-authored-by: Bikram Suwal <veekramsuwal@gmail.com> Co-authored-by: Dominic Ruggiero <dominic@userexe.me> Co-authored-by: AlexMesser <dmzt08@gmail.com> Co-authored-by: Danny Koppenhagen <mail@k9n.dev> Co-authored-by: Oskar Jaskólski <oskarrro90@gmail.com> Co-authored-by: Barak Shelef <107487965+barakshelef-oasis@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Arnaud de Mouhy <1552768+dehy@users.noreply.github.com> Co-authored-by: Sakura <54829481+Yuuki-Sakura@users.noreply.github.com> Co-authored-by: Charlton Austin <charlton.austin@gmail.com> Co-authored-by: Jeffyter Saraiva <35247554+iJhefe@users.noreply.github.com> Co-authored-by: Patrick Gallagher <pfgallagher@users.noreply.github.com> Co-authored-by: Coroliov Oleg <1880059+ruscon@users.noreply.github.com> Co-authored-by: Gonzalo Rodulfo Martínez <23481808+rodzalo@users.noreply.github.com> Co-authored-by: Charlély Delgrange <charlely.delgrange@gmail.com> Co-authored-by: Pavel Petrik <redwert@users.noreply.github.com> Co-authored-by: Pavel <pavel@loanbase.com> Co-authored-by: kz-d <116164465+kz-d@users.noreply.github.com> Co-authored-by: Adrian Burlacu <63519230+adrian-burlacu-software@users.noreply.github.com> Co-authored-by: Adrian Burlacu <adrian.burlacu@live.com> Co-authored-by: Gentilhomme <gentilhomme.thomas@gmail.com> Co-authored-by: 4l3ss <2623600+4l3ss@users.noreply.github.com> Co-authored-by: Dan Manastireanu <498419+danmana@users.noreply.github.com> Co-authored-by: userUndefined ✌️ <80859038+thalles-victor@users.noreply.github.com> Co-authored-by: Nedim Arabacı <nedimarabaci@gmail.com> Co-authored-by: Michael Wolz <michaelwolz93@gmail.com> Co-authored-by: Morteza PRK <mortezaPRK@users.noreply.github.com> Co-authored-by: mortzprk <mortz.prk@gmail.com> Co-authored-by: Bartłomiej Rutkowski <b.rutkowski94@gmail.com> Co-authored-by: Bartlomiej Rutkowski <brutkowski@tilt.app> Co-authored-by: Derek Bonner <deekthesqueak@users.noreply.github.com> Co-authored-by: Tim Beyer <tim.beyer@gmail.com> Co-authored-by: Kadir <kadiraciktan@gmail.com> Co-authored-by: leo-jnesis <55386067+leo-jnesis@users.noreply.github.com> Co-authored-by: Saad A. Bazaz <saadbazaz@hotmail.com> Co-authored-by: r-shirasu <82349387+r-shirasu@users.noreply.github.com> Co-authored-by: Mahmoud Almontasser <almontasser@users.noreply.github.com> Co-authored-by: JesseNeon <62482001+JesseAyegba@users.noreply.github.com> Co-authored-by: ayuvlasenko <77232221+ayuvlasenko@users.noreply.github.com> Co-authored-by: sinkhaha <1468709106@qq.com> Co-authored-by: sinkhaha <1468709606@qq.com> Co-authored-by: Adrian Parry <44247645+subparry@users.noreply.github.com> Co-authored-by: Adrian Parry <adrian.parry@reign.cl> Co-authored-by: James Jurach <james.jurach@gmail.com> Co-authored-by: James Jurach <James.Jurach@apiture.com> Co-authored-by: Sho Ogawa <60885375+linus-sh@users.noreply.github.com> Co-authored-by: Mattias Fjellvang <simplenotezy@users.noreply.github.com> Co-authored-by: summer-boythink <57977288+summer-boythink@users.noreply.github.com> Co-authored-by: 변경연 <39257313+eric-byun@users.noreply.github.com> Co-authored-by: Filip Wróbel <17615126+f-wrobel@users.noreply.github.com> Co-authored-by: Lukas Spiss <35728419+Spissable@users.noreply.github.com> Co-authored-by: Pavel Kolpakov <kolpakov-p@yandex.ru> Co-authored-by: Zeeshan Haider Khan <50953718+zeeshanhaiderkhan@users.noreply.github.com> Co-authored-by: Josh Heng <josh@joshheng.co.uk> Co-authored-by: Vítor L. Brasil <97890530+vitorlbrasil@users.noreply.github.com> Co-authored-by: Dev Aggarwal <22045791+aggarwaldev@users.noreply.github.com> Co-authored-by: Kilian Finger <hey@kilianfinger.com> Co-authored-by: Vista1nik <vista1nik@gmail.com> Co-authored-by: Toshinori Tsugita <tsugita.dev@gmail.com> Co-authored-by: PronDmytro <67123804+PronDmytro@users.noreply.github.com> Co-authored-by: ISary-ge <67458138+ISary-ge@users.noreply.github.com> Co-authored-by: Игорь Сары <isary@MacBook-Pro-Igor.local> Co-authored-by: dzvyagin <dzvyagin@team.amocrm.com> Co-authored-by: StefanZivkovic <44195291+StefanZivkovic@users.noreply.github.com> Co-authored-by: Stefan <stefi@sprintingsoftware.com> Co-authored-by: Aritz <6377040+xtremebiker@users.noreply.github.com> Co-authored-by: Khaled Sameer <khaled.smq@hotmail.com> Co-authored-by: Matheus Melo Antiquera <33763956+MatheusMeloAntiquera@users.noreply.github.com> Co-authored-by: Matheus Melo Antiquera <matheusantiquera@finchsolucoes.com.br> Co-authored-by: ZBAGI <zbagi@poczta.fm> Co-authored-by: Christian Forgács <christian@forgacs.me> Co-authored-by: Christian Forgács <christian@wunderbit.de> Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <netroy@users.noreply.github.com> Co-authored-by: 0x269 <33447608+truemogician@users.noreply.github.com> Co-authored-by: JT Smith <jt@plainblack.com> Co-authored-by: Ihor Levchenko <ifree92@gmail.com> Co-authored-by: Peter Hostačný <hostacny.peter@gmail.com> Co-authored-by: jdgjsag67251 <88368191+jdgjsag67251@users.noreply.github.com> Co-authored-by: ertl <klaus.ertl1@gmail.com> Co-authored-by: ke <ke@sbs.co.at> Co-authored-by: Dylan Seago <dylanseago@users.noreply.github.com> Co-authored-by: Philipp Dyck <pdyck@users.noreply.github.com> Co-authored-by: Leon Miller-Out <leon@singlebrook.com> Co-authored-by: GP4cK <gautier.bayzelon@gmail.com> Co-authored-by: Daniel Huth <4455258+Agreon@users.noreply.github.com> Co-authored-by: dmytroboiko <dmytro@pipernet.com> Co-authored-by: Dmytro Boiko <dmitriy.b@tracktica.com> Co-authored-by: Alexander Kraev <98308330+alexander-kraev-snyk@users.noreply.github.com> Co-authored-by: Gabriel Kim <68445851+gabrielkim13@users.noreply.github.com> Co-authored-by: Joe Mizzi <themizzi@me.com> Co-authored-by: Nguyen Ba Hung <bahung1221@gmail.com> Co-authored-by: sinopsysHK <sinofwd@gmail.com> Co-authored-by: acuthbert <acuthbert@gcdtech.com> Co-authored-by: Jose Toscano <42146866+JoseCToscano@users.noreply.github.com> Co-authored-by: mptr <54647612+mptr@users.noreply.github.com> Co-authored-by: tgrassl <grassl.timon@gmail.com> Co-authored-by: Matheus Melo Antiquera <matheus.melo.a@hotmail.com> Co-authored-by: Alankarsharma <alankar.sharma005@gmail.com> Co-authored-by: Stafford Williams <staff0rd@users.noreply.github.com> Co-authored-by: Bengt Weiße <bengtler@gmail.com> Co-authored-by: ☃ Elliot Shepherd <elliot@jarofworms.com> Co-authored-by: RustySol <93598467+RustySol@users.noreply.github.com> Co-authored-by: ru.c <ru@shuffle.com> Co-authored-by: Lucian Mocanu <alumni@users.noreply.github.com> Co-authored-by: Lucian Mocanu <lucian.mocanu@nexontis.com> Co-authored-by: Ezekiel Adetoro <39957559+adetorodev@users.noreply.github.com> Co-authored-by: Alexis Fournier <75622873+a-fournier@users.noreply.github.com> Co-authored-by: afournier <afournier@solocal.com> Co-authored-by: Jo YoHan <37216082+Slowhigh@users.noreply.github.com> Co-authored-by: Jo YoHan <37216082+oxyrinchus@users.noreply.github.com> Co-authored-by: spotykatch <andrey.dashevskiy@yandex.ru> Co-authored-by: Eliya Cohen <co.eliya2@gmail.com> Co-authored-by: smith-xyz <51304449+smith-xyz@users.noreply.github.com> Co-authored-by: YoungKi Lyu <youngkiu@gmail.com> Co-authored-by: Riqwan Thamir <rmthamir@gmail.com> Co-authored-by: Joe Rybarczyk <95554565+99xtal@users.noreply.github.com> Co-authored-by: jrybarczyk <jrybarczyk@exclusiveresorts.com> Co-authored-by: Jens Horch <jenshorch@icloud.com> Co-authored-by: Jens Horch <horch@hector.de> Co-authored-by: Sergey Pahuta <siarhei.pakhuta@mapbox.com> Co-authored-by: tqh177 <42137654+tqh177@users.noreply.github.com> Co-authored-by: leoojg <leoojg@gmail.com> Co-authored-by: Felix Gohla <37421906+felix-gohla@users.noreply.github.com> Co-authored-by: LoneRifle <LoneRifle@users.noreply.github.com> Co-authored-by: pro100kryto <47232701+pro100kryto@users.noreply.github.com> Co-authored-by: juliengbt <48599640+juliengbt@users.noreply.github.com>
* feat: added opaque types support over primitives in find-options (typeorm#9560) * added opaque types support over primitives in find-options * removed lock-verify because of its deprecation * fixing auto type mapping * docs: improve zh docs (typeorm#9575) * docs: general grammer (typeorm#9574) * Github issue templates converted to forms (typeorm#9434) * Update and rename bug-report.md to bug-report.yml * Update and rename documentation-issue.md to documentation-issue.yml * Update and rename feature-request.md to feature-request.yml * checkboxes * Update feature-request.yml * Update feature-request.yml Co-authored-by: AlexMesser <dmzt08@gmail.com> * feat: allow peerDependency of better-sqlite3 version 8.x.x (typeorm#9564) closes typeorm#9563 * docs: removed unnecessary slash in comments (typeorm#9533) * fix: pass fake flag to undoLastMigration (typeorm#9562) Closes: typeorm#9561 * build(deps): bump decode-uri-component from 0.2.0 to 0.2.2 (typeorm#9590) Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2. - [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases) - [Commits](SamVerschueren/decode-uri-component@v0.2.0...v0.2.2) --- updated-dependencies: - dependency-name: decode-uri-component dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: correctly return insertId for react-native (typeorm#9554) * fix: the mpath is incorrect when the parent of the tree entity is null (typeorm#9535) * fix: the mpath is incorrect when the parent of the tree entity is null * lint: code format * fix: findTrees not have children * test: add unit test * style: format code * fix: unit test * fix: unit test * fix: unit test * docs: add in an example for 4526 (typeorm#9538) * docs: add in an example for 4526 * small fixes Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com> * feat: "And" operator in FindOptions (typeorm#9489) Closes typeorm#3113 * fix: left instead of inner join for where or + optional relations (typeorm#9516) * fix: typings for Repository.extend function (typeorm#9396) additionally remove duplicated TreeRepository.extend method * feat: index support for materialized views of PostgreSQL (typeorm#9414) * feat: Added new indices attribute to View * feat: Added view indices methods Such as dropViewIndex, addViewIndices, addViewIndex Added "View" type in some parameters of methods * feat: Added view indices support when creating new indices and dropping old indices * ref: Renamed "table" to "view" in log when dropping view index * feat: changed order of schema sync operations To create a new view index, a view has to be created first. * feat: removed unreachable code A view object don't have its indices when creation. The indices are added to the view through the createViewIndex method. * feat: Added view when returning TableIndex * feat: Added view paths as argument in getViews on log method * feat: Created createViewIndexSql This method reuses code from createIndexSql, but eliminates the isSpatial part, because a viewColumn doesn't support this attribute. * fix: Added missing columns const to createViewIndexSql * feat: Removed isSpatial attribute when returning TableIndex * feat: Added unit tests * fix: Dropped current index to leave unique index on indices array There was a bug that when asserting the unique index, it would compare with the previous index, even when explicitly selecting the unique index in the indices array. * ref: lint files * feat: added "postgres" in enabledDrivers attribute This is to enable only PostgreSQL for the tests * feat: added doc for materialized view indices * ref: lint files * feat: Added new method to create mat. view indices This new method goes after creating the views. Aditionally, the views are now created at the end (as it was before) * ref: prettify files * feat: revamped tests Replaced previous unit tests with more significant ones * docs: Improve comprehension of update repository API (typeorm#9417) * Improve comprehension of update repository API Because the previous doc example was `await repository.update({ firstName: "Timber" }, { firstName: "Rizzrak" })`, I got confused and reversed the **WHERE** condition and the actual **change**. This change is just a suggestion to avoid that kind of confusion * Apply the same doc suggestion change to the entity manager update API * feat: upsert options conflictPaths as Entity keys (typeorm#9365) * feature: upsert options conflictPaths as Entity keys * feature: upsert options conflictPaths as object * feature: upsert options conflictPaths as object Co-authored-by: Pavel <pavel@loanbase.com> * docs: update "migrate:show error code" description (typeorm#9476) * feat: add id in migrate:show command logging (typeorm#9475) * feat: add Open DB Flags and URI DB Name in SQLite (typeorm#9468) * Add the open database flags for sqlite3. * Check for URI before trying to create the DB dir. * Spacing. * Add the sqlite open connection flags. * Spacing. Co-authored-by: Adrian Burlacu <adrian.burlacu@live.com> * fix: assign isInitialized: true at the end of .initialize() method (typeorm#9455) * fix: cacheId not used when loading relations with take (typeorm#9469) * fix: cacheId not used loading relations The cacheId is set to undefined for the main request used for pagination when we load related entities * fix: tests * feat: add parseInt8 option to postgres driver. Closes typeorm#9341 (typeorm#9435) * feat: add parseInt8 option to postgres driver * chore: formatting * Revert "fix: assign isInitialized: true at the end of .initialize() method (typeorm#9455)" (typeorm#9591) This reverts commit 81fc9a9. * fix: fixed outdated `init` command (typeorm#9422) * fix: Updating the samples current version of typeorm. The cli sample was using the getRepository version in the UserController and in the current versions of the typeorm it was deprecated. Basically I changed the code to the current version using AppDataSource. * fix: improving code and fixing bugs I made several changes to the functions because they had bugs, such as the id being a "string" instead of a "number", the "userRepository" methods being outdated and checking the code to see if the user exists before doing some executions * feat: migration:generate successful exit the process with zero code (typeorm#9288) * fix: disable transactionSupport option for CordovaDriver (typeorm#9391) * fix: disable transaction support for cordova driver the cordova-sqlite-storage plugin does not support transactions. fc4133c introduced an exception when starting a transactions but did not disable the transactionSupport in general leading to errors when using the `save` and `remove` method of the `EntityPersistExecutor`. With this PR the `EntityPersistExecutor` will respect the drivers `transactionSupport` option. * docs: add note on transaction limitations for cordova driver * feat: implement exists query method (typeorm#9303) Adding `Exists` method to query builder and EntityManager, to check whether a row exists given the conditions Closes: typeorm#2815 Co-authored-by: mortzprk <mortz.prk@gmail.com> * feat: Add synchronize to @jointable (typeorm#9442) * feat: Add synchronize option to @jointable Add synchronize option to @jointable. It allows to ignore JoinTable when syncing and generating migrations. Closes typeorm#3443 * removed only * lint fix Co-authored-by: Bartlomiej Rutkowski <brutkowski@tilt.app> Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com> Co-authored-by: Alex Messer <dmzt08@gmail.com> * lint fix * feat: allow for partial index conditions for on conflict statments in postgres (typeorm#8971) * feat: allow for partial index conditions for on conflict statments in postgres * fix: change variable to match postgres documentation and convert from array to string type * fix: generalize use of index predicate. add documentation and expand test cases * lint fix Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com> Co-authored-by: Alex Messer <dmzt08@gmail.com> * fixed latest typescript-related issue * feat: allow per-migration control over transaction behavior (typeorm#9459) Closes typeorm#7087 * fix : primary constraint name undefined error (typeorm#9576) * fix : primary constraint name undefined erorr for PostgresQueryRunner.ts * Update src/driver/postgres/PostgresQueryRunner.ts Co-authored-by: leo-jnesis <55386067+leo-jnesis@users.noreply.github.com> Co-authored-by: AlexMesser <dmzt08@gmail.com> Co-authored-by: leo-jnesis <55386067+leo-jnesis@users.noreply.github.com> * version bump * docs: fix missing ) (typeorm#9629) * fix: DataSource.setOptions doesn't properly update the database in the drivers (typeorm#9635) * make sure we update database in the driver if it was dynamically set (via dataSource.setOptions) * removed validation for database since we definitely shouldn't have it in the constructor, database can be set later on (e.g. datasource.setOptions) * fix: multiple select queries during db sync in sqlite (typeorm#9639) * fixed multiple select queries during db sync in sqlite * docs: correct typo (typeorm#9655) * docs: correct a typo (typeorm#9651) * docs: correct typo (typeorm#9643) * Create SECURITY.md * fix: allow to pass ObjectLiteral in mongo find where condition (typeorm#9632) Closes: typeorm#9518 * feat: support busy_timeout param parameter for sqlite (typeorm#9623) Co-authored-by: sinkhaha <1468709606@qq.com> * fix: materialized hints support for cte (typeorm#9605) Fix implementation of materialized hints in common table expressions Previous behavior did not account for NOT MATERIALIZED hints, also placed materialized hints in wrong place (before "AS") Co-authored-by: Adrian Parry <adrian.parry@reign.cl> * fix: synchronizing View with schema broken for oracle (typeorm#9602) * fix view+schema broken for oracle * apply prettier * fixed missing schema in loadViews(); added test (with .only) * removed .only Co-authored-by: James Jurach <James.Jurach@apiture.com> Co-authored-by: Alex Messer <dmzt08@gmail.com> * removed titles from issue templates * docs: fix some typo in migration document (typeorm#9667) * feat: support time travel queries, upsert, enums, spatial types in cockroachdb (typeorm#9128) * feature: adds support for enum type (fixes typeorm#9068) * temporarily ran package to test on different repo * playing around - bumped version * Revert "playing around - bumped version" This reverts commit 7df4adb. * Revert "temporarily ran package to test on different repo" This reverts commit 48f394e. * feat: add support for geometry data type * feature: properly hydrate enum array values * feature: adds support for geography and geometry for cockroachdb * bugfix: fixes issue with primary generated columns being invalid column type (fixes typeorm#8532) * Revert "bugfix: fixes issue with primary generated columns being invalid column type (fixes typeorm#8532)" This reverts commit e00cdb0. * bugfix: type casts to string when using ANY * feature: cast geometry/geography to geojson * feature: added references to srid * bugfix: prevent error if trying to close already closed connection * feature: added cockrachodb as part of postgres family * feature: ensures support for spatial columns for cockroachdb * feature: adds support for UPSERT for CockroachDB (fixes typeorm#9199) * minor: added TODO; unsure how to achieve this * feature: adds support for time travelling queries for cockroachdb * bugfix: only run time travel query on SELECT statements * refactor: changed UsertType from 'upsert' to 'primary-key' since this is more logical * feature: added posibility to set timeTravelQuery to false, instead of the parameter function; help for disabling time travel queries during tests * feature: allow timeTravelQueries in find* queries * bugfix: when using timetravel queries with joinAttributes it now prevents error 'AS OF SYSTEM TIME must be in top level' error * lint * minor fix * fixed failing test * implemented ENUM type; added tests; * fixed failing tests * fixed failing test * fixed spatial types synchronization; implemented spatial indices; added tests for spatial columns; * refactored Time Travel Query functionality; removed TTQ from find options; added tests for TTQ; * added docs for Time Travel Queries * minor changes * added GeoJSON types; other minor fixes; * updated docs * updated docs Co-authored-by: Dmitry Zotov <dmzt08@gmail.com> * refactor: remove a deprecated function (typeorm#9702) * fix: remove unnecessary .js extension in imports (typeorm#9713) * fix: remove extension when importing file * removed unnecessary .js extension in imports --------- Co-authored-by: Dmitry Zotov <dmzt08@gmail.com> * chore: add *.iml to .gitignore (typeorm#9707) * test: Add test to prove that issue typeorm#2331 is resolved (typeorm#9688) * test: update multiple nested embedded entities (typeorm#9696) * test: update multiple nested embedded entities Closes: typeorm#1200 * test: update multiple nested embedded entities - fix for ORA-00972 - shorter names Closes: typeorm#1200 * test: correct test name for issue 1200 Closes: typeorm#1200 * fix: overriding caching settings when alwaysEnabled is true (typeorm#9731) * 9023-2 Fix cache overriding option * 9023-2 Fix format * docs: update many-to-many-relations.md (typeorm#9736) * build(deps): bump http-cache-semantics from 4.1.0 to 4.1.1 (typeorm#9758) Bumps [http-cache-semantics](https://github.com/kornelski/http-cache-semantics) from 4.1.0 to 4.1.1. - [Release notes](https://github.com/kornelski/http-cache-semantics/releases) - [Commits](kornelski/http-cache-semantics@v4.1.0...v4.1.1) --- updated-dependencies: - dependency-name: http-cache-semantics dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: Fix grammar error in no migrations found log (typeorm#9754) * docs: Fix grammar error in the first paragraph. (typeorm#9759) docs: Fix grammar (verbal agreement) error in the first paragraph. * feat: allow mysql2 v3 as peerDependency (typeorm#9747) Closes typeorm#9714 * fix: make sure "require" is defined in the environment * fix: redundant Unique constraint on primary join column in Postgres (typeorm#9677) * test: one migration for PrimaryColumn and JoinColumn in pg * fix: stop postgres from creating unique on PrimaryColumn with JoinColumn * fix: resolve issue with "simple-enum" synchronization in SQLite (typeorm#9716) * fix: resolve issue with "simple-enum" in sqlite Closes: typeorm#9715 * trying to re-trigger CircleCI tests --------- Co-authored-by: Dmitry Zotov <dmzt08@gmail.com> * fix: improved `FindOptionsWhere` behavior with union types (typeorm#9607) * 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> * fix: sql expression when `where` parameter is empty array (typeorm#9691) Closes: typeorm#9690 Co-authored-by: Dmitry Zotov <dmzt08@gmail.com> * feat: naming strategy for legacy Oracle (typeorm#9703) * 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. * feat: add find operator json contains (typeorm#9665) * feature: add find operator json contains * add test --------- Co-authored-by: Игорь Сары <isary@MacBook-Pro-Igor.local> Co-authored-by: dzvyagin <dzvyagin@team.amocrm.com> * docs: update cli related docs (typeorm#9659) - remove cli.entitiesDir description - remove cli.subscribersDir description - remove cli from Data Source Options example - extend migration:run examples with -- -d path-to-datasource-config - extend migration:revert examples with -- -d path-to-datasource-config - extend migration:show examples with -- -d path-to-datasource-config - extend migration:create examples with path-to-migrations-dir/migrationName Co-authored-by: Stefan <stefi@sprintingsoftware.com> * feat: support enableWal for the better-sqlite3 driver (typeorm#9619) * fixed wrong callback definition in tests * fix: Incorrect enum default value when table name contains dash character (typeorm#9685) * fix: get enum default value * chore: format * fix: add support for mongodb v4 (typeorm#9450) * fix: add support for mongodb driver v4 This new fix allow support to mongodb driver v4 Closes: typeorm#7907 * fix: add support for mongodb driver v4 This new fix allow support to mongodb driver v4 Closes: typeorm#7907 --------- Co-authored-by: Matheus Melo Antiquera <matheusantiquera@finchsolucoes.com.br> * Revert "fix: add support for mongodb v4 (typeorm#9450)" (typeorm#9762) This reverts commit 8150525. * fix: incorrect sorting of entities with multi-inheritances (typeorm#9406) * Fixed sorting of entities with multi-inheritances * prettier * added test case --------- Co-authored-by: Alex Messer <dmzt08@gmail.com> * removed unnecessary .js extension in imports * refactor: use abstract logger to reduce duplicate code (typeorm#9751) * feat(platform-tools): add more logging functions * refactor(logger): add `AbstractLogger` to reduce duplicate code --------- Co-authored-by: Christian Forgács <christian@wunderbit.de> * feat: update mssql dependency and other dependencies as well (typeorm#9763) * updating dependencies * fixing circleci config * reverting mongodb version back * increasing cli commands test timeout * feat: support for SQL aggregate functions SUM, AVG, MIN, and MAX to the Repository API (typeorm#9737) * 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 * version bump * fix: react-native doesn't properly work in ESM projects because of circular dependency (typeorm#9765) * fix: use forward slashes when normalizing path (typeorm#9768) Fixes typeorm#9766 * docs: documented getCount() method (typeorm#9847) * 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 * docs: update relations-faq (typeorm#9879) Proposed a better safe-type workaround for circular dependencies. * docs: update many-to-many-relations.md (typeorm#9861) Fixing typescript code. * docs: added a documentation section on debugging query builder (typeorm#9846) * 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 * refactor: remove date-fns package (typeorm#9634) * 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 * build(deps): bump jsonwebtoken and mssql (typeorm#9700) Bumps [jsonwebtoken](https://github.com/auth0/node-jsonwebtoken) to 9.0.0 and updates ancestor dependency [mssql](https://github.com/tediousjs/node-mssql). These dependencies need to be updated together. Updates `jsonwebtoken` from 8.5.1 to 9.0.0 - [Release notes](https://github.com/auth0/node-jsonwebtoken/releases) - [Changelog](https://github.com/auth0/node-jsonwebtoken/blob/master/CHANGELOG.md) - [Commits](auth0/node-jsonwebtoken@v8.5.1...v9.0.0) Updates `mssql` from 7.3.0 to 9.0.1 - [Release notes](https://github.com/tediousjs/node-mssql/releases) - [Changelog](https://github.com/tediousjs/node-mssql/blob/master/CHANGELOG.txt) - [Commits](tediousjs/node-mssql@v7.3.0...v9.0.1) --- updated-dependencies: - dependency-name: jsonwebtoken dependency-type: indirect - dependency-name: mssql dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: resolve issues for mssql migration when simple-enum was changed * 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: typeorm#7785 typeorm#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: typeorm#7785 typeorm#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> * fix: resolves issue with mssql column recreation (typeorm#9773) * fix: resolves issue with mssql column recreation when length max is in lower case Closes: typeorm#9399 * removed redundant question mark --------- Co-authored-by: ke <ke@sbs.co.at> * feat: allow type FindOptionsOrderValue for order by object property (typeorm#9895) (typeorm#9896) 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 typeorm#9895. * fixing failing test * feat: Broadcast identifier for removed related entities (typeorm#9913) * Initial commit * Pending changes exported from your codespace * Revert changes * Fix format * test: when calling AVG on an integer column, MS SQL Server returns an int. (typeorm#9784) In this case, 50 instead of 50.5. Apparently the ANSI standard for SQL is silent on this issue, so either behavior should be considered acceptable. * fix: loading tables with fk in sqlite query runner (typeorm#9875) Closes: typeorm#9266 * fix: improve EntityNotFound error message in QueryBuilder.findOneOrFail (typeorm#9872) * fix: EntityNotFound error message in QueryBuilder.findOneOrFail * change test * change test * change test * fix: proper default value on generating migration when default value is a function calling [Postgres] (typeorm#9830) Co-authored-by: Dmytro Boiko <dmitriy.b@tracktica.com> * docs: update migrations docs (typeorm#9828) * feat: add support for STI on EntitySchema (typeorm#9834) * feat: add support for STI on EntitySchema Closes: typeorm#9833 * fix: run prettier --------- Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com> * fix: use object create if entity skip constructor is set (typeorm#9831) * feat: add support for json datatype for sqlite (typeorm#9744) * fix: prevent foreign key support during migration batch under sqlite (typeorm#9775) * 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: typeorm#9770 * Update MigrationExecutor.ts * Update command.ts --------- Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com> * fix: transform values for FindOperators typeorm#9381 (typeorm#9777) * fix: transform values for FindOperators Closes: typeorm#9381 * refactor: simplify correction do not transform value, when it is a FindOperator Closes: typeorm#9381 * fix: transform value of FindOperator when it is not a FindOperator Closes: typeorm#9381 typeorm#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> * feat: leftJoinAndMapOne and innerJoinAndMapOne map result to entity (typeorm#9354) * 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: handles "query" relation loading strategy for TreeRepositories (typeorm#9680) 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: typeorm#9673 * fix: firstCapital=true not working in camelCase() function * feat: QueryBuilder performance optimizations (typeorm#9914) * 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 * version bump * fix: wrong dependency version in init command * fix: drop xml & yml connection option support (typeorm#9930) * version bump * added package lock * ci: wait if oracle db is enabled in test suite (typeorm#9946) * test: cli init with local typeorm package (typeorm#9926) * 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 * feat: support for the latest mongodb v5 (typeorm#9925) * fix: add support for mongodb driver v5 This new fix allow support to mongodb driver v5 Closes: typeorm#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: typeorm#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> * fix: SelectQueryBuilder builds incorrectly escaped alias in Oracle when used on entity with composite key (typeorm#9668) * Update SelectQueryBuilder.ts Bug fix, In case a unique alias is created in first query then result was not getting mapped properly. * lint fix --------- Co-authored-by: Dmitry Zotov <dmzt08@gmail.com> * chore: better console.log (typeorm#9924) * refactor: combine sqlite json and simple-json handling (typeorm#9937) * docs: wrong documentation on QueryBuilder.getCount() (typeorm#9935) * fix: make cache optional fields optional (typeorm#9942) This patch allows the getFromCache caller to only pass in identifier or query field, as getFromCache already handles the identifier and query field checks Co-authored-by: ru.c <ru@shuffle.com> * fix: prevent unique index identical to primary key (all sql dialects) (typeorm#9940) Co-authored-by: Lucian Mocanu <lucian.mocanu@nexontis.com> * fixed compiler error * version bump * docs: issue typeorm#8860 (typeorm#9951) * fixed: issue typeorm#8860 * example looks rough --------- Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com> * fix: add directConnection options to MongoDB connection (typeorm#9955) Co-authored-by: afournier <afournier@solocal.com> * docs: update entity-manager-api.md (typeorm#9956) typo: const timber = await manager.findOne(User, { firstName: "Timber" }) → const timber = await manager.findOneBy(User, { firstName: "Timber" }) Co-authored-by: Jo YoHan <37216082+oxyrinchus@users.noreply.github.com> * fix: resolve duplicate subscriber updated columns (typeorm#9958) Closes: typeorm#9948 * fix: select + addOrderBy broke in 0.3.14 (typeorm#9961) * added test for typeorm#9960 * fixing the issue * limiting only to postgres because of NULLS FIRST syntax * lint * refactor: query methods should accept generic for return type (typeorm#9957) * query should accept generics * Update DataSource.ts * feat: mariadb uuid inet4 inet6 column data type support (typeorm#9845) * feat: mariadb inet4, inet6, uuid data type support * refactor: cleanup unnecessary methods * style: mysqldriver formatting * fix: handle length column metadata mariadb uuid * fix: 8832 test suite to verify errors correctly * style: fix 8832 test formatting * fix: 8832 error testing cleanup * fix: remove defaulting column type feature * style: fix formatting * fix: remove unnecessary dbms error test * fix: remove unused import in test * fix: ensure defaulting uuid generation column type * fix: mongodb typings breaks the browser version (typeorm#9962) * fix: exclude mongodb typings from browser Closes: typeorm#9959 fix: delete unnessecary dummy file * another fix for bson typings problem in browser --------- Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com> * revert: "refactor: remove date-fns package (typeorm#9634)" This reverts commit 1fcd9f3 * fix: allow json as alias for longtext mariadb (typeorm#10018) * fix: express option bug in init command (typeorm#10022) * Fix express option bug in init command * fixed esm support in command * fix linter --------- Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com> * fix: RelationIdLoader has access to queryPlanner when wrapped in transaction (typeorm#9990) fix issue - createQueryBuilder in repository loses queryplanner when wrapped in txn upsteam until RelationIdLoader Closes: typeorm#9988 * fix: add `trustServerCertificate` option to `SqlServerConnectionOptions` (typeorm#9985) * fix: add missing 'trustServerCertificate' option to SqlServerConnectionOptions interface Closes: typeorm#8093 * docs: add `trustServerCertificate` description to mssql data source options docs * fix: consistency between jsdoc and docs --------- Co-authored-by: jrybarczyk <jrybarczyk@exclusiveresorts.com> * fix: added instanceName to options (typeorm#9968) * added instanceName to options * run prettier --------- Co-authored-by: Jens Horch <horch@hector.de> * fix: for running cli-ts-node-esm use exit code from child process (typeorm#10030) Use child process exit code in parent process to properly indicate that child process (migration running) fails Closes: typeorm#10029 * fix: add onDelete option validation for oracle (typeorm#9786) * fix: add onDelete option validation for oracle Closes: typeorm#9189 * refactor: move fk validation logic to EntityMetadataValidator.ts * fix: skip assertion for other databases * fix: styles --------- Co-authored-by: ke <ke@sbs.co.at> * fix: convert the join table ID to the referenceColumn ID type (typeorm#9887) * 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: correct encode mongodb auth credentials (typeorm#10024) * fix: correct encode mongodb auth credentials when use the special character `@` into mongodb password result in unauthorized because the it has no encoding Closes: typeorm#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: create correct children during cascade saving entities with STI (typeorm#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: typeorm#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: typeorm#7758 * test: check STI type setting discriminator manually Related to: typeorm#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: typeorm#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: typeorm#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: typeorm#7758 * fix: support More/LessThanOrEqual in relations (typeorm#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> * fix: added transaction retry logic in cockroachdb (typeorm#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 * version bump * test: fix test from typeorm#9034 with STI for Oracle (typeorm#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 typeorm#9786. * fix: add missing await (typeorm#10084) * chore: use new CircleCI convenience images (typeorm#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 typeorm#10100 * fix: typeorm#10040 TypeORM synchronize database even if it is up to date (typeorm#10041) * test: typeorm#10040 TypeORM synchronize database even if it is up to date * formating * fix: TypeORM synchronize database even if it is up to date typeorm#10040 * feat: Added back fork spanner changes * fix lock version --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com> Co-authored-by: smile1sky <82568280+smile-sky20@users.noreply.github.com> Co-authored-by: Bikram Suwal <veekramsuwal@gmail.com> Co-authored-by: Dominic Ruggiero <dominic@userexe.me> Co-authored-by: AlexMesser <dmzt08@gmail.com> Co-authored-by: Danny Koppenhagen <mail@k9n.dev> Co-authored-by: Oskar Jaskólski <oskarrro90@gmail.com> Co-authored-by: Barak Shelef <107487965+barakshelef-oasis@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Arnaud de Mouhy <1552768+dehy@users.noreply.github.com> Co-authored-by: Sakura <54829481+Yuuki-Sakura@users.noreply.github.com> Co-authored-by: Charlton Austin <charlton.austin@gmail.com> Co-authored-by: Jeffyter Saraiva <35247554+iJhefe@users.noreply.github.com> Co-authored-by: Patrick Gallagher <pfgallagher@users.noreply.github.com> Co-authored-by: Coroliov Oleg <1880059+ruscon@users.noreply.github.com> Co-authored-by: Gonzalo Rodulfo Martínez <23481808+rodzalo@users.noreply.github.com> Co-authored-by: Charlély Delgrange <charlely.delgrange@gmail.com> Co-authored-by: Pavel Petrik <redwert@users.noreply.github.com> Co-authored-by: Pavel <pavel@loanbase.com> Co-authored-by: kz-d <116164465+kz-d@users.noreply.github.com> Co-authored-by: Adrian Burlacu <63519230+adrian-burlacu-software@users.noreply.github.com> Co-authored-by: Adrian Burlacu <adrian.burlacu@live.com> Co-authored-by: Gentilhomme <gentilhomme.thomas@gmail.com> Co-authored-by: 4l3ss <2623600+4l3ss@users.noreply.github.com> Co-authored-by: Dan Manastireanu <498419+danmana@users.noreply.github.com> Co-authored-by: userUndefined ✌️ <80859038+thalles-victor@users.noreply.github.com> Co-authored-by: Nedim Arabacı <nedimarabaci@gmail.com> Co-authored-by: Michael Wolz <michaelwolz93@gmail.com> Co-authored-by: Morteza PRK <mortezaPRK@users.noreply.github.com> Co-authored-by: mortzprk <mortz.prk@gmail.com> Co-authored-by: Bartłomiej Rutkowski <b.rutkowski94@gmail.com> Co-authored-by: Bartlomiej Rutkowski <brutkowski@tilt.app> Co-authored-by: Derek Bonner <deekthesqueak@users.noreply.github.com> Co-authored-by: Tim Beyer <tim.beyer@gmail.com> Co-authored-by: Kadir <kadiraciktan@gmail.com> Co-authored-by: leo-jnesis <55386067+leo-jnesis@users.noreply.github.com> Co-authored-by: Saad A. Bazaz <saadbazaz@hotmail.com> Co-authored-by: r-shirasu <82349387+r-shirasu@users.noreply.github.com> Co-authored-by: Mahmoud Almontasser <almontasser@users.noreply.github.com> Co-authored-by: JesseNeon <62482001+JesseAyegba@users.noreply.github.com> Co-authored-by: ayuvlasenko <77232221+ayuvlasenko@users.noreply.github.com> Co-authored-by: sinkhaha <1468709106@qq.com> Co-authored-by: sinkhaha <1468709606@qq.com> Co-authored-by: Adrian Parry <44247645+subparry@users.noreply.github.com> Co-authored-by: Adrian Parry <adrian.parry@reign.cl> Co-authored-by: James Jurach <james.jurach@gmail.com> Co-authored-by: James Jurach <James.Jurach@apiture.com> Co-authored-by: Sho Ogawa <60885375+linus-sh@users.noreply.github.com> Co-authored-by: Mattias Fjellvang <simplenotezy@users.noreply.github.com> Co-authored-by: summer-boythink <57977288+summer-boythink@users.noreply.github.com> Co-authored-by: 변경연 <39257313+eric-byun@users.noreply.github.com> Co-authored-by: Filip Wróbel <17615126+f-wrobel@users.noreply.github.com> Co-authored-by: Lukas Spiss <35728419+Spissable@users.noreply.github.com> Co-authored-by: Pavel Kolpakov <kolpakov-p@yandex.ru> Co-authored-by: Zeeshan Haider Khan <50953718+zeeshanhaiderkhan@users.noreply.github.com> Co-authored-by: Josh Heng <josh@joshheng.co.uk> Co-authored-by: Vítor L. Brasil <97890530+vitorlbrasil@users.noreply.github.com> Co-authored-by: Dev Aggarwal <22045791+aggarwaldev@users.noreply.github.com> Co-authored-by: Kilian Finger <hey@kilianfinger.com> Co-authored-by: Vista1nik <vista1nik@gmail.com> Co-authored-by: Toshinori Tsugita <tsugita.dev@gmail.com> Co-authored-by: PronDmytro <67123804+PronDmytro@users.noreply.github.com> Co-authored-by: ISary-ge <67458138+ISary-ge@users.noreply.github.com> Co-authored-by: Игорь Сары <isary@MacBook-Pro-Igor.local> Co-authored-by: dzvyagin <dzvyagin@team.amocrm.com> Co-authored-by: StefanZivkovic <44195291+StefanZivkovic@users.noreply.github.com> Co-authored-by: Stefan <stefi@sprintingsoftware.com> Co-authored-by: Aritz <6377040+xtremebiker@users.noreply.github.com> Co-authored-by: Khaled Sameer <khaled.smq@hotmail.com> Co-authored-by: Matheus Melo Antiquera <33763956+MatheusMeloAntiquera@users.noreply.github.com> Co-authored-by: Matheus Melo Antiquera <matheusantiquera@finchsolucoes.com.br> Co-authored-by: ZBAGI <zbagi@poczta.fm> Co-authored-by: Christian Forgács <christian@forgacs.me> Co-authored-by: Christian Forgács <christian@wunderbit.de> Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <netroy@users.noreply.github.com> Co-authored-by: 0x269 <33447608+truemogician@users.noreply.github.com> Co-authored-by: JT Smith <jt@plainblack.com> Co-authored-by: Ihor Levchenko <ifree92@gmail.com> Co-authored-by: Peter Hostačný <hostacny.peter@gmail.com> Co-authored-by: jdgjsag67251 <88368191+jdgjsag67251@users.noreply.github.com> Co-authored-by: ertl <klaus.ertl1@gmail.com> Co-authored-by: ke <ke@sbs.co.at> Co-authored-by: Dylan Seago <dylanseago@users.noreply.github.com> Co-authored-by: Philipp Dyck <pdyck@users.noreply.github.com> Co-authored-by: Leon Miller-Out <leon@singlebrook.com> Co-authored-by: GP4cK <gautier.bayzelon@gmail.com> Co-authored-by: Daniel Huth <4455258+Agreon@users.noreply.github.com> Co-authored-by: dmytroboiko <dmytro@pipernet.com> Co-authored-by: Dmytro Boiko <dmitriy.b@tracktica.com> Co-authored-by: Alexander Kraev <98308330+alexander-kraev-snyk@users.noreply.github.com> Co-authored-by: Gabriel Kim <68445851+gabrielkim13@users.noreply.github.com> Co-authored-by: Joe Mizzi <themizzi@me.com> Co-authored-by: Nguyen Ba Hung <bahung1221@gmail.com> Co-authored-by: sinopsysHK <sinofwd@gmail.com> Co-authored-by: acuthbert <acuthbert@gcdtech.com> Co-authored-by: Jose Toscano <42146866+JoseCToscano@users.noreply.github.com> Co-authored-by: mptr <54647612+mptr@users.noreply.github.com> Co-authored-by: tgrassl <grassl.timon@gmail.com> Co-authored-by: Matheus Melo Antiquera <matheus.melo.a@hotmail.com> Co-authored-by: Alankarsharma <alankar.sharma005@gmail.com> Co-authored-by: Stafford Williams <staff0rd@users.noreply.github.com> Co-authored-by: Bengt Weiße <bengtler@gmail.com> Co-authored-by: ☃ Elliot Shepherd <elliot@jarofworms.com> Co-authored-by: RustySol <93598467+RustySol@users.noreply.github.com> Co-authored-by: ru.c <ru@shuffle.com> Co-authored-by: Lucian Mocanu <alumni@users.noreply.github.com> Co-authored-by: Lucian Mocanu <lucian.mocanu@nexontis.com> Co-authored-by: Ezekiel Adetoro <39957559+adetorodev@users.noreply.github.com> Co-authored-by: Alexis Fournier <75622873+a-fournier@users.noreply.github.com> Co-authored-by: afournier <afournier@solocal.com> Co-authored-by: Jo YoHan <37216082+Slowhigh@users.noreply.github.com> Co-authored-by: Jo YoHan <37216082+oxyrinchus@users.noreply.github.com> Co-authored-by: spotykatch <andrey.dashevskiy@yandex.ru> Co-authored-by: Eliya Cohen <co.eliya2@gmail.com> Co-authored-by: smith-xyz <51304449+smith-xyz@users.noreply.github.com> Co-authored-by: YoungKi Lyu <youngkiu@gmail.com> Co-authored-by: Riqwan Thamir <rmthamir@gmail.com> Co-authored-by: Joe Rybarczyk <95554565+99xtal@users.noreply.github.com> Co-authored-by: jrybarczyk <jrybarczyk@exclusiveresorts.com> Co-authored-by: Jens Horch <jenshorch@icloud.com> Co-authored-by: Jens Horch <horch@hector.de> Co-authored-by: Sergey Pahuta <siarhei.pakhuta@mapbox.com> Co-authored-by: tqh177 <42137654+tqh177@users.noreply.github.com> Co-authored-by: leoojg <leoojg@gmail.com> Co-authored-by: Felix Gohla <37421906+felix-gohla@users.noreply.github.com> Co-authored-by: LoneRifle <LoneRifle@users.noreply.github.com> Co-authored-by: pro100kryto <47232701+pro100kryto@users.noreply.github.com> Co-authored-by: juliengbt <48599640+juliengbt@users.noreply.github.com>
* feat: added opaque types support over primitives in find-options (typeorm#9560) * added opaque types support over primitives in find-options * removed lock-verify because of its deprecation * fixing auto type mapping * docs: improve zh docs (typeorm#9575) * docs: general grammer (typeorm#9574) * Github issue templates converted to forms (typeorm#9434) * Update and rename bug-report.md to bug-report.yml * Update and rename documentation-issue.md to documentation-issue.yml * Update and rename feature-request.md to feature-request.yml * checkboxes * Update feature-request.yml * Update feature-request.yml Co-authored-by: AlexMesser <dmzt08@gmail.com> * feat: allow peerDependency of better-sqlite3 version 8.x.x (typeorm#9564) closes typeorm#9563 * docs: removed unnecessary slash in comments (typeorm#9533) * fix: pass fake flag to undoLastMigration (typeorm#9562) Closes: typeorm#9561 * build(deps): bump decode-uri-component from 0.2.0 to 0.2.2 (typeorm#9590) Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2. - [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases) - [Commits](SamVerschueren/decode-uri-component@v0.2.0...v0.2.2) --- updated-dependencies: - dependency-name: decode-uri-component dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: correctly return insertId for react-native (typeorm#9554) * fix: the mpath is incorrect when the parent of the tree entity is null (typeorm#9535) * fix: the mpath is incorrect when the parent of the tree entity is null * lint: code format * fix: findTrees not have children * test: add unit test * style: format code * fix: unit test * fix: unit test * fix: unit test * docs: add in an example for 4526 (typeorm#9538) * docs: add in an example for 4526 * small fixes Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com> * feat: "And" operator in FindOptions (typeorm#9489) Closes typeorm#3113 * fix: left instead of inner join for where or + optional relations (typeorm#9516) * fix: typings for Repository.extend function (typeorm#9396) additionally remove duplicated TreeRepository.extend method * feat: index support for materialized views of PostgreSQL (typeorm#9414) * feat: Added new indices attribute to View * feat: Added view indices methods Such as dropViewIndex, addViewIndices, addViewIndex Added "View" type in some parameters of methods * feat: Added view indices support when creating new indices and dropping old indices * ref: Renamed "table" to "view" in log when dropping view index * feat: changed order of schema sync operations To create a new view index, a view has to be created first. * feat: removed unreachable code A view object don't have its indices when creation. The indices are added to the view through the createViewIndex method. * feat: Added view when returning TableIndex * feat: Added view paths as argument in getViews on log method * feat: Created createViewIndexSql This method reuses code from createIndexSql, but eliminates the isSpatial part, because a viewColumn doesn't support this attribute. * fix: Added missing columns const to createViewIndexSql * feat: Removed isSpatial attribute when returning TableIndex * feat: Added unit tests * fix: Dropped current index to leave unique index on indices array There was a bug that when asserting the unique index, it would compare with the previous index, even when explicitly selecting the unique index in the indices array. * ref: lint files * feat: added "postgres" in enabledDrivers attribute This is to enable only PostgreSQL for the tests * feat: added doc for materialized view indices * ref: lint files * feat: Added new method to create mat. view indices This new method goes after creating the views. Aditionally, the views are now created at the end (as it was before) * ref: prettify files * feat: revamped tests Replaced previous unit tests with more significant ones * docs: Improve comprehension of update repository API (typeorm#9417) * Improve comprehension of update repository API Because the previous doc example was `await repository.update({ firstName: "Timber" }, { firstName: "Rizzrak" })`, I got confused and reversed the **WHERE** condition and the actual **change**. This change is just a suggestion to avoid that kind of confusion * Apply the same doc suggestion change to the entity manager update API * feat: upsert options conflictPaths as Entity keys (typeorm#9365) * feature: upsert options conflictPaths as Entity keys * feature: upsert options conflictPaths as object * feature: upsert options conflictPaths as object Co-authored-by: Pavel <pavel@loanbase.com> * docs: update "migrate:show error code" description (typeorm#9476) * feat: add id in migrate:show command logging (typeorm#9475) * feat: add Open DB Flags and URI DB Name in SQLite (typeorm#9468) * Add the open database flags for sqlite3. * Check for URI before trying to create the DB dir. * Spacing. * Add the sqlite open connection flags. * Spacing. Co-authored-by: Adrian Burlacu <adrian.burlacu@live.com> * fix: assign isInitialized: true at the end of .initialize() method (typeorm#9455) * fix: cacheId not used when loading relations with take (typeorm#9469) * fix: cacheId not used loading relations The cacheId is set to undefined for the main request used for pagination when we load related entities * fix: tests * feat: add parseInt8 option to postgres driver. Closes typeorm#9341 (typeorm#9435) * feat: add parseInt8 option to postgres driver * chore: formatting * Revert "fix: assign isInitialized: true at the end of .initialize() method (typeorm#9455)" (typeorm#9591) This reverts commit 81fc9a9. * fix: fixed outdated `init` command (typeorm#9422) * fix: Updating the samples current version of typeorm. The cli sample was using the getRepository version in the UserController and in the current versions of the typeorm it was deprecated. Basically I changed the code to the current version using AppDataSource. * fix: improving code and fixing bugs I made several changes to the functions because they had bugs, such as the id being a "string" instead of a "number", the "userRepository" methods being outdated and checking the code to see if the user exists before doing some executions * feat: migration:generate successful exit the process with zero code (typeorm#9288) * fix: disable transactionSupport option for CordovaDriver (typeorm#9391) * fix: disable transaction support for cordova driver the cordova-sqlite-storage plugin does not support transactions. fc4133c introduced an exception when starting a transactions but did not disable the transactionSupport in general leading to errors when using the `save` and `remove` method of the `EntityPersistExecutor`. With this PR the `EntityPersistExecutor` will respect the drivers `transactionSupport` option. * docs: add note on transaction limitations for cordova driver * feat: implement exists query method (typeorm#9303) Adding `Exists` method to query builder and EntityManager, to check whether a row exists given the conditions Closes: typeorm#2815 Co-authored-by: mortzprk <mortz.prk@gmail.com> * feat: Add synchronize to @jointable (typeorm#9442) * feat: Add synchronize option to @jointable Add synchronize option to @jointable. It allows to ignore JoinTable when syncing and generating migrations. Closes typeorm#3443 * removed only * lint fix Co-authored-by: Bartlomiej Rutkowski <brutkowski@tilt.app> Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com> Co-authored-by: Alex Messer <dmzt08@gmail.com> * lint fix * feat: allow for partial index conditions for on conflict statments in postgres (typeorm#8971) * feat: allow for partial index conditions for on conflict statments in postgres * fix: change variable to match postgres documentation and convert from array to string type * fix: generalize use of index predicate. add documentation and expand test cases * lint fix Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com> Co-authored-by: Alex Messer <dmzt08@gmail.com> * fixed latest typescript-related issue * feat: allow per-migration control over transaction behavior (typeorm#9459) Closes typeorm#7087 * fix : primary constraint name undefined error (typeorm#9576) * fix : primary constraint name undefined erorr for PostgresQueryRunner.ts * Update src/driver/postgres/PostgresQueryRunner.ts Co-authored-by: leo-jnesis <55386067+leo-jnesis@users.noreply.github.com> Co-authored-by: AlexMesser <dmzt08@gmail.com> Co-authored-by: leo-jnesis <55386067+leo-jnesis@users.noreply.github.com> * version bump * docs: fix missing ) (typeorm#9629) * fix: DataSource.setOptions doesn't properly update the database in the drivers (typeorm#9635) * make sure we update database in the driver if it was dynamically set (via dataSource.setOptions) * removed validation for database since we definitely shouldn't have it in the constructor, database can be set later on (e.g. datasource.setOptions) * fix: multiple select queries during db sync in sqlite (typeorm#9639) * fixed multiple select queries during db sync in sqlite * docs: correct typo (typeorm#9655) * docs: correct a typo (typeorm#9651) * docs: correct typo (typeorm#9643) * Create SECURITY.md * fix: allow to pass ObjectLiteral in mongo find where condition (typeorm#9632) Closes: typeorm#9518 * feat: support busy_timeout param parameter for sqlite (typeorm#9623) Co-authored-by: sinkhaha <1468709606@qq.com> * fix: materialized hints support for cte (typeorm#9605) Fix implementation of materialized hints in common table expressions Previous behavior did not account for NOT MATERIALIZED hints, also placed materialized hints in wrong place (before "AS") Co-authored-by: Adrian Parry <adrian.parry@reign.cl> * fix: synchronizing View with schema broken for oracle (typeorm#9602) * fix view+schema broken for oracle * apply prettier * fixed missing schema in loadViews(); added test (with .only) * removed .only Co-authored-by: James Jurach <James.Jurach@apiture.com> Co-authored-by: Alex Messer <dmzt08@gmail.com> * removed titles from issue templates * docs: fix some typo in migration document (typeorm#9667) * feat: support time travel queries, upsert, enums, spatial types in cockroachdb (typeorm#9128) * feature: adds support for enum type (fixes typeorm#9068) * temporarily ran package to test on different repo * playing around - bumped version * Revert "playing around - bumped version" This reverts commit 7df4adb. * Revert "temporarily ran package to test on different repo" This reverts commit 48f394e. * feat: add support for geometry data type * feature: properly hydrate enum array values * feature: adds support for geography and geometry for cockroachdb * bugfix: fixes issue with primary generated columns being invalid column type (fixes typeorm#8532) * Revert "bugfix: fixes issue with primary generated columns being invalid column type (fixes typeorm#8532)" This reverts commit e00cdb0. * bugfix: type casts to string when using ANY * feature: cast geometry/geography to geojson * feature: added references to srid * bugfix: prevent error if trying to close already closed connection * feature: added cockrachodb as part of postgres family * feature: ensures support for spatial columns for cockroachdb * feature: adds support for UPSERT for CockroachDB (fixes typeorm#9199) * minor: added TODO; unsure how to achieve this * feature: adds support for time travelling queries for cockroachdb * bugfix: only run time travel query on SELECT statements * refactor: changed UsertType from 'upsert' to 'primary-key' since this is more logical * feature: added posibility to set timeTravelQuery to false, instead of the parameter function; help for disabling time travel queries during tests * feature: allow timeTravelQueries in find* queries * bugfix: when using timetravel queries with joinAttributes it now prevents error 'AS OF SYSTEM TIME must be in top level' error * lint * minor fix * fixed failing test * implemented ENUM type; added tests; * fixed failing tests * fixed failing test * fixed spatial types synchronization; implemented spatial indices; added tests for spatial columns; * refactored Time Travel Query functionality; removed TTQ from find options; added tests for TTQ; * added docs for Time Travel Queries * minor changes * added GeoJSON types; other minor fixes; * updated docs * updated docs Co-authored-by: Dmitry Zotov <dmzt08@gmail.com> * refactor: remove a deprecated function (typeorm#9702) * fix: remove unnecessary .js extension in imports (typeorm#9713) * fix: remove extension when importing file * removed unnecessary .js extension in imports --------- Co-authored-by: Dmitry Zotov <dmzt08@gmail.com> * chore: add *.iml to .gitignore (typeorm#9707) * test: Add test to prove that issue typeorm#2331 is resolved (typeorm#9688) * test: update multiple nested embedded entities (typeorm#9696) * test: update multiple nested embedded entities Closes: typeorm#1200 * test: update multiple nested embedded entities - fix for ORA-00972 - shorter names Closes: typeorm#1200 * test: correct test name for issue 1200 Closes: typeorm#1200 * fix: overriding caching settings when alwaysEnabled is true (typeorm#9731) * 9023-2 Fix cache overriding option * 9023-2 Fix format * docs: update many-to-many-relations.md (typeorm#9736) * build(deps): bump http-cache-semantics from 4.1.0 to 4.1.1 (typeorm#9758) Bumps [http-cache-semantics](https://github.com/kornelski/http-cache-semantics) from 4.1.0 to 4.1.1. - [Release notes](https://github.com/kornelski/http-cache-semantics/releases) - [Commits](kornelski/http-cache-semantics@v4.1.0...v4.1.1) --- updated-dependencies: - dependency-name: http-cache-semantics dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: Fix grammar error in no migrations found log (typeorm#9754) * docs: Fix grammar error in the first paragraph. (typeorm#9759) docs: Fix grammar (verbal agreement) error in the first paragraph. * feat: allow mysql2 v3 as peerDependency (typeorm#9747) Closes typeorm#9714 * fix: make sure "require" is defined in the environment * fix: redundant Unique constraint on primary join column in Postgres (typeorm#9677) * test: one migration for PrimaryColumn and JoinColumn in pg * fix: stop postgres from creating unique on PrimaryColumn with JoinColumn * fix: resolve issue with "simple-enum" synchronization in SQLite (typeorm#9716) * fix: resolve issue with "simple-enum" in sqlite Closes: typeorm#9715 * trying to re-trigger CircleCI tests --------- Co-authored-by: Dmitry Zotov <dmzt08@gmail.com> * fix: improved `FindOptionsWhere` behavior with union types (typeorm#9607) * 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> * fix: sql expression when `where` parameter is empty array (typeorm#9691) Closes: typeorm#9690 Co-authored-by: Dmitry Zotov <dmzt08@gmail.com> * feat: naming strategy for legacy Oracle (typeorm#9703) * 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. * feat: add find operator json contains (typeorm#9665) * feature: add find operator json contains * add test --------- Co-authored-by: Игорь Сары <isary@MacBook-Pro-Igor.local> Co-authored-by: dzvyagin <dzvyagin@team.amocrm.com> * docs: update cli related docs (typeorm#9659) - remove cli.entitiesDir description - remove cli.subscribersDir description - remove cli from Data Source Options example - extend migration:run examples with -- -d path-to-datasource-config - extend migration:revert examples with -- -d path-to-datasource-config - extend migration:show examples with -- -d path-to-datasource-config - extend migration:create examples with path-to-migrations-dir/migrationName Co-authored-by: Stefan <stefi@sprintingsoftware.com> * feat: support enableWal for the better-sqlite3 driver (typeorm#9619) * fixed wrong callback definition in tests * fix: Incorrect enum default value when table name contains dash character (typeorm#9685) * fix: get enum default value * chore: format * fix: add support for mongodb v4 (typeorm#9450) * fix: add support for mongodb driver v4 This new fix allow support to mongodb driver v4 Closes: typeorm#7907 * fix: add support for mongodb driver v4 This new fix allow support to mongodb driver v4 Closes: typeorm#7907 --------- Co-authored-by: Matheus Melo Antiquera <matheusantiquera@finchsolucoes.com.br> * Revert "fix: add support for mongodb v4 (typeorm#9450)" (typeorm#9762) This reverts commit 8150525. * fix: incorrect sorting of entities with multi-inheritances (typeorm#9406) * Fixed sorting of entities with multi-inheritances * prettier * added test case --------- Co-authored-by: Alex Messer <dmzt08@gmail.com> * removed unnecessary .js extension in imports * refactor: use abstract logger to reduce duplicate code (typeorm#9751) * feat(platform-tools): add more logging functions * refactor(logger): add `AbstractLogger` to reduce duplicate code --------- Co-authored-by: Christian Forgács <christian@wunderbit.de> * feat: update mssql dependency and other dependencies as well (typeorm#9763) * updating dependencies * fixing circleci config * reverting mongodb version back * increasing cli commands test timeout * feat: support for SQL aggregate functions SUM, AVG, MIN, and MAX to the Repository API (typeorm#9737) * 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 * version bump * fix: react-native doesn't properly work in ESM projects because of circular dependency (typeorm#9765) * fix: use forward slashes when normalizing path (typeorm#9768) Fixes typeorm#9766 * docs: documented getCount() method (typeorm#9847) * 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 * docs: update relations-faq (typeorm#9879) Proposed a better safe-type workaround for circular dependencies. * docs: update many-to-many-relations.md (typeorm#9861) Fixing typescript code. * docs: added a documentation section on debugging query builder (typeorm#9846) * 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 * refactor: remove date-fns package (typeorm#9634) * 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 * build(deps): bump jsonwebtoken and mssql (typeorm#9700) Bumps [jsonwebtoken](https://github.com/auth0/node-jsonwebtoken) to 9.0.0 and updates ancestor dependency [mssql](https://github.com/tediousjs/node-mssql). These dependencies need to be updated together. Updates `jsonwebtoken` from 8.5.1 to 9.0.0 - [Release notes](https://github.com/auth0/node-jsonwebtoken/releases) - [Changelog](https://github.com/auth0/node-jsonwebtoken/blob/master/CHANGELOG.md) - [Commits](auth0/node-jsonwebtoken@v8.5.1...v9.0.0) Updates `mssql` from 7.3.0 to 9.0.1 - [Release notes](https://github.com/tediousjs/node-mssql/releases) - [Changelog](https://github.com/tediousjs/node-mssql/blob/master/CHANGELOG.txt) - [Commits](tediousjs/node-mssql@v7.3.0...v9.0.1) --- updated-dependencies: - dependency-name: jsonwebtoken dependency-type: indirect - dependency-name: mssql dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: resolve issues for mssql migration when simple-enum was changed * 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: typeorm#7785 typeorm#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: typeorm#7785 typeorm#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> * fix: resolves issue with mssql column recreation (typeorm#9773) * fix: resolves issue with mssql column recreation when length max is in lower case Closes: typeorm#9399 * removed redundant question mark --------- Co-authored-by: ke <ke@sbs.co.at> * feat: allow type FindOptionsOrderValue for order by object property (typeorm#9895) (typeorm#9896) 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 typeorm#9895. * fixing failing test * feat: Broadcast identifier for removed related entities (typeorm#9913) * Initial commit * Pending changes exported from your codespace * Revert changes * Fix format * test: when calling AVG on an integer column, MS SQL Server returns an int. (typeorm#9784) In this case, 50 instead of 50.5. Apparently the ANSI standard for SQL is silent on this issue, so either behavior should be considered acceptable. * fix: loading tables with fk in sqlite query runner (typeorm#9875) Closes: typeorm#9266 * fix: improve EntityNotFound error message in QueryBuilder.findOneOrFail (typeorm#9872) * fix: EntityNotFound error message in QueryBuilder.findOneOrFail * change test * change test * change test * fix: proper default value on generating migration when default value is a function calling [Postgres] (typeorm#9830) Co-authored-by: Dmytro Boiko <dmitriy.b@tracktica.com> * docs: update migrations docs (typeorm#9828) * feat: add support for STI on EntitySchema (typeorm#9834) * feat: add support for STI on EntitySchema Closes: typeorm#9833 * fix: run prettier --------- Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com> * fix: use object create if entity skip constructor is set (typeorm#9831) * feat: add support for json datatype for sqlite (typeorm#9744) * fix: prevent foreign key support during migration batch under sqlite (typeorm#9775) * 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: typeorm#9770 * Update MigrationExecutor.ts * Update command.ts --------- Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com> * fix: transform values for FindOperators typeorm#9381 (typeorm#9777) * fix: transform values for FindOperators Closes: typeorm#9381 * refactor: simplify correction do not transform value, when it is a FindOperator Closes: typeorm#9381 * fix: transform value of FindOperator when it is not a FindOperator Closes: typeorm#9381 typeorm#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> * feat: leftJoinAndMapOne and innerJoinAndMapOne map result to entity (typeorm#9354) * 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: handles "query" relation loading strategy for TreeRepositories (typeorm#9680) 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: typeorm#9673 * fix: firstCapital=true not working in camelCase() function * feat: QueryBuilder performance optimizations (typeorm#9914) * 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 * version bump * fix: wrong dependency version in init command * fix: drop xml & yml connection option support (typeorm#9930) * version bump * added package lock * ci: wait if oracle db is enabled in test suite (typeorm#9946) * test: cli init with local typeorm package (typeorm#9926) * 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 * feat: support for the latest mongodb v5 (typeorm#9925) * fix: add support for mongodb driver v5 This new fix allow support to mongodb driver v5 Closes: typeorm#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: typeorm#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> * fix: SelectQueryBuilder builds incorrectly escaped alias in Oracle when used on entity with composite key (typeorm#9668) * Update SelectQueryBuilder.ts Bug fix, In case a unique alias is created in first query then result was not getting mapped properly. * lint fix --------- Co-authored-by: Dmitry Zotov <dmzt08@gmail.com> * chore: better console.log (typeorm#9924) * refactor: combine sqlite json and simple-json handling (typeorm#9937) * docs: wrong documentation on QueryBuilder.getCount() (typeorm#9935) * fix: make cache optional fields optional (typeorm#9942) This patch allows the getFromCache caller to only pass in identifier or query field, as getFromCache already handles the identifier and query field checks Co-authored-by: ru.c <ru@shuffle.com> * fix: prevent unique index identical to primary key (all sql dialects) (typeorm#9940) Co-authored-by: Lucian Mocanu <lucian.mocanu@nexontis.com> * fixed compiler error * version bump * docs: issue typeorm#8860 (typeorm#9951) * fixed: issue typeorm#8860 * example looks rough --------- Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com> * fix: add directConnection options to MongoDB connection (typeorm#9955) Co-authored-by: afournier <afournier@solocal.com> * docs: update entity-manager-api.md (typeorm#9956) typo: const timber = await manager.findOne(User, { firstName: "Timber" }) → const timber = await manager.findOneBy(User, { firstName: "Timber" }) Co-authored-by: Jo YoHan <37216082+oxyrinchus@users.noreply.github.com> * fix: resolve duplicate subscriber updated columns (typeorm#9958) Closes: typeorm#9948 * fix: select + addOrderBy broke in 0.3.14 (typeorm#9961) * added test for typeorm#9960 * fixing the issue * limiting only to postgres because of NULLS FIRST syntax * lint * refactor: query methods should accept generic for return type (typeorm#9957) * query should accept generics * Update DataSource.ts * feat: mariadb uuid inet4 inet6 column data type support (typeorm#9845) * feat: mariadb inet4, inet6, uuid data type support * refactor: cleanup unnecessary methods * style: mysqldriver formatting * fix: handle length column metadata mariadb uuid * fix: 8832 test suite to verify errors correctly * style: fix 8832 test formatting * fix: 8832 error testing cleanup * fix: remove defaulting column type feature * style: fix formatting * fix: remove unnecessary dbms error test * fix: remove unused import in test * fix: ensure defaulting uuid generation column type * fix: mongodb typings breaks the browser version (typeorm#9962) * fix: exclude mongodb typings from browser Closes: typeorm#9959 fix: delete unnessecary dummy file * another fix for bson typings problem in browser --------- Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com> * revert: "refactor: remove date-fns package (typeorm#9634)" This reverts commit 1fcd9f3 * fix: allow json as alias for longtext mariadb (typeorm#10018) * fix: express option bug in init command (typeorm#10022) * Fix express option bug in init command * fixed esm support in command * fix linter --------- Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com> * fix: RelationIdLoader has access to queryPlanner when wrapped in transaction (typeorm#9990) fix issue - createQueryBuilder in repository loses queryplanner when wrapped in txn upsteam until RelationIdLoader Closes: typeorm#9988 * fix: add `trustServerCertificate` option to `SqlServerConnectionOptions` (typeorm#9985) * fix: add missing 'trustServerCertificate' option to SqlServerConnectionOptions interface Closes: typeorm#8093 * docs: add `trustServerCertificate` description to mssql data source options docs * fix: consistency between jsdoc and docs --------- Co-authored-by: jrybarczyk <jrybarczyk@exclusiveresorts.com> * fix: added instanceName to options (typeorm#9968) * added instanceName to options * run prettier --------- Co-authored-by: Jens Horch <horch@hector.de> * fix: for running cli-ts-node-esm use exit code from child process (typeorm#10030) Use child process exit code in parent process to properly indicate that child process (migration running) fails Closes: typeorm#10029 * fix: add onDelete option validation for oracle (typeorm#9786) * fix: add onDelete option validation for oracle Closes: typeorm#9189 * refactor: move fk validation logic to EntityMetadataValidator.ts * fix: skip assertion for other databases * fix: styles --------- Co-authored-by: ke <ke@sbs.co.at> * fix: convert the join table ID to the referenceColumn ID type (typeorm#9887) * 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: correct encode mongodb auth credentials (typeorm#10024) * fix: correct encode mongodb auth credentials when use the special character `@` into mongodb password result in unauthorized because the it has no encoding Closes: typeorm#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: create correct children during cascade saving entities with STI (typeorm#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: typeorm#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: typeorm#7758 * test: check STI type setting discriminator manually Related to: typeorm#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: typeorm#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: typeorm#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: typeorm#7758 * fix: support More/LessThanOrEqual in relations (typeorm#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> * fix: added transaction retry logic in cockroachdb (typeorm#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 * version bump * test: fix test from typeorm#9034 with STI for Oracle (typeorm#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 typeorm#9786. * fix: add missing await (typeorm#10084) * chore: use new CircleCI convenience images (typeorm#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 typeorm#10100 * fix: typeorm#10040 TypeORM synchronize database even if it is up to date (typeorm#10041) * test: typeorm#10040 TypeORM synchronize database even if it is up to date * formating * fix: TypeORM synchronize database even if it is up to date typeorm#10040 * feat: Added back fork spanner changes * fix lock version --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com> Co-authored-by: smile1sky <82568280+smile-sky20@users.noreply.github.com> Co-authored-by: Bikram Suwal <veekramsuwal@gmail.com> Co-authored-by: Dominic Ruggiero <dominic@userexe.me> Co-authored-by: AlexMesser <dmzt08@gmail.com> Co-authored-by: Danny Koppenhagen <mail@k9n.dev> Co-authored-by: Oskar Jaskólski <oskarrro90@gmail.com> Co-authored-by: Barak Shelef <107487965+barakshelef-oasis@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Arnaud de Mouhy <1552768+dehy@users.noreply.github.com> Co-authored-by: Sakura <54829481+Yuuki-Sakura@users.noreply.github.com> Co-authored-by: Charlton Austin <charlton.austin@gmail.com> Co-authored-by: Jeffyter Saraiva <35247554+iJhefe@users.noreply.github.com> Co-authored-by: Patrick Gallagher <pfgallagher@users.noreply.github.com> Co-authored-by: Coroliov Oleg <1880059+ruscon@users.noreply.github.com> Co-authored-by: Gonzalo Rodulfo Martínez <23481808+rodzalo@users.noreply.github.com> Co-authored-by: Charlély Delgrange <charlely.delgrange@gmail.com> Co-authored-by: Pavel Petrik <redwert@users.noreply.github.com> Co-authored-by: Pavel <pavel@loanbase.com> Co-authored-by: kz-d <116164465+kz-d@users.noreply.github.com> Co-authored-by: Adrian Burlacu <63519230+adrian-burlacu-software@users.noreply.github.com> Co-authored-by: Adrian Burlacu <adrian.burlacu@live.com> Co-authored-by: Gentilhomme <gentilhomme.thomas@gmail.com> Co-authored-by: 4l3ss <2623600+4l3ss@users.noreply.github.com> Co-authored-by: Dan Manastireanu <498419+danmana@users.noreply.github.com> Co-authored-by: userUndefined ✌️ <80859038+thalles-victor@users.noreply.github.com> Co-authored-by: Nedim Arabacı <nedimarabaci@gmail.com> Co-authored-by: Michael Wolz <michaelwolz93@gmail.com> Co-authored-by: Morteza PRK <mortezaPRK@users.noreply.github.com> Co-authored-by: mortzprk <mortz.prk@gmail.com> Co-authored-by: Bartłomiej Rutkowski <b.rutkowski94@gmail.com> Co-authored-by: Bartlomiej Rutkowski <brutkowski@tilt.app> Co-authored-by: Derek Bonner <deekthesqueak@users.noreply.github.com> Co-authored-by: Tim Beyer <tim.beyer@gmail.com> Co-authored-by: Kadir <kadiraciktan@gmail.com> Co-authored-by: leo-jnesis <55386067+leo-jnesis@users.noreply.github.com> Co-authored-by: Saad A. Bazaz <saadbazaz@hotmail.com> Co-authored-by: r-shirasu <82349387+r-shirasu@users.noreply.github.com> Co-authored-by: Mahmoud Almontasser <almontasser@users.noreply.github.com> Co-authored-by: JesseNeon <62482001+JesseAyegba@users.noreply.github.com> Co-authored-by: ayuvlasenko <77232221+ayuvlasenko@users.noreply.github.com> Co-authored-by: sinkhaha <1468709106@qq.com> Co-authored-by: sinkhaha <1468709606@qq.com> Co-authored-by: Adrian Parry <44247645+subparry@users.noreply.github.com> Co-authored-by: Adrian Parry <adrian.parry@reign.cl> Co-authored-by: James Jurach <james.jurach@gmail.com> Co-authored-by: James Jurach <James.Jurach@apiture.com> Co-authored-by: Sho Ogawa <60885375+linus-sh@users.noreply.github.com> Co-authored-by: Mattias Fjellvang <simplenotezy@users.noreply.github.com> Co-authored-by: summer-boythink <57977288+summer-boythink@users.noreply.github.com> Co-authored-by: 변경연 <39257313+eric-byun@users.noreply.github.com> Co-authored-by: Filip Wróbel <17615126+f-wrobel@users.noreply.github.com> Co-authored-by: Lukas Spiss <35728419+Spissable@users.noreply.github.com> Co-authored-by: Pavel Kolpakov <kolpakov-p@yandex.ru> Co-authored-by: Zeeshan Haider Khan <50953718+zeeshanhaiderkhan@users.noreply.github.com> Co-authored-by: Josh Heng <josh@joshheng.co.uk> Co-authored-by: Vítor L. Brasil <97890530+vitorlbrasil@users.noreply.github.com> Co-authored-by: Dev Aggarwal <22045791+aggarwaldev@users.noreply.github.com> Co-authored-by: Kilian Finger <hey@kilianfinger.com> Co-authored-by: Vista1nik <vista1nik@gmail.com> Co-authored-by: Toshinori Tsugita <tsugita.dev@gmail.com> Co-authored-by: PronDmytro <67123804+PronDmytro@users.noreply.github.com> Co-authored-by: ISary-ge <67458138+ISary-ge@users.noreply.github.com> Co-authored-by: Игорь Сары <isary@MacBook-Pro-Igor.local> Co-authored-by: dzvyagin <dzvyagin@team.amocrm.com> Co-authored-by: StefanZivkovic <44195291+StefanZivkovic@users.noreply.github.com> Co-authored-by: Stefan <stefi@sprintingsoftware.com> Co-authored-by: Aritz <6377040+xtremebiker@users.noreply.github.com> Co-authored-by: Khaled Sameer <khaled.smq@hotmail.com> Co-authored-by: Matheus Melo Antiquera <33763956+MatheusMeloAntiquera@users.noreply.github.com> Co-authored-by: Matheus Melo Antiquera <matheusantiquera@finchsolucoes.com.br> Co-authored-by: ZBAGI <zbagi@poczta.fm> Co-authored-by: Christian Forgács <christian@forgacs.me> Co-authored-by: Christian Forgács <christian@wunderbit.de> Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <netroy@users.noreply.github.com> Co-authored-by: 0x269 <33447608+truemogician@users.noreply.github.com> Co-authored-by: JT Smith <jt@plainblack.com> Co-authored-by: Ihor Levchenko <ifree92@gmail.com> Co-authored-by: Peter Hostačný <hostacny.peter@gmail.com> Co-authored-by: jdgjsag67251 <88368191+jdgjsag67251@users.noreply.github.com> Co-authored-by: ertl <klaus.ertl1@gmail.com> Co-authored-by: ke <ke@sbs.co.at> Co-authored-by: Dylan Seago <dylanseago@users.noreply.github.com> Co-authored-by: Philipp Dyck <pdyck@users.noreply.github.com> Co-authored-by: Leon Miller-Out <leon@singlebrook.com> Co-authored-by: GP4cK <gautier.bayzelon@gmail.com> Co-authored-by: Daniel Huth <4455258+Agreon@users.noreply.github.com> Co-authored-by: dmytroboiko <dmytro@pipernet.com> Co-authored-by: Dmytro Boiko <dmitriy.b@tracktica.com> Co-authored-by: Alexander Kraev <98308330+alexander-kraev-snyk@users.noreply.github.com> Co-authored-by: Gabriel Kim <68445851+gabrielkim13@users.noreply.github.com> Co-authored-by: Joe Mizzi <themizzi@me.com> Co-authored-by: Nguyen Ba Hung <bahung1221@gmail.com> Co-authored-by: sinopsysHK <sinofwd@gmail.com> Co-authored-by: acuthbert <acuthbert@gcdtech.com> Co-authored-by: Jose Toscano <42146866+JoseCToscano@users.noreply.github.com> Co-authored-by: mptr <54647612+mptr@users.noreply.github.com> Co-authored-by: tgrassl <grassl.timon@gmail.com> Co-authored-by: Matheus Melo Antiquera <matheus.melo.a@hotmail.com> Co-authored-by: Alankarsharma <alankar.sharma005@gmail.com> Co-authored-by: Stafford Williams <staff0rd@users.noreply.github.com> Co-authored-by: Bengt Weiße <bengtler@gmail.com> Co-authored-by: ☃ Elliot Shepherd <elliot@jarofworms.com> Co-authored-by: RustySol <93598467+RustySol@users.noreply.github.com> Co-authored-by: ru.c <ru@shuffle.com> Co-authored-by: Lucian Mocanu <alumni@users.noreply.github.com> Co-authored-by: Lucian Mocanu <lucian.mocanu@nexontis.com> Co-authored-by: Ezekiel Adetoro <39957559+adetorodev@users.noreply.github.com> Co-authored-by: Alexis Fournier <75622873+a-fournier@users.noreply.github.com> Co-authored-by: afournier <afournier@solocal.com> Co-authored-by: Jo YoHan <37216082+Slowhigh@users.noreply.github.com> Co-authored-by: Jo YoHan <37216082+oxyrinchus@users.noreply.github.com> Co-authored-by: spotykatch <andrey.dashevskiy@yandex.ru> Co-authored-by: Eliya Cohen <co.eliya2@gmail.com> Co-authored-by: smith-xyz <51304449+smith-xyz@users.noreply.github.com> Co-authored-by: YoungKi Lyu <youngkiu@gmail.com> Co-authored-by: Riqwan Thamir <rmthamir@gmail.com> Co-authored-by: Joe Rybarczyk <95554565+99xtal@users.noreply.github.com> Co-authored-by: jrybarczyk <jrybarczyk@exclusiveresorts.com> Co-authored-by: Jens Horch <jenshorch@icloud.com> Co-authored-by: Jens Horch <horch@hector.de> Co-authored-by: Sergey Pahuta <siarhei.pakhuta@mapbox.com> Co-authored-by: tqh177 <42137654+tqh177@users.noreply.github.com> Co-authored-by: leoojg <leoojg@gmail.com> Co-authored-by: Felix Gohla <37421906+felix-gohla@users.noreply.github.com> Co-authored-by: LoneRifle <LoneRifle@users.noreply.github.com> Co-authored-by: pro100kryto <47232701+pro100kryto@users.noreply.github.com> Co-authored-by: juliengbt <48599640+juliengbt@users.noreply.github.com>
* fix: allow to pass ObjectLiteral in mongo find where condition (#9632) Closes: #9518 * feat: support busy_timeout param parameter for sqlite (#9623) Co-authored-by: sinkhaha <1468709606@qq.com> * fix: materialized hints support for cte (#9605) Fix implementation of materialized hints in common table expressions Previous behavior did not account for NOT MATERIALIZED hints, also placed materialized hints in wrong place (before "AS") Co-authored-by: Adrian Parry <adrian.parry@reign.cl> * fix: synchronizing View with schema broken for oracle (#9602) * fix view+schema broken for oracle * apply prettier * fixed missing schema in loadViews(); added test (with .only) * removed .only Co-authored-by: James Jurach <James.Jurach@apiture.com> Co-authored-by: Alex Messer <dmzt08@gmail.com> * removed titles from issue templates * docs: fix some typo in migration document (#9667) * feat: support time travel queries, upsert, enums, spatial types in cockroachdb (#9128) * feature: adds support for enum type (fixes #9068) * temporarily ran package to test on different repo * playing around - bumped version * Revert "playing around - bumped version" This reverts commit 7df4adb3e698419c174c2daee88614f8dafdbb6c. * Revert "temporarily ran package to test on different repo" This reverts commit 48f394e8eb32c22fe757010b446c85740bf80b5f. * feat: add support for geometry data type * feature: properly hydrate enum array values * feature: adds support for geography and geometry for cockroachdb * bugfix: fixes issue with primary generated columns being invalid column type (fixes #8532) * Revert "bugfix: fixes issue with primary generated columns being invalid column type (fixes #8532)" This reverts commit e00cdb090638d34668e3e10acd5f8267fe3bd028. * bugfix: type casts to string when using ANY * feature: cast geometry/geography to geojson * feature: added references to srid * bugfix: prevent error if trying to close already closed connection * feature: added cockrachodb as part of postgres family * feature: ensures support for spatial columns for cockroachdb * feature: adds support for UPSERT for CockroachDB (fixes #9199) * minor: added TODO; unsure how to achieve this * feature: adds support for time travelling queries for cockroachdb * bugfix: only run time travel query on SELECT statements * refactor: changed UsertType from 'upsert' to 'primary-key' since this is more logical * feature: added posibility to set timeTravelQuery to false, instead of the parameter function; help for disabling time travel queries during tests * feature: allow timeTravelQueries in find* queries * bugfix: when using timetravel queries with joinAttributes it now prevents error 'AS OF SYSTEM TIME must be in top level' error * lint * minor fix * fixed failing test * implemented ENUM type; added tests; * fixed failing tests * fixed failing test * fixed spatial types synchronization; implemented spatial indices; added tests for spatial columns; * refactored Time Travel Query functionality; removed TTQ from find options; added tests for TTQ; * added docs for Time Travel Queries * minor changes * added GeoJSON types; other minor fixes; * updated docs * updated docs Co-authored-by: Dmitry Zotov <dmzt08@gmail.com> * refactor: remove a deprecated function (#9702) * fix: remove unnecessary .js extension in imports (#9713) * fix: remove extension when importing file * removed unnecessary .js extension in imports --------- Co-authored-by: Dmitry Zotov <dmzt08@gmail.com> * chore: add *.iml to .gitignore (#9707) * test: Add test to prove that issue #2331 is resolved (#9688) * test: update multiple nested embedded entities (#9696) * test: update multiple nested embedded entities Closes: #1200 * test: update multiple nested embedded entities - fix for ORA-00972 - shorter names Closes: #1200 * test: correct test name for issue 1200 Closes: #1200 * fix: overriding caching settings when alwaysEnabled is true (#9731) * 9023-2 Fix cache overriding option * 9023-2 Fix format * docs: update many-to-many-relations.md (#9736) * build(deps): bump http-cache-semantics from 4.1.0 to 4.1.1 (#9758) Bumps [http-cache-semantics](https://github.com/kornelski/http-cache-semantics) from 4.1.0 to 4.1.1. - [Release notes](https://github.com/kornelski/http-cache-semantics/releases) - [Commits](https://github.com/kornelski/http-cache-semantics/compare/v4.1.0...v4.1.1) --- updated-dependencies: - dependency-name: http-cache-semantics dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: Fix grammar error in no migrations found log (#9754) * docs: Fix grammar error in the first paragraph. (#9759) docs: Fix grammar (verbal agreement) error in the first paragraph. * feat: allow mysql2 v3 as peerDependency (#9747) Closes #9714 * fix: make sure "require" is defined in the environment * fix: redundant Unique constraint on primary join column in Postgres (#9677) * test: one migration for PrimaryColumn and JoinColumn in pg * fix: stop postgres from creating unique on PrimaryColumn with JoinColumn * fix: resolve issue with "simple-enum" synchronization in SQLite (#9716) * fix: resolve issue with "simple-enum" in sqlite Closes: #9715 * trying to re-trigger CircleCI tests --------- Co-authored-by: Dmitry Zotov <dmzt08@gmail.com> * fix: improved `FindOptionsWhere` behavior with union types (#9607) * 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> * fix: sql expression when `where` parameter is empty array (#9691) Closes: #9690 Co-authored-by: Dmitry Zotov <dmzt08@gmail.com> * feat: naming strategy for legacy Oracle (#9703) * 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. * feat: add find operator json contains (#9665) * feature: add find operator json contains * add test --------- Co-authored-by: Игорь Сары <isary@MacBook-Pro-Igor.local> Co-authored-by: dzvyagin <dzvyagin@team.amocrm.com> * docs: update cli related docs (#9659) - remove cli.entitiesDir description - remove cli.subscribersDir description - remove cli from Data Source Options example - extend migration:run examples with -- -d path-to-datasource-config - extend migration:revert examples with -- -d path-to-datasource-config - extend migration:show examples with -- -d path-to-datasource-config - extend migration:create examples with path-to-migrations-dir/migrationName Co-authored-by: Stefan <stefi@sprintingsoftware.com> * feat: support enableWal for the better-sqlite3 driver (#9619) * fixed wrong callback definition in tests * fix: Incorrect enum default value when table name contains dash character (#9685) * fix: get enum default value * chore: format * fix: add support for mongodb v4 (#9450) * 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> * Revert "fix: add support for mongodb v4 (#9450)" (#9762) This reverts commit 8150525354a7a66e68152ef7bd894ad93266d2af. * fix: incorrect sorting of entities with multi-inheritances (#9406) * Fixed sorting of entities with multi-inheritances * prettier * added test case --------- Co-authored-by: Alex Messer <dmzt08@gmail.com> * removed unnecessary .js extension in imports * refactor: use abstract logger to reduce duplicate code (#9751) * feat(platform-tools): add more logging functions * refactor(logger): add `AbstractLogger` to reduce duplicate code --------- Co-authored-by: Christian Forgács <christian@wunderbit.de> * feat: update mssql dependency and other dependencies as well (#9763) * updating dependencies * fixing circleci config * reverting mongodb version back * increasing cli commands test timeout * feat: support for SQL aggregate functions SUM, AVG, MIN, and MAX to the Repository API (#9737) * 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 * version bump * fix: react-native doesn't properly work in ESM projects because of circular dependency (#9765) * fix: use forward slashes when normalizing path (#9768) Fixes #9766 * docs: documented getCount() method (#9847) * 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 * docs: update relations-faq (#9879) Proposed a better safe-type workaround for circular dependencies. * docs: update many-to-many-relations.md (#9861) Fixing typescript code. * docs: added a documentation section on debugging query builder (#9846) * 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 * refactor: remove date-fns package (#9634) * 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 * build(deps): bump jsonwebtoken and mssql (#9700) Bumps [jsonwebtoken](https://github.com/auth0/node-jsonwebtoken) to 9.0.0 and updates ancestor dependency [mssql](https://github.com/tediousjs/node-mssql). These dependencies need to be updated together. Updates `jsonwebtoken` from 8.5.1 to 9.0.0 - [Release notes](https://github.com/auth0/node-jsonwebtoken/releases) - [Changelog](https://github.com/auth0/node-jsonwebtoken/blob/master/CHANGELOG.md) - [Commits](https://github.com/auth0/node-jsonwebtoken/compare/v8.5.1...v9.0.0) Updates `mssql` from 7.3.0 to 9.0.1 - [Release notes](https://github.com/tediousjs/node-mssql/releases) - [Changelog](https://github.com/tediousjs/node-mssql/blob/master/CHANGELOG.txt) - [Commits](https://github.com/tediousjs/node-mssql/compare/v7.3.0...v9.0.1) --- updated-dependencies: - dependency-name: jsonwebtoken dependency-type: indirect - dependency-name: mssql dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: resolve issues for mssql migration when simple-enum was changed * 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> * fix: resolves issue with mssql column recreation (#9773) * 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> * feat: allow type FindOptionsOrderValue for order by object property (#9895) (#9896) 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. * fixing failing test * feat: Broadcast identifier for removed related entities (#9913) * Initial commit * Pending changes exported from your codespace * Revert changes * Fix format * test: when calling AVG on an integer column, MS SQL Server returns an int. (#9784) In this case, 50 instead of 50.5. Apparently the ANSI standard for SQL is silent on this issue, so either behavior should be considered acceptable. * fix: loading tables with fk in sqlite query runner (#9875) Closes: #9266 * fix: improve EntityNotFound error message in QueryBuilder.findOneOrFail (#9872) * fix: EntityNotFound error message in QueryBuilder.findOneOrFail * change test * change test * change test * fix: proper default value on generating migration when default value is a function calling [Postgres] (#9830) Co-authored-by: Dmytro Boiko <dmitriy.b@tracktica.com> * docs: update migrations docs (#9828) * feat: add support for STI on EntitySchema (#9834) * feat: add support for STI on EntitySchema Closes: #9833 * fix: run prettier --------- Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com> * fix: use object create if entity skip constructor is set (#9831) * feat: add support for json datatype for sqlite (#9744) * fix: prevent foreign key support during migration batch under sqlite (#9775) * 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> * fix: transform values for FindOperators #9381 (#9777) * 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> * feat: leftJoinAndMapOne and innerJoinAndMapOne map result to entity (#9354) * 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: handles "query" relation loading strategy for TreeRepositories (#9680) 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 * fix: firstCapital=true not working in camelCase() function * feat: QueryBuilder performance optimizations (#9914) * 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 * version bump * fix: wrong dependency version in init command * fix: drop xml & yml connection option support (#9930) * version bump * added package lock * ci: wait if oracle db is enabled in test suite (#9946) * test: cli init with local typeorm package (#9926) * 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 * feat: support for the latest mongodb v5 (#9925) * 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> * fix: SelectQueryBuilder builds incorrectly escaped alias in Oracle when used on entity with composite key (#9668) * Update SelectQueryBuilder.ts Bug fix, In case a unique alias is created in first query then result was not getting mapped properly. * lint fix --------- Co-authored-by: Dmitry Zotov <dmzt08@gmail.com> * chore: better console.log (#9924) * refactor: combine sqlite json and simple-json handling (#9937) * docs: wrong documentation on QueryBuilder.getCount() (#9935) * fix: make cache optional fields optional (#9942) This patch allows the getFromCache caller to only pass in identifier or query field, as getFromCache already handles the identifier and query field checks Co-authored-by: ru.c <ru@shuffle.com> * fix: prevent unique index identical to primary key (all sql dialects) (#9940) Co-authored-by: Lucian Mocanu <lucian.mocanu@nexontis.com> * fixed compiler error * version bump * docs: issue #8860 (#9951) * fixed: issue #8860 * example looks rough --------- Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com> * fix: add directConnection options to MongoDB connection (#9955) Co-authored-by: afournier <afournier@solocal.com> * docs: update entity-manager-api.md (#9956) typo: const timber = await manager.findOne(User, { firstName: "Timber" }) → const timber = await manager.findOneBy(User, { firstName: "Timber" }) Co-authored-by: Jo YoHan <37216082+oxyrinchus@users.noreply.github.com> * fix: resolve duplicate subscriber updated columns (#9958) Closes: #9948 * fix: select + addOrderBy broke in 0.3.14 (#9961) * added test for #9960 * fixing the issue * limiting only to postgres because of NULLS FIRST syntax * lint * refactor: query methods should accept generic for return type (#9957) * query should accept generics * Update DataSource.ts * feat: mariadb uuid inet4 inet6 column data type support (#9845) * feat: mariadb inet4, inet6, uuid data type support * refactor: cleanup unnecessary methods * style: mysqldriver formatting * fix: handle length column metadata mariadb uuid * fix: 8832 test suite to verify errors correctly * style: fix 8832 test formatting * fix: 8832 error testing cleanup * fix: remove defaulting column type feature * style: fix formatting * fix: remove unnecessary dbms error test * fix: remove unused import in test * fix: ensure defaulting uuid generation column type * fix: mongodb typings breaks the browser version (#9962) * fix: exclude mongodb typings from browser Closes: #9959 fix: delete unnessecary dummy file * another fix for bson typings problem in browser --------- Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com> * revert: "refactor: remove date-fns package (#9634)" This reverts commit 1fcd9f38 * fix: allow json as alias for longtext mariadb (#10018) * fix: express option bug in init command (#10022) * Fix express option bug in init command * fixed esm support in command * fix linter --------- Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com> * fix: RelationIdLoader has access to queryPlanner when wrapped in transaction (#9990) fix issue - createQueryBuilder in repository loses queryplanner when wrapped in txn upsteam until RelationIdLoader Closes: #9988 * fix: add `trustServerCertificate` option to `SqlServerConnectionOptions` (#9985) * fix: add missing 'trustServerCertificate' option to SqlServerConnectionOptions interface Closes: #8093 * docs: add `trustServerCertificate` description to mssql data source options docs * fix: consistency between jsdoc and docs --------- Co-authored-by: jrybarczyk <jrybarczyk@exclusiveresorts.com> * fix: added instanceName to options (#9968) * added instanceName to options * run prettier --------- Co-authored-by: Jens Horch <horch@hector.de> * fix: for running cli-ts-node-esm use exit code from child process (#10030) Use child process exit code in parent process to properly indicate that child process (migration running) fails Closes: #10029 * fix: add onDelete option validation for oracle (#9786) * fix: add onDelete option validation for oracle Closes: #9189 * refactor: move fk validation logic to EntityMetadataValidator.ts * fix: skip assertion for other databases * fix: styles --------- Co-authored-by: ke <ke@sbs.co.at> * fix: convert the join table ID to the referenceColumn ID type (#9887) * 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: correct encode mongodb auth credentials (#10024) * 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: 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 * 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> * 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 * version bump * 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. * fix: add missing await (#10084) * 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 * 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 * version bump * 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> * docs: change `implements` to `extends` (#10219) * docs: update usage of query runner with query builder (#10093) Co-authored-by: Murali <murali.kambhampati@agxworld.com> * fix: upgrade ts-node version to latest(10.9.1) version (#10143) * docs: corrected the typos and grammatical errors in README.md (#10145) Corrected the typos and grammatical errors. * docs: typo on given example (#10166) fix typo on given example. it should log `entity`, instead of `post` * 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 * 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 * fix: add missing export for View class (#10261) * feat: add support for mssql server DefaultAzureCredential usage (#10246) * fix: ignore changes for columns with `update: false` in persistence (#10250) Closes: #10249 * 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 * 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 * 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 * 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. * 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 * feat: implements QueryFailedError generic for driverError typing (#10253) * chore: linting result * feat: implements generic to driver error * 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. * 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 * 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. * 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> * build: update CockroachDB version to v23.1.9 (#10346) The previous version is going out of support. * 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 * docs: fix naming consistency (#10383) * fix: circular dependency breaking node.js 20.6 (#10344) Closes: #10338 * docs: update example-with-express.md (#10374) * 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> * feat: expose countDocuments in mongodb (#10314) * 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. * 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. * fix: add BaseEntity to model-shim (#10503) * 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> * feat: custom STI discriminator value for EntitySchema (#10508) add discriminator value metadata to EntitySchema Closes: #10494 * 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 * 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): * feat: implement streaming for SAP HANA (#10512) * feat: implement column comments for SAP HANA (#10502) * feat: implement column comments for SAP HANA * test: improve schema tests for SAP HANA * 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> * 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 * fix: add error handling for missing join columns (#10525) Closes: #7034 * feat: entityId in InsertEvent (#10540) Co-authored-by: Paul Potsides <paul@koble.ai> * 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> * fix: resolve issue of generating migration for numeric arrays repeatedly (#10471) Closes: #10043 * 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 * 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 * build: removed Node.js 14 from CircleCi (#10576) * fix: default value in child table/entity column decorator for multiple table inheritance is ignored for inherited columns (#10563) (#10564) * fix: mongodb - undefined is not constructor (#10559) * docs: fix orderBy of Spatial columns (#10568) * fix: bump better-sqlite3 version range (#10452) * feat: add concurrent indexes for postgres (#10442) * docs: typo fixed in the manager.findAndCountBy documentation (#10396) * fix: deletedAt column leaking as side effect of object update while creating a row (#10435) * docs: update the docs to keep in line with the example (#10387) * fix: serialize bigint when building a query id #10336 (#10337) * fix: serialize bigint when building a query id * style: update formatting * fix: resolve issue queryBuilder makes different parameter identifiers for same parameter (#10327) Closes: #7308 * 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> * feat: add exists and exists by (#10291) This PR deprecates `exist` in favor of `exists` and `existsBy`. * feat: enabled CTE for oracle driver (#10319) * 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. * 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> * fix: SQLite simple-enum column parsing (#10550) * fix: update UpdateDateColumn on upsert (#10458) Closes: #9015 * 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> * fix: logMigration has incorrect logging condition (#10323) * fix: logMigration has correct logging condition Closes: #10322 * fix: add test description Closes: #10322 * 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 * fix: mongodb resolves leaked cursor (#10316) This change resolves a leaked cursor used to avoid a stack overflow during entity transformation. Closes: #10315 * 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 * feat: exposed entity and criteria properties on EntityNotFoundError (#10202) These properties can be used by consumers to aid in rendering human-readable error messages. * perf: improve SapQueryRunner performance (#10198) Use async API exposed by SAP driver Co-authored-by: Lukasz Otczyk <lukasz.otczyk@nexontis.com> * fix: remove dynamic require calls (#10196) * fix: resolve issues on upsert (#10588) * fix: resolve issues on upsert Closes: #10587 * fix: test 10563 multiple foreach * run format * removed only * fix: mssql datasource testonborrow not affecting anything (#10589) * Remove outdated pool.testOnBorrow references. * Remove invalid testonborrow option. factory. options are not imported or typed. * fix: backport postgres connection error handling to crdb (#10177) * 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 * fix: nested transactions issues (#10210) * fix: nested transactions issues * Forgot test description --------- Co-authored-by: Dmitry Zotov <dmzt08@gmail.com> * chore: initial setup of ESLint (#10203) * build: :construction_worker: Initial setup of ESLint * build: :construction_worker: show erros as warnings * refactor: :recycle: example of rule "no-var" * build: :rotating_light: add rule "no-unsafe-optional-chaining" * docs: fix typos (#10243) * 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> * 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 * fix: correctly keep query.data from ormOption for commit / rollback subscribers (#10151) * fix: should automatically cache if alwaysEnable (#10137) Closes: #9910 * fix: added fail callback while opening the database in Cordova (#10566) * Added fail callback * Added fail callback * Removed the private flag * Fixed comments --------- Co-authored-by: Radu Moian-Dusa <radu.moian-dusa@kronsoft.ro> * docs: updated id to _id (#10584) * docs: update Soft-Delete, Restore-Soft-Delete examples (#10585) The getRepository method is missing from the example. Delete the "users" written in the createQueryBuilder method because it is not used in the where method. * fix: prevent using absolute table path in migrations unless required (#10123) * 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 * docs: update Chinese faq.md (#10593) * 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 * 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> * fix: resolve circular dependency when using Vite (#10273) * resolve circular dependency when using vite * build(deps-dev): bump the npm_and_yarn group group with 1 update (#10591) Bumps the npm_and_yarn group group with 1 update: [gulp-mocha](https://github.com/sindresorhus/gulp-mocha). Updates `gulp-mocha` from 8.0.0 to 10.0.0 - [Release notes](https://github.com/sindresorhus/gulp-mocha/releases) - [Commits](https://github.com/sindresorhus/gulp-mocha/compare/v8.0.0...v10.0.0) --- updated-dependencies: - dependency-name: gulp-mocha dependency-type: direct:development dependency-group: npm_and_yarn-security-group ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * updated glob version * fixed duplicated buffer import * updated license * version bump * fixed glob import * version bump * added breaking change notice in the changelog * 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 * revert "feat: nullable embedded entities (#10289)" (#10614) This reverts commit e67d7041387df78c69599c1d3c880389a935ffbf. * docs: update SelectQueryBuilder.ts (#10631) * feat: add table comment for postgres (#10613) * 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 * fix: multiple insert in SAP Hana (#10597) Co-authored-by: Philipp Haeusle <> * docs: fix table of contents missing sections (#10625) * docs: update the content of one-to-one to be more grammatically complete (#10645) * fix: resolve issue CREATE/DROP Index concurrently (#10634) Closes: #10626 * fix: include asExpression columns in returning clause (#10632) * fix: include asExpression columns in returning clause Closes: #8450 * test: add test for issue #8450 * docs: add And operator example (#10603) * style: Enable some linter rules (#10592) * style: :rotating_light: enable some linter rules * Revert "style: :rotating_light: enable some linter rules" This reverts commit 239fa2deb7aaf22cfac4bbb1369d6d973327efd4. * revert: :rewind: revert role "prefer-const" * revert: :rewind: enable linter warnings * style: :rotating_light: enable rule "no-extra-boolean-cast" * revert: :rewind: disable rule "no-empty" * style: :rotating_light: add linter rule "no-useless-escape" * style: :rotating_light: add linter rule "no-unsafe-optional-chaining" * fix: fallback runMigrations transaction to DataSourceOptions (#10601) * fix: fallback runMigrations transaction to DataSourceOptions * chore: format datasource * fix: type inferencing of EntityManager#create (#10569) * fix: type inferencing of EntityManager#create * test: type inferencing of EntityManager#create (#10569) * docs: add documentation for .orIgnore method (#10607) * fix: don't escape indexPredicate (#10618) * fix: don't escape indexPredicate * style: npm run format * 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 * 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> * docs: grammar mistake fixed (#10647) Let => Lets * fix: added missing parentheses in where conditions (#10650) added missing parentheses in where conditions and with And/Or operators Closes: #10534 * Revert "fix: prevent using absolute table path in migrations unless required (#10123)" (#10624) This reverts commit dd595242a7fbb8c7445cc79bf0b751f1ed1762bd. * version bump * docs: update the custom-repository.md file in the docs/zh_CN directory (#10676) Co-authored-by: OrangeSheepCool <chenyangshuang@qutke.com> * 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> * fix: moved `reflect-metadata` to `peerDependencies` and set version to `"^0.1.14 || ^0.2.0"` (#10779) * chore(docs): add announcement (#11125) * chore: add announcement file * chore: add link from home page to announcement * fix: link to announcement in readme * chore: remove todo * chore: add Tauri links * chore: Replace Slack links with Discord The community has officially moved to Discord * chore: Remove Umed's Skype info * test: Add GitHub Actions for tests CI/CD (#11157) * test: remove restriction of CI/CD runs for fork branches (#11173) * test: Split SQLite tests and fix better-sqlite3 (#11174) * style: Apply formatting (#11175) * chore: Update some packages and run npm audit fix (#11181) Closes #11171 * docs: Some sentence updated for datasource doc (#11182) * chore: Remove CircleCI now that Github actions are running (#11189) * test: Expand node version matrix to node16, node18, and node20 (#11183) * test: redo cockroachdb to service-container GHA and update its version to latest (24) (#11190) * chore: remove gh issues as a place for questions (#11194)) Remove the suggestion of github issues as a place for questions about using TypeORM, and instead point people towards stack overflow and discord for questions about using TypeORM. * docs: Remove links to defunct Vesper project (#11195) * chore: Lint on GitHub actions (#11177) * feat: apply changes for StreamYard (#20) * fix: post merge --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: ayuvlasenko <77232221+ayuvlasenko@users.noreply.github.com> Co-authored-by: sinkhaha <1468709106@qq.com> Co-authored-by: sinkhaha <1468709606@qq.com> Co-authored-by: Adrian Parry <44247645+subparry@users.noreply.github.com> Co-authored-by: Adrian Parry <adrian.parry@reign.cl> Co-authored-by: James Jurach <james.jurach@gmail.com> Co-authored-by: James Jurach <James.Jurach@apiture.com> Co-authored-by: Alex Messer <dmzt08@gmail.com> Co-authored-by: Sho Ogawa <60885375+linus-sh@users.noreply.github.com> Co-authored-by: Mattias Fjellvang <simplenotezy@users.noreply.github.com> Co-authored-by: summer-boythink <57977288+summer-boythink@users.noreply.github.com> Co-authored-by: 변경연 <39257313+eric-byun@users.noreply.github.com> Co-authored-by: Filip Wróbel <17615126+f-wrobel@users.noreply.github.com> Co-authored-by: Lukas Spiss <35728419+Spissable@users.noreply.github.com> Co-authored-by: Pavel Kolpakov <kolpakov-p@yandex.ru> Co-authored-by: Zeeshan Haider Khan <50953718+zeeshanhaiderkhan@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Josh Heng <josh@joshheng.co.uk> Co-authored-by: Vítor L. Brasil <97890530+vitorlbrasil@users.noreply.github.com> Co-authored-by: Dev Aggarwal <22045791+aggarwaldev@users.noreply.github.com> Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com> Co-authored-by: Kilian Finger <hey@kilianfinger.com> Co-authored-by: Vista1nik <vista1nik@gmail.com> Co-authored-by: Toshinori Tsugita <tsugita.dev@gmail.com> Co-authored-by: PronDmytro <67123804+PronDmytro@users.noreply.github.com> Co-authored-by: ISary-ge <67458138+ISary-ge@users.noreply.github.com> Co-authored-by: Игорь Сары <isary@MacBook-Pro-Igor.local> Co-authored-by: dzvyagin <dzvyagin@team.amocrm.com> Co-authored-by: StefanZivkovic <44195291+StefanZivkovic@users.noreply.github.com> Co-authored-by: Stefan <stefi@sprintingsoftware.com> Co-authored-by: Aritz <6377040+xtremebiker@users.noreply.github.com> Co-authored-by: Khaled Sameer <khaled.smq@hotmail.com> Co-authored-by: Matheus Melo Antiquera <33763956+MatheusMeloAntiquera@users.noreply.github.com> Co-authored-by: Matheus Melo Antiquera <matheusantiquera@finchsolucoes.com.br> Co-authored-by: ZBAGI <zbagi@poczta.fm> Co-authored-by: Christian Forgács <christian@forgacs.me> Co-authored-by: Christian Forgács <christian@wunderbit.de> Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <netroy@users.noreply.github.com> Co-authored-by: 0x269 <33447608+truemogician@users.noreply.github.com> Co-authored-by: JT Smith <jt@plainblack.com> Co-authored-by: Ihor Levchenko <ifree92@gmail.com> Co-authored-by: Peter Hostačný <hostacny.peter@gmail.com> Co-authored-by: jdgjsag67251 <88368191+jdgjsag67251@users.noreply.github.com> Co-authored-by: ertl <klaus.ertl1@gmail.com> Co-authored-by: ke <ke@sbs.co.at> Co-authored-by: Dylan Seago <dylanseago@users.noreply.github.com> Co-authored-by: Philipp Dyck <pdyck@users.noreply.github.com> Co-authored-by: Leon Miller-Out <leon@singlebrook.com> Co-authored-by: GP4cK <gautier.bayzelon@gmail.com> Co-authored-by: Daniel Huth <4455258+Agreon@users.noreply.github.com> Co-authored-by: dmytroboiko <dmytro@pipernet.com> Co-authored-by: Dmytro Boiko <dmitriy.b@tracktica.com> Co-authored-by: Alexander Kraev <98308330+alexander-kraev-snyk@users.noreply.github.com> Co-authored-by: Gabriel Kim <68445851+gabrielkim13@users.noreply.github.com> Co-authored-by: Joe Mizzi <themizzi@me.com> Co-authored-by: Nguyen Ba Hung <bahung1221@gmail.com> Co-authored-by: sinopsysHK <sinofwd@gmail.com> Co-authored-by: acuthbert <acuthbert@gcdtech.com> Co-authored-by: Jose Toscano <42146866+JoseCToscano@users.noreply.github.com> Co-authored-by: mptr <54647612+mptr@users.noreply.github.com> Co-authored-by: tgrassl <grassl.timon@gmail.com> Co-authored-by: Matheus Melo Antiquera <matheus.melo.a@hotmail.com> Co-authored-by: Alankarsharma <alankar.sharma005@gmail.com> Co-authored-by: Stafford Williams <staff0rd@users.noreply.github.com> Co-authored-by: Bengt Weiße <bengtler@gmail.com> Co-authored-by: ☃ Elliot Shepherd <elliot@jarofworms.com> Co-authored-by: RustySol <93598467+RustySol@users.noreply.github.com> Co-authored-by: ru.c <ru@shuffle.com> Co-authored-by: Lucian Mocanu <alumni@users.noreply.github.com> Co-authored-by: Lucian Mocanu <lucian.mocanu@nexontis.com> Co-authored-by: Ezekiel Adetoro <39957559+adetorodev@users.noreply.github.com> Co-authored-by: Alexis Fournier <75622873+a-fournier@users.noreply.github.com> Co-authored-by: afournier <afournier@solocal.com> Co-authored-by: Jo YoHan <37216082+Slowhigh@users.noreply.github.com> Co-authored-by: Jo YoHan <37216082+oxyrinchus@users.noreply.github.com> Co-authored-by: spotykatch <andrey.dashevskiy@yandex.ru> Co-authored-by: Eliya Cohen <co.eliya2@gmail.com> Co-authored-by: smith-xyz <51304449+smith-xyz@users.noreply.github.com> Co-authored-by: YoungKi Lyu <youngkiu@gmail.com> Co-authored-by: Riqwan Thamir <rmthamir@gmail.com> Co-authored-by: Joe Rybarczyk <95554565+99xtal@users.noreply.github.com> Co-authored-by: jrybarczyk <jrybarczyk@exclusiveresorts.com> Co-authored-by: Jens Horch <jenshorch@icloud.com> Co-authored-by: Jens Horch <horch@hector.de> Co-authored-by: Sergey Pahuta <siarhei.pakhuta@mapbox.com> Co-authored-by: tqh177 <42137654+tqh177@users.noreply.github.com> Co-authored-by: leoojg <leoojg@gmail.com> Co-authored-by: Felix Gohla <37421906+felix-gohla@users.noreply.github.com> Co-authored-by: LoneRifle <LoneRifle@users.noreply.github.com> Co-authored-by: pro100kryto <47232701+pro100kryto@users.noreply.github.com> Co-authored-by: juliengbt <48599640+juliengbt@users.noreply.github.com> Co-authored-by: Cody Tseng <codytseng98@gmail.com> Co-authored-by: Murali <20809463+mkrrishk@users.noreply.github.com> Co-authored-by: Murali <murali.kambhampati@agxworld.com> Co-authored-by: Lidhya Jeejan <98445118+Lidhya@users.noreply.github.com> Co-authored-by: richardvinc <richardvinc@users.noreply.github.com> Co-authored-by: Raphael Pinto <raphaelcpinto@gmail.com> Co-authored-by: Nadia Karlinsky <55888403+nadiamk@users.noreply.github.com> Co-authored-by: Matthias Lindinger <morpheus-87@users.noreply.github.com> Co-authored-by: Daniel Stumme <destumme@protonmail.com> Co-authored-by: grainrigi <naonaokiryu2@gmail.com> Co-authored-by: Nicklas Laine Overgaard <nicklas@skarp.dk> Co-authored-by: hunjin-choi <71176033+hunjin-choi@users.noreply.github.com> Co-authored-by: Nicolas ROGER <nicolasroger17@gmail.com> Co-authored-by: Sean McGivern <27fv8yygye@snkmail.com> Co-authored-by: Juraj Čarnogurský <Durisvk@users.noreply.github.com> Co-authored-by: Guilherme Nogueira <guilherme.lopesn@gmail.com> Co-authored-by: Zivvvv <guoxiaoshen2021@163.com> Co-authored-by: Mohammad Rayyan <92220531+mohdrayyan123@users.noreply.github.com> Co-authored-by: Rafi Shamim <rafiss@gmail.com> Co-authored-by: Mohammad Rayyan <92220531+logicparadise-rayyan@users.noreply.github.com> Co-authored-by: Erik McKelvey <Erik.McKelvey.is@gmail.com> Co-authored-by: Mohamed Akram <mohd-akram@users.noreply.github.com> Co-authored-by: Akshay Barad <akshay.barad@bitcraft.in> Co-authored-by: growms <103102415+growms@users.noreply.github.com> Co-authored-by: blemoine <services+bitbucket@blemoine.pro> Co-authored-by: Corey Shupe <corey@easy.gg> Co-authored-by: Rafi Shamim <rafi@cockroachlabs.com> Co-authored-by: seungwonleee <seungwon.code@gmail.com> Co-authored-by: Jonathan Dumaine <jonathan.dumaine@dumstruck.com> Co-authored-by: Shabanov Ivan <50909481+zlooun@users.noreply.github.com> Co-authored-by: Ivan Shabanov <mail@ivanshabanov.pro> Co-authored-by: Dinko Osrecki <dinko.osrecki@emarsys.com> Co-authored-by: Steve Foster <steve.p.foster@gmail.com> Co-authored-by: SeongBin Kim <47373132+PleBea@users.noreply.github.com> Co-authored-by: strongpauly <strongpauly@hotmail.com> Co-authored-by: Paul Potsides <paul@koble.ai> Co-authored-by: krylovaaleksandra <101058726+krylovaaleksandra@users.noreply.github.com> Co-authored-by: michaelzaytsev <119557952+michaelzaytsev@users.noreply.github.com> Co-authored-by: Alec Brunelle <alec@alec.coffee> Co-authored-by: Marco Ellwanger <mellster2000@yahoo.com> Co-authored-by: Tomas Heky Hekrla <tomas@heky.eu> Co-authored-by: Peter <peter.placzek1996@gmail.com> Co-authored-by: Samuel Lukes <sam_lukes@icloud.com> Co-authored-by: Alperen Serkan Aksöz <61659936+sekomer@users.noreply.github.com> Co-authored-by: Muhammad Salman Afzal <m.salmanafzal@hotmail.com> Co-authored-by: Christopher Kiessling <Crsk@mail.com> Co-authored-by: ales-albert-kilbergr <79090159+ales-albert-kilbergr@users.noreply.github.com> Co-authored-by: Fawzi Abdulfattah <iifawzie@gmail.com> Co-authored-by: Julien MUNIO <66304686+julienmunio@users.noreply.github.com> Co-authored-by: julien.munio-ext <julien.munio-ext@arkema.com> Co-authored-by: Nemanja Stanic <105949556+nemanjastanic@users.noreply.github.com> Co-authored-by: sschneider-ihre-pvs <86342787+sschneider-ihre-pvs@users.noreply.github.com> Co-authored-by: Harry Brundage <harry.brundage@gmail.com> Co-authored-by: Joren Vandeweyer <joren.vandeweyer@appwise.be> Co-authored-by: Szymon Bretner <32438334+ncpa0cpl@users.noreply.github.com> Co-authored-by: kyoungmin kim <103707811+bejewelkyoungminkim@users.noreply.github.com> Co-authored-by: Tolga Paksoy <tolga@paramander.com> Co-authored-by: Clinton Blackburn <clinton.blackburn@gmail.com> Co-authored-by: Lukasz Otczyk <otczyk6@gmail.com> Co-authored-by: Lukasz Otczyk <lukasz.otczyk@nexontis.com> Co-authored-by: Dukezo <tennissmasher4@gmail.com> Co-authored-by: Alessio Napolitano <121714208+alenap93@users.noreply.github.com> Co-authored-by: thisnamewasnottaken <8645373+thisnamewasnottaken@users.noreply.github.com> Co-authored-by: Piotr Dobrowolski <Informatic@users.noreply.github.com> Co-authored-by: Tait Clarridge <tait@clarridge.ca> Co-authored-by: Gazy Mahomar <gmahomarf@users.noreply.github.com> Co-authored-by: Markus Fürer <markus.fuerer@imedico.ch> Co-authored-by: le-harivansh <40538767+le-harivansh@users.noreply.github.com> Co-authored-by: Minh Nguyên <3langn@gmail.com> Co-authored-by: andrewda <andrew@dassonville.dev> Co-authored-by: Andrea Mouraud <andrea@toucantoco.com> Co-authored-by: moianra23 <148346006+moianra23@users.noreply.github.com> Co-authored-by: Radu Moian-Dusa <radu.moian-dusa@kronsoft.ro> Co-authored-by: Davis Sylvester <davis@sylvesterllc.com> Co-authored-by: sagentac <128644336+sagentac@users.noreply.github.com> Co-authored-by: Deep khurana <36783904+deepkhurana1999@users.noreply.github.com> Co-authored-by: zhennann <zhen.nann@icloud.com> Co-authored-by: Esmaeil Mohammadi <vorujack@gmail.com> Co-authored-by: Kobe Kwanten <72790515+Kobe-Kwanten@users.noreply.github.com> Co-authored-by: Pavlo Kolodka <17pavlo.ko@gmail.com> Co-authored-by: Kazuki Matsuo <kazuki_matsuo@dwango.co.jp> Co-authored-by: Esdras Rodrigues do Carmo <esdrasbrz@gmail.com> Co-authored-by: Mansur Ibrahim Nok <mansuribrahimnok@gmail.com> Co-authored-by: Maarten Sijmkens <maarten.sijmkens@gmail.com> Co-authored-by: Edrich Hans Chua <edrich@xendit.co> Co-authored-by: Andrei Nikolaev <qpkskynet@gmail.com> Co-authored-by: Alexey Pelykh <alexey.pelykh@gmail.com> Co-authored-by: Shu Nonaka <shu.nonaka+tech@casheeeewnuts.net> Co-authored-by: Niels Stinissen <57660362+nielsstinissen@users.noreply.github…
Description of change
This addresses #673, and adds a convenient way to call aggregate functions via the repository API.
Pull-Request Checklist
master
branchnpm run format
to apply prettier formattingnpm run test
passes with this change