feat(QueryRunner): add ifExists parameter to all drop methods#12121
feat(QueryRunner): add ifExists parameter to all drop methods#12121pkuczynski merged 10 commits intomasterfrom
Conversation
…name ifExist to ifExists
Review Summary by QodoAdd ifExists parameter to all drop methods across all database drivers
WalkthroughsDescription• Add optional ifExists parameter to all drop methods across all database drivers that previously lacked it: dropColumn, dropColumns, dropIndex, dropIndices, dropPrimaryKey, dropForeignKey, dropForeignKeys, dropUniqueConstraint, dropUniqueConstraints, dropCheckConstraint, dropCheckConstraints, dropExclusionConstraint, dropExclusionConstraints, and dropView • Standardize parameter naming from ifNotExist/ifExist to ifNotExists/ifExists across all QueryRunner implementations for consistency • Implement database-specific strategies: SQL IF EXISTS clause where supported (PostgreSQL, CockroachDB, SQLite, MySQL, Aurora MySQL), client-side existence checks as fallback for databases without native support (Oracle, SAP HANA, Spanner, SQL Server) • Update QueryRunner interface signatures with new ifExists parameters and improved JSDoc comments • Add comprehensive test coverage for all new ifExists parameters across drop methods • Update API documentation with all new method signatures and parameter descriptions • Fix JSDoc comments in several drivers (Oracle, SQLite, Spanner) for accuracy Diagramflowchart LR
QR["QueryRunner Interface"]
QR -- "standardize parameters" --> Drivers["Database Drivers"]
Drivers --> PG["PostgreSQL"]
Drivers --> CDB["CockroachDB"]
Drivers --> MySQL["MySQL/Aurora"]
Drivers --> SQLite["SQLite"]
Drivers --> Oracle["Oracle"]
Drivers --> SAP["SAP HANA"]
Drivers --> Spanner["Spanner"]
Drivers --> MSSQL["SQL Server"]
Drivers --> Mongo["MongoDB"]
PG -- "add ifExists" --> DropMethods["Drop Methods"]
CDB -- "add ifExists" --> DropMethods
MySQL -- "add ifExists" --> DropMethods
SQLite -- "add ifExists" --> DropMethods
Oracle -- "add ifExists" --> DropMethods
SAP -- "add ifExists" --> DropMethods
Spanner -- "add ifExists" --> DropMethods
MSSQL -- "add ifExists" --> DropMethods
Mongo -- "add ifExists" --> DropMethods
DropMethods --> Tests["Test Coverage"]
DropMethods --> Docs["API Documentation"]
File Changes1. src/driver/postgres/PostgresQueryRunner.ts
|
commit: |
Code Review by Qodo
1.
|
|
Persistent review updated to latest commit df77476 |
1 similar comment
|
Persistent review updated to latest commit df77476 |
…found in metadata
|
Persistent review updated to latest commit 0f9ca04 |
…to-all-drop-methods
|
Persistent review updated to latest commit 0f9ca04 |
Deploying typeorm with
|
| Latest commit: |
adc30ed
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://b16ebcd8.typeorm.pages.dev |
| Branch Preview URL: | https://feat-add-if-exists-to-all-dr.typeorm.pages.dev |
|
Persistent review updated to latest commit 90875e6 |
1 similar comment
|
Persistent review updated to latest commit 90875e6 |
|
Persistent review updated to latest commit bd8e9e6 |
1 similar comment
|
Persistent review updated to latest commit bd8e9e6 |
|
Persistent review updated to latest commit 250bd09 |
|
Persistent review updated to latest commit 1a6f8d6 |
|
|
Persistent review updated to latest commit adc30ed |



ifExistsparameter to all drop methods that previously lacked it:dropColumn,dropColumns,dropIndex,dropIndices,dropPrimaryKey,dropForeignKey,dropForeignKeys,dropUniqueConstraint,dropUniqueConstraints,dropCheckConstraint,dropCheckConstraints,dropExclusionConstraint,dropExclusionConstraintsIF EXISTSwhere the database supports it, client-side existence checks as fallbackifExistsparametersCloses #11450