* feat: add upsert methods for the drivers that support it
This adds EntityManager#upsert, BaseEntity#upsert and EntityManager#upsert
Closes: #2363
* docs: Document which drivers support upsert operations
* docs: fix typo in entity manager upsert many example
* refactor: remove mongodb style upsert signature, enforce types of conflict paths
* docs: add note to repository docs specifying which drivers support upsert
* refactor: cannot staticly type conflict paths because that would break typescript pre-4
* refactor: remove test utility methods in favor of some repeated checks
* feat: extend column options interfaces to also support Postgres10+ Identity generationStrategy
* feat: extend PrimaryGeneratedColumn support for Postgres10+ identity
* feat: update buildCreateColumnSql with Postgres10+ IDENTITY support
* feat: update loadTables for Postgres10+ IDENTITY column recognition
* doc: add description of identity support for PrimaryGeneratedColumn
* test: add test for SQL of table with IDENTITY COLUMN in Postgres 10+
* feat: take identity generation type into consideration when checking for changed column
* fix: better non behavior changing way of checking for identity column
* chore: rebase and resolve PR conversations
* feat: add relation options to all tree queries
Closes: #8076
* fix: corrected array index in test case
* try to fix failing test
* fix: sort the array in order to be able to apply tests
* Bugfix: OneToManySubjectBuilder generated invalid subjects because of failed matching of relation IDs.
* relation.getEntityValue does not always return an array. Fix by defaulting to empty array on falsy return value.
* Add tests
* test fixes
* Refactor tests ensuring composite keys on child side into a separate test suite @ functional tests
* Rewrite tests and notes to correctly document+show what's the actual issue
* Fix: test must not use Promise.all, parallel execution against different drivers would mess up the counter within the SettingSubscriber!
* code updates
* okay now I know we need this check
Co-authored-by: Jannik <jannik@jannikmewes.de>
Co-authored-by: jannik.wjm@gmail.com <>
Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com>
* fix: defaults type cast filtering
This fixes column default value in cockroachdb continuously producing schema changes when there should be none
Refs: #7110
* fix: defaults type cast filtering
Remove debugging code
Refs: #7110
* test: create simplified test for https://github.com/typeorm/typeorm/issues/8018
* test: improve test title for issue 8018 to be consistent with project
Co-authored-by: cduff <chris@praxhub.com>
* feat: Add dependency configuraiton for views #8240
Add dependsOn option to @View decorator, where dependencies can be listed. Also use these dependencies to order draop/create view correctly when generating migrations
* fix: Make dropping views dependencies more readable
Rename some variables in viewDependencyChain in RdbmsSchemaBuilder and add more thorough comments, so its more readable.
Co-authored-by: Svetlozar <ext-svetlozar@getitdone.co>
The changes made as part of #7575 fixed some issues and introduced others. The problem became that the table name would be compared against the EntityMetadata tablePath. This would fail in some cases because while the EntityMetadata would specify database, it'd be the "default"/current database & would be omitted from the table name.
To work around that this PR introduces the database & schema on the table objects as well as a fully-qualified table path property which will always include all of them for comparing against EntityMetadata.