refactor: Query builders, drivers, entity/column/relation metadata, decorators#7058
refactor: Query builders, drivers, entity/column/relation metadata, decorators#7058nebkat wants to merge 36 commits intotypeorm:masterfrom
Conversation
84d649a to
9bbdaca
Compare
| if (this.connection.driver instanceof MysqlDriver || this.connection.driver instanceof AuroraDataApiDriver) { | ||
| return " LIMIT " + limit; | ||
| } else { | ||
| throw new LimitOnUpdateNotSupportedError(); |
There was a problem hiding this comment.
Rename to LimitNotSupportedError?
9bbdaca to
db7a5d5
Compare
7d04672 to
0c742f6
Compare
418c9c5 to
c5ce7f7
Compare
|
I'm not sure how to review this PR since change diff isn't clear |
c36d4f0 to
f41aae2
Compare
|
@pleerock I've broken some of the commits up into smaller parts and added extra descriptions to the commit messages. It should now be easier to follow if you review commits one by one. Let me know if you need any further clarifications, am free to chat if necessary. |
c5efbe1 to
b96a0ba
Compare
70e25b4 to
f3e4f7d
Compare
…vers Some drivers require functions such as ST_AsGeoJSON when persisting or selecting columns, this moves the wrapping of the persist/select expressions from the query builder to the driver.
SAP HANA doesn't support null values as parameters so they are converted to the raw NULL value. This moves that conversion from query builder to SapDriver.
Makes Driver.parametrizeValue() an optional function, currently implemented only by SqlServer. Other drivers can now also add additional information to their parameters if necessary.
…yBuilder Moves all functionality from SoftDeleteQueryBuilder to UpdateQueryBuilder except the "from()" function used to specific "soft delete FROM table", because a similar method does not currently exist for UpdateQueryBuilder.
…aryGeneratedColumn
In preparation for "virtual"/computed columns, call internally generated columns "internal" rather than "virtual" to avoid confusion.
* Introduces new type to describe the fields parameter of an @Index or @unique. * Allows (type) => [type.column] syntax inside embedded
…yMetadatas() * Removes unnecessary array pushing/slicing * Matches buildMigrations()/buildSubscribers() more closely
…elete
* Rename ModificationQueryBuilder to AbstractModifyQueryBuilder (UPDATE/DELETE)
* New AbstractPersistQueryBuilder for INSERT/UPDATE/DELETE
* Common code for RETURNING expressions
* Common code for INSERT/UPDATE value expressions
* Move UpdateDateColumn, VersionDateColumn, etc to value expression calculation
* Matches InsertQueryBuilder behavior
refactor: driver: Move database specific EntityManagers to driver Accidentally ammended during rebase
…lags and generators Introduces `DriverConfig` and `DriverQueryGenerators` interfaces that include various flags that drivers can use to customize behavior of the built in functionality. This decouples these built in features from the drivers themselves, moving towards the possibility of having each driver in a separate package.
a128d91 to
9181163
Compare
103b570 to
335aff3
Compare
|
@pleerock I've refactored this to keep up with the latest changes but you can imagine it's quite a complicated one since I have modified so many files, any chance you could take a look at it now? It is becoming rather complicated to keep up with it when working on my other PRs (expression builder and upsert). I know there it is a very large diff but on the individual commit level it should actually be quite easy to review. There are some nice benefits especially on the driver abstraction front - the number of occurrences of I also see you have upgraded TypeScript and were working on the merge |
Description of change
Major refactor of query builders and other parts of code, big improvements in readability and lots of duplicate code removed.
Pull-Request Checklist
masterbranchnpm run lintpasses with this changenpm run testpasses with this changeFixes #0000