-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Closed
Labels
Description
Issue description
useIndex is not preserved when cloning a QueryExpressionMap (or a QueryBuilder) instance
Expected Behavior
Cloning a QueryBuilder (or more specifically a QueryExpressionMap) instance via the .clone() method should preserve the useIndex property, if defined
Actual Behavior
queryBuilder.expressionMap.useIndex is not preserved, since it's not explicitly copied over in QueryExpressionMap.clone() like the other properties are
Steps to reproduce
const qb = dataSource
.getRepository(SomeEntity)
.createQueryBuilder("u")
.useIndex("IDX_foo")
console.log(qb.expressionMap.useIndex) // "IDX_foo"
console.log(qb.clone().expressionMap.useIndex) // undefinedMy Environment
| Dependency | Version |
|---|---|
| Operating System | Ubuntu 22.04 |
| Node.js version | 20.11.0 |
| Typescript version | 5.3.3 |
| TypeORM version | 0.3.20 |
Additional Context
No response
Relevant Database Driver(s)
- aurora-mysql
- aurora-postgres
- better-sqlite3
- cockroachdb
- cordova
- expo
- mongodb
- mysql
- nativescript
- oracle
- postgres
- react-native
- sap
- spanner
- sqlite
- sqlite-abstract
- sqljs
- sqlserver
Are you willing to resolve this issue by submitting a Pull Request?
Yes, I have the time, and I know how to start.