Skip to content
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

fix: merge with TypeORM master [TECH-4623] #1

Closed
wants to merge 184 commits into from

Conversation

carlba
Copy link

@carlba carlba commented Apr 13, 2023

Is merging the right approach here or would it better to graft the commit that adds our changes on the latest version of TypeORM?

anton-pavlov-deel and others added 30 commits August 22, 2022 22:52
…#8917)

* Fix: await DataSource from export file to support async loading

* fix: prettier errors

* updated code style

Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com>
…m#9315)

* docs: migration replace Connection with DataSource option

* Apply suggestions from code review

Co-authored-by: Leyla Jähnig <leyla.jaehnig@gmx.de>

Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com>
Co-authored-by: Pavel <pavel@loanbase.com>
…n MySQL 8 (typeorm#8927)

As of mysql v8.0, new synonymous was introduced for "GeometryCollection" - "GeomCollection".
The preferred type name is "GeomCollection".
Previously, the documentation said that it's using the `findOne`
function, but it used the `findBy` and `findOneBy` functions. In order
to be coherent, this commit changes all those to `findOneBy`.
* fix: use existing query and filter deleted data

* test: add mongo-repository query test with DeleteDateColumn

* style: lint MongoEntityManager

* fix: not override $or with query.$or

* test: not override query.$or
On line 73 have 'three options' to setup, but is actually only two as you can see.
* feat: add array parameter on groupBy

* docs: add groupBy(string[])
…eck constraint with SQLite (typeorm#9185)

* fix: don't use temporary table name to create foreign key, unique, check constraint with SQLite

In migration steps, finally temporary table name is renamed to original table name. these constraints name should be created from original table name not temporary table name.

Closes: typeorm#9176

* style: remove unnecessary comment
Take inheritance into consideration when sorting insert commands

Closes: typeorm#9241

Co-authored-by: Kevin KONRAD <ext.kevin.konrad@reseau.sncf.fr>
…m#9238)

Closes typeorm#9237

Co-authored-by: Brice Miclo <brice.miclo@socomec.com>
…rm#9236)

* fix: update date utils to parse year correctly for years 1-999

Closes: typeorm#9230

* fix: commit change to date utils

* fix: default total length to 2
Currently the entity manager remove method does not recognize the first param if it is an entity schema.
This extends github PR typeorm#7792 to pass the error, if any, to the release
callback from `pg-pool`. This should be done to ensure the connection is
removed from the pool, as described in typeorm#5112.
…efault (typeorm#9065)

* fix: support postgres column with varchar datatype and uuid_generate_v4() default

Closes: typeorm#9063

* added test

Co-authored-by: Dmitry Zotov <dmzt08@gmail.com>
Fix forgot comparison operator in typeorm#9242

Closes: typeorm#9241

Co-authored-by: Kevin KONRAD <ext.kevin.konrad@reseau.sncf.fr>
* fix typeorm#9318

fix: change postgres driver version checking query

Change the postgres `SHOW server_version` query to use `SELECT version()` which adds compatibility with AWS Redshift database

Closes: typeorm#9318

* git-issue 9318: remove describe from only in test

* fix-9318: prettier format test
* fix: sqlite temporary tables now honor withoutRowid

Closes: typeorm#8430

* merge master

* fixed `withoutRowid` on table recreation;
added test;

Co-authored-by: Thrasher <thrasher@grayshift.com>
Co-authored-by: Alex Messer <dmzt08@gmail.com>
…lationship (typeorm#8748)

* fixes typeorm#8747

* apply fix again

* added test for issue 8747

* format

* remove .only

* only use postgres driver

* fixed test

* removed createDateColumn

* sqlite does not support timestamp type

* fix typo

Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com>
Co-authored-by: Alex Messer <dmzt08@gmail.com>
* fix: allow where IsNull for ManyToOne relations

Closes: typeorm#8890

* fix direct FindOperator queries on MTO relation

* fix: allow FindOperator queries on OTO owner column

* chore: prettier formating
GP4cK and others added 21 commits April 6, 2023 11:31
…il (typeorm#9872)

* fix: EntityNotFound error message in QueryBuilder.findOneOrFail

* change test

* change test

* change test
…is a function calling [Postgres] (typeorm#9830)

Co-authored-by: Dmytro Boiko <dmitriy.b@tracktica.com>
* feat: add support for STI on EntitySchema

Closes: typeorm#9833

* fix: run prettier

---------

Co-authored-by: Umed Khudoiberdiev <pleerock.me@gmail.com>
…ypeorm#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

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>
…ypeorm#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>
…ypeorm#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
* 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
* 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
@icercel
Copy link

icercel commented Apr 13, 2023

my browser froze while trying to load 433 changed files
do we need to review all of them? :)

@carlba
Copy link
Author

carlba commented Apr 13, 2023

my browser froze while trying to load 433 changed files do we need to review all of them? :)

Of course not this is just a merge of all the upstream TypeORM changes to this point. So only the changes I introduced in my previous commit which was the reason for the fork is intresting. But I do agree that it is very hard to see that in this diff. That is why I asked for alternate aproaches to this merge. Would it be better to simply create a new fork and the changes on top of that?

@carlba
Copy link
Author

carlba commented Apr 13, 2023

8342844

@elias-winberg
Copy link

8342844

Are these the changes on top?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment