Skip to content

refactor(sap)!: remove SapConnectionOptions' deprecated properties#12080

Merged
gioboa merged 3 commits intotypeorm:masterfrom
gioboa:fix/12079
Mar 4, 2026
Merged

refactor(sap)!: remove SapConnectionOptions' deprecated properties#12080
gioboa merged 3 commits intotypeorm:masterfrom
gioboa:fix/12079

Conversation

@gioboa
Copy link
Copy Markdown
Collaborator

@gioboa gioboa commented Mar 4, 2026

Close #12079

Description of change

Pull-Request Checklist

  • Code is up-to-date with the master branch
  • This pull request links relevant issues as Fixes #00000
  • There are new or updated tests validating the change (tests/**.test.ts)
  • Documentation has been updated to reflect this change (docs/docs/**.md)

@qodo-free-for-open-source-projects
Copy link
Copy Markdown

Review Summary by Qodo

Remove deprecated SAP driver and pool configuration properties

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Remove deprecated SAP driver properties from interfaces and implementation
• Eliminate hanaClientDriver, max, min, maxWaitingRequests, requestTimeout,
  checkInterval, and idleTimeout options
• Simplify pool configuration logic by removing fallback handling for deprecated properties
• Streamline driver dependency loading to use only current driver property
Diagram
flowchart LR
  A["SapDataSourceOptions Interface"] -->|remove deprecated props| B["Cleaned Interface"]
  C["SapDriver Implementation"] -->|remove fallback logic| D["Simplified Pool Config"]
  E["loadDependencies Method"] -->|remove hanaClientDriver| F["Direct driver usage"]
  B --> G["Cleaner API"]
  D --> G
  F --> G
Loading

Grey Divider

File Changes

1. src/driver/sap/SapDataSourceOptions.ts ✨ Enhancement +0/-41

Remove deprecated SAP connection options

• Remove hanaClientDriver deprecated property from interface
• Remove 6 deprecated pool options: max, min, maxWaitingRequests, requestTimeout,
 checkInterval, idleTimeout
• Keep current properties: driver, maxConnectedOrPooled, maxPooledIdleTime,
 maxWaitTimeoutIfPoolExhausted, pingCheck, poolCapacity

src/driver/sap/SapDataSourceOptions.ts


2. src/driver/sap/SapDriver.ts ✨ Enhancement +3/-10

Remove deprecated property handling in driver logic

• Remove fallback to deprecated max property when setting maxConnectedOrPooled
• Simplify maxPooledIdleTime assignment by removing idleTimeout conversion logic
• Remove fallback to deprecated requestTimeout property for maxWaitTimeoutIfPoolExhausted
• Remove hanaClientDriver fallback in loadDependencies() method, use only driver property

src/driver/sap/SapDriver.ts


Grey Divider

Qodo Logo

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 4, 2026

commit: 36d9b13

@gioboa gioboa changed the title chore: remove SapConnectionOptions / SapDriver deprecated properties chore: remove SapConnectionOptions' deprecated properties Mar 4, 2026
@qodo-free-for-open-source-projects
Copy link
Copy Markdown

qodo-free-for-open-source-projects bot commented Mar 4, 2026

Code Review by Qodo

🐞 Bugs (17) 📘 Rule violations (7) 📎 Requirement gaps (0)

Grey Divider


Action required

1. Undocumented hanaClientDriver removal 📘 Rule violation ✓ Correctness
Description
The PR removes previously-supported (even if deprecated) SAP driver options and fallback behavior
without any accompanying documentation updates. This can break existing configurations and leaves
users without guidance on required migration changes.
Code

src/driver/sap/SapDataSourceOptions.ts[L25-28]

-    /**
-     * @deprecated Use {@link driver} instead.
-     */
-    readonly hanaClientDriver?: any
Evidence
Compliance requires documentation updates for user-facing API/usage changes. The diff removes
hanaClientDriver and multiple pool option properties, and also removes the runtime fallback that
previously accepted hanaClientDriver, but no docs changes are included and the PR checklist
indicates docs were not updated.

Rule 2: Docs updated for user-facing changes
src/driver/sap/SapDataSourceOptions.ts[25-28]
src/driver/sap/SapDriver.ts[887-890]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
This PR removes user-facing (deprecated but supported) SAP configuration options and fallback behavior, but does not update documentation to tell users how to migrate.
## Issue Context
`hanaClientDriver` and multiple pool options were removed from the public options interface and the driver no longer falls back to `hanaClientDriver` at runtime. Users need explicit migration guidance.
## Fix Focus Areas
- src/driver/sap/SapDataSourceOptions.ts[25-28]
- src/driver/sap/SapDriver.ts[887-890]】【”】【}}]}

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Legacy pool config ignored 🐞 Bug ⛯ Reliability
Description
SapDriver no longer maps legacy pool option names (e.g., pool.max, pool.requestTimeout,
pool.idleTimeout) into the SAP HANA client pool options. Because ormconfig-loaded options are not
schema-validated, these legacy keys can still be present at runtime and will now be silently
ignored, changing pool limits/timeouts without any warning.
Code

src/driver/sap/SapDriver.ts[R280-288]

      const poolOptions: any = {
          maxConnectedOrPooled:
              this.options.pool?.maxConnectedOrPooled ??
-                this.options.pool?.max ??
              this.options.poolSize ??
              10,
-            maxPooledIdleTime:
-                this.options.pool?.maxPooledIdleTime ??
-                (this.options.pool?.idleTimeout
-                    ? this.options.pool.idleTimeout / 1000
-                    : 30),
+            maxPooledIdleTime: this.options.pool?.maxPooledIdleTime ?? 30,
          maxWaitTimeoutIfPoolExhausted:
-                this.options.pool?.maxWaitTimeoutIfPoolExhausted ??
-                this.options.pool?.requestTimeout ??
-                0,
+                this.options.pool?.maxWaitTimeoutIfPoolExhausted ?? 0,
      }
Evidence
SapDriver only reads the new pool option names when building poolOptions. Separately,
ConnectionOptionsReader loads and returns configuration objects from ormconfig (js/json/env) and
does not strip unknown properties during normalization, meaning legacy keys can still be present at
runtime but will have no effect.

src/driver/sap/SapDriver.ts[279-288]
src/connection/ConnectionOptionsReader.ts[94-204]
src/connection/ConnectionOptionsReader.ts[210-276]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
SapDriver no longer reads deprecated SAP pool option keys, but runtime-loaded configs (ormconfig js/json/env) can still contain those keys. This results in silent misconfiguration (pool limits/timeouts not applied).
### Issue Context
TypeORM loads ormconfig objects without schema validation and does not remove unknown properties. If an app still uses legacy keys, SapDriver will ignore them and use defaults.
### Fix Focus Areas
- src/driver/sap/SapDriver.ts[279-295]
- src/connection/ConnectionOptionsReader.ts[94-205]
- src/connection/ConnectionOptionsReader.ts[210-276]
- docs/docs/guides/8-migration-v1.md[61-80]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. hanaClientDriver fallback removed 🐞 Bug ⛯ Reliability
Description
loadDependencies() now only checks options.driver, so projects still using the deprecated
hanaClientDriver option will have their provided client ignored and may throw
DriverPackageNotInstalledError if @sap/hana-client isn’t installed.
Code

src/driver/sap/SapDriver.ts[R890-893]

+        const client = this.options.driver
      if (client) {
          this.client = client
Evidence
The driver injection path now exclusively uses options.driver and the SAP options interface no
longer includes hanaClientDriver, meaning older configuration will no longer inject a client. When
driver is absent, loadDependencies() falls back to loading @sap/hana-client, which fails if
the package isn’t installed.

src/driver/sap/SapDriver.ts[889-908]
src/driver/sap/SapDataSourceOptions.ts[19-24]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Older configs using the deprecated `hanaClientDriver` will no longer inject their provided driver, and may unexpectedly attempt to require `@sap/hana-client`.
### Issue Context
Even if TypeScript types no longer include `hanaClientDriver`, runtime configs (JS users, `as any`, env-based config readers) may still pass it. Silent ignore + fallback-to-require can cause confusing production failures.
### Fix Focus Areas
- src/driver/sap/SapDriver.ts[889-908]
### Suggested approach
- Detect `(this.options as any).hanaClientDriver` at runtime.
- Either:
- Throw a clear error: "`hanaClientDriver` was removed; use `driver` instead", OR
- Temporarily support it with `const client = this.options.driver ?? (this.options as any).hanaClientDriver` and log a one-time deprecation warning.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View more (15)
4. Undocumented hanaClientDriver removal 📘 Rule violation ✓ Correctness
Description
The PR removes previously-supported (even if deprecated) SAP driver options and fallback behavior
without any accompanying documentation updates. This can break existing configurations and leaves
users without guidance on required migration changes.
Code

src/driver/sap/SapDataSourceOptions.ts[L25-28]

-    /**
-     * @deprecated Use {@link driver} instead.
-     */
-    readonly hanaClientDriver?: any
Evidence
Compliance requires documentation updates for user-facing API/usage changes. The diff removes
hanaClientDriver and multiple pool option properties, and also removes the runtime fallback that
previously accepted hanaClientDriver, but no docs changes are included and the PR checklist
indicates docs were not updated.

Rule 2: Docs updated for user-facing changes
src/driver/sap/SapDataSourceOptions.ts[25-28]
src/driver/sap/SapDriver.ts[887-890]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
This PR removes user-facing (deprecated but supported) SAP configuration options and fallback behavior, but does not update documentation to tell users how to migrate.
## Issue Context
`hanaClientDriver` and multiple pool options were removed from the public options interface and the driver no longer falls back to `hanaClientDriver` at runtime. Users need explicit migration guidance.
## Fix Focus Areas
- src/driver/sap/SapDataSourceOptions.ts[25-28]
- src/driver/sap/SapDriver.ts[887-890]】【”】【}}]}

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. Legacy pool config ignored 🐞 Bug ⛯ Reliability
Description
SapDriver no longer maps legacy pool option names (e.g., pool.max, pool.requestTimeout,
pool.idleTimeout) into the SAP HANA client pool options. Because ormconfig-loaded options are not
schema-validated, these legacy keys can still be present at runtime and will now be silently
ignored, changing pool limits/timeouts without any warning.
Code

src/driver/sap/SapDriver.ts[R280-288]

     const poolOptions: any = {
         maxConnectedOrPooled:
             this.options.pool?.maxConnectedOrPooled ??
-                this.options.pool?.max ??
             this.options.poolSize ??
             10,
-            maxPooledIdleTime:
-                this.options.pool?.maxPooledIdleTime ??
-                (this.options.pool?.idleTimeout
-                    ? this.options.pool.idleTimeout / 1000
-                    : 30),
+            maxPooledIdleTime: this.options.pool?.maxPooledIdleTime ?? 30,
         maxWaitTimeoutIfPoolExhausted:
-                this.options.pool?.maxWaitTimeoutIfPoolExhausted ??
-                this.options.pool?.requestTimeout ??
-                0,
+                this.options.pool?.maxWaitTimeoutIfPoolExhausted ?? 0,
     }
Evidence
SapDriver only reads the new pool option names when building poolOptions. Separately,
ConnectionOptionsReader loads and returns configuration objects from ormconfig (js/json/env) and
does not strip unknown properties during normalization, meaning legacy keys can still be present at
runtime but will have no effect.

src/driver/sap/SapDriver.ts[279-288]
src/connection/ConnectionOptionsReader.ts[94-204]
src/connection/ConnectionOptionsReader.ts[210-276]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
SapDriver no longer reads deprecated SAP pool option keys, but runtime-loaded configs (ormconfig js/json/env) can still contain those keys. This results in silent misconfiguration (pool limits/timeouts not applied).
### Issue Context
TypeORM loads ormconfig objects without schema validation and does not remove unknown properties. If an app still uses legacy keys, SapDriver will ignore them and use defaults.
### Fix Focus Areas
- src/driver/sap/SapDriver.ts[279-295]
- src/connection/ConnectionOptionsReader.ts[94-205]
- src/connection/ConnectionOptionsReader.ts[210-276]
- docs/docs/guides/8-migration-v1.md[61-80]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


6. Undocumented hanaClientDriver removal 📘 Rule violation ✓ Correctness
Description
The PR removes previously-supported (even if deprecated) SAP driver options and fallback behavior
without any accompanying documentation updates. This can break existing configurations and leaves
users without guidance on required migration changes.
Code

src/driver/sap/SapDataSourceOptions.ts[L25-28]

-    /**
-     * @deprecated Use {@link driver} instead.
-     */
-    readonly hanaClientDriver?: any
Evidence
Compliance requires documentation updates for user-facing API/usage changes. The diff removes
hanaClientDriver and multiple pool option properties, and also removes the runtime fallback that
previously accepted hanaClientDriver, but no docs changes are included and the PR checklist
indicates docs were not updated.

Rule 2: Docs updated for user-facing changes
src/driver/sap/SapDataSourceOptions.ts[25-28]
src/driver/sap/SapDriver.ts[887-890]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
This PR removes user-facing (deprecated but supported) SAP configuration options and fallback behavior, but does not update documentation to tell users how to migrate.
## Issue Context
`hanaClientDriver` and multiple pool options were removed from the public options interface and the driver no longer falls back to `hanaClientDriver` at runtime. Users need explicit migration guidance.
## Fix Focus Areas
- src/driver/sap/SapDataSourceOptions.ts[25-28]
- src/driver/sap/SapDriver.ts[887-890]】【”】【}}]}

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


7. Legacy pool config ignored 🐞 Bug ⛯ Reliability
Description
SapDriver no longer maps legacy pool option names (e.g., pool.max, pool.requestTimeout,
pool.idleTimeout) into the SAP HANA client pool options. Because ormconfig-loaded options are not
schema-validated, these legacy keys can still be present at runtime and will now be silently
ignored, changing pool limits/timeouts without any warning.
Code

src/driver/sap/SapDriver.ts[R280-288]

     const poolOptions: any = {
         maxConnectedOrPooled:
             this.options.pool?.maxConnectedOrPooled ??
-                this.options.pool?.max ??
             this.options.poolSize ??
             10,
-            maxPooledIdleTime:
-                this.options.pool?.maxPooledIdleTime ??
-                (this.options.pool?.idleTimeout
-                    ? this.options.pool.idleTimeout / 1000
-                    : 30),
+            maxPooledIdleTime: this.options.pool?.maxPooledIdleTime ?? 30,
         maxWaitTimeoutIfPoolExhausted:
-                this.options.pool?.maxWaitTimeoutIfPoolExhausted ??
-                this.options.pool?.requestTimeout ??
-                0,
+                this.options.pool?.maxWaitTimeoutIfPoolExhausted ?? 0,
     }
Evidence
SapDriver only reads the new pool option names when building poolOptions. Separately,
ConnectionOptionsReader loads and returns configuration objects from ormconfig (js/json/env) and
does not strip unknown properties during normalization, meaning legacy keys can still be present at
runtime but will have no effect.

src/driver/sap/SapDriver.ts[279-288]
src/connection/ConnectionOptionsReader.ts[94-204]
src/connection/ConnectionOptionsReader.ts[210-276]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
SapDriver no longer reads deprecated SAP pool option keys, but runtime-loaded configs (ormconfig js/json/env) can still contain those keys. This results in silent misconfiguration (pool limits/timeouts not applied).
### Issue Context
TypeORM loads ormconfig objects without schema validation and does not remove unknown properties. If an app still uses legacy keys, SapDriver will ignore them and use defaults.
### Fix Focus Areas
- src/driver/sap/SapDriver.ts[279-295]
- src/connection/ConnectionOptionsReader.ts[94-205]
- src/connection/ConnectionOptionsReader.ts[210-276]
- docs/docs/guides/8-migration-v1.md[61-80]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


8. hanaClientDriver fallback removed 🐞 Bug ⛯ Reliability
Description
loadDependencies() now only checks options.driver, so projects still using the deprecated
hanaClientDriver option will have their provided client ignored and may throw
DriverPackageNotInstalledError if @sap/hana-client isn’t installed.
Code

src/driver/sap/SapDriver.ts[R890-893]

+        const client = this.options.driver
     if (client) {
         this.client = client
Evidence
The driver injection path now exclusively uses options.driver and the SAP options interface no
longer includes hanaClientDriver, meaning older configuration will no longer inject a client. When
driver is absent, loadDependencies() falls back to loading @sap/hana-client, which fails if
the package isn’t installed.

src/driver/sap/SapDriver.ts[889-908]
src/driver/sap/SapDataSourceOptions.ts[19-24]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Older configs using the deprecated `hanaClientDriver` will no longer inject their provided driver, and may unexpectedly attempt to require `@sap/hana-client`.
### Issue Context
Even if TypeScript types no longer include `hanaClientDriver`, runtime configs (JS users, `as any`, env-based config readers) may still pass it. Silent ignore + fallback-to-require can cause confusing production failures.
### Fix Focus Areas
- src/driver/sap/SapDriver.ts[889-908]
### Suggested approach
- Detect `(this.options as any).hanaClientDriver` at runtime.
- Either:
- Throw a clear error: "`hanaClientDriver` was removed; use `driver` instead", OR
- Temporarily support it with `const client = this.options.driver ?? (this.options as any).hanaClientDriver` and log a one-time deprecation warning.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


9. Undocumented hanaClientDriver removal 📘 Rule violation ✓ Correctness
Description
The PR removes previously-supported (even if deprecated) SAP driver options and fallback behavior
without any accompanying documentation updates. This can break existing configurations and leaves
users without guidance on required migration changes.
Code

src/driver/sap/SapDataSourceOptions.ts[L25-28]

-    /**
-     * @deprecated Use {@link driver} instead.
-     */
-    readonly hanaClientDriver?: any
Evidence
Compliance requires documentation updates for user-facing API/usage changes. The diff removes
hanaClientDriver and multiple pool option properties, and also removes the runtime fallback that
previously accepted hanaClientDriver, but no docs changes are included and the PR checklist
indicates docs were not updated.

Rule 2: Docs updated for user-facing changes
src/driver/sap/SapDataSourceOptions.ts[25-28]
src/driver/sap/SapDriver.ts[887-890]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
This PR removes user-facing (deprecated but supported) SAP configuration options and fallback behavior, but does not update documentation to tell users how to migrate.
## Issue Context
`hanaClientDriver` and multiple pool options were removed from the public options interface and the driver no longer falls back to `hanaClientDriver` at runtime. Users need explicit migration guidance.
## Fix Focus Areas
- src/driver/sap/SapDataSourceOptions.ts[25-28]
- src/driver/sap/SapDriver.ts[887-890]】【”】【}}]}

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


10. Legacy pool config ignored 🐞 Bug ⛯ Reliability
Description
SapDriver no longer maps legacy pool option names (e.g., pool.max, pool.requestTimeout,
pool.idleTimeout) into the SAP HANA client pool options. Because ormconfig-loaded options are not
schema-validated, these legacy keys can still be present at runtime and will now be silently
ignored, changing pool limits/timeouts without any warning.
Code

src/driver/sap/SapDriver.ts[R280-288]

    const poolOptions: any = {
        maxConnectedOrPooled:
            this.options.pool?.maxConnectedOrPooled ??
-                this.options.pool?.max ??
            this.options.poolSize ??
            10,
-            maxPooledIdleTime:
-                this.options.pool?.maxPooledIdleTime ??
-                (this.options.pool?.idleTimeout
-                    ? this.options.pool.idleTimeout / 1000
-                    : 30),
+            maxPooledIdleTime: this.options.pool?.maxPooledIdleTime ?? 30,
        maxWaitTimeoutIfPoolExhausted:
-                this.options.pool?.maxWaitTimeoutIfPoolExhausted ??
-                this.options.pool?.requestTimeout ??
-                0,
+                this.options.pool?.maxWaitTimeoutIfPoolExhausted ?? 0,
    }
Evidence
SapDriver only reads the new pool option names when building poolOptions. Separately,
ConnectionOptionsReader loads and returns configuration objects from ormconfig (js/json/env) and
does not strip unknown properties during normalization, meaning legacy keys can still be present at
runtime but will have no effect.

src/driver/sap/SapDriver.ts[279-288]
src/connection/ConnectionOptionsReader.ts[94-204]
src/connection/ConnectionOptionsReader.ts[210-276]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
SapDriver no longer reads deprecated SAP pool option keys, but runtime-loaded configs (ormconfig js/json/env) can still contain those keys. This results in silent misconfiguration (pool limits/timeouts not applied).
### Issue Context
TypeORM loads ormconfig objects without schema validation and does not remove unknown properties. If an app still uses legacy keys, SapDriver will ignore them and use defaults.
### Fix Focus Areas
- src/driver/sap/SapDriver.ts[279-295]
- src/connection/ConnectionOptionsReader.ts[94-205]
- src/connection/ConnectionOptionsReader.ts[210-276]
- docs/docs/guides/8-migration-v1.md[61-80]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


11. hanaClientDriver fallback removed 🐞 Bug ⛯ Reliability
Description
loadDependencies() now only checks options.driver, so projects still using the deprecated
hanaClientDriver option will have their provided client ignored and may throw
DriverPackageNotInstalledError if @sap/hana-client isn’t installed.
Code

src/driver/sap/SapDriver.ts[R890-893]

+        const client = this.options.driver
       if (client) {
           this.client = client
Evidence
The driver injection path now exclusively uses options.driver and the SAP options interface no
longer includes hanaClientDriver, meaning older configuration will no longer inject a client. When
driver is absent, loadDependencies() falls back to loading @sap/hana-client, which fails if
the package isn’t installed.

src/driver/sap/SapDriver.ts[889-908]
src/driver/sap/SapDataSourceOptions.ts[19-24]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Older configs using the deprecated `hanaClientDriver` will no longer inject their provided driver, and may unexpectedly attempt to require `@sap/hana-client`.
### Issue Context
Even if TypeScript types no longer include `hanaClientDriver`, runtime configs (JS users, `as any`, env-based config readers) may still pass it. Silent ignore + fallback-to-require can cause confusing production failures.
### Fix Focus Areas
- src/driver/sap/SapDriver.ts[889-908]
### Suggested approach
- Detect `(this.options as any).hanaClientDriver` at runtime.
- Either:
- Throw a clear error: "`hanaClientDriver` was removed; use `driver` instead", OR
- Temporarily support it with `const client = this.options.driver ?? (this.options as any).hanaClientDriver` and log a one-time deprecation warning.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


12. Undocumented hanaClientDriver removal 📘 Rule violation ✓ Correctness
Description
The PR removes previously-supported (even if deprecated) SAP driver options and fallback behavior
without any accompanying documentation updates. This can break existing configurations and leaves
users without guidance on required migration changes.
Code

src/driver/sap/SapDataSourceOptions.ts[L25-28]

-    /**
-     * @deprecated Use {@link driver} instead.
-     */
-    readonly hanaClientDriver?: any
Evidence
Compliance requires documentation updates for user-facing API/usage changes. The diff removes
hanaClientDriver and multiple pool option properties, and also removes the runtime fallback that
previously accepted hanaClientDriver, but no docs changes are included and the PR checklist
indicates docs were not updated.

Rule 2: Docs updated for user-facing changes
src/driver/sap/SapDataSourceOptions.ts[25-28]
src/driver/sap/SapDriver.ts[887-890]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
This PR removes user-facing (deprecated but supported) SAP configuration options and fallback behavior, but does not update documentation to tell users how to migrate.
## Issue Context
`hanaClientDriver` and multiple pool options were removed from the public options interface and the driver no longer falls back to `hanaClientDriver` at runtime. Users need explicit migration guidance.
## Fix Focus Areas
- src/driver/sap/SapDataSourceOptions.ts[25-28]
- src/driver/sap/SapDriver.ts[887-890]】【”】【}}]}

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


13. Legacy pool config ignored 🐞 Bug ⛯ Reliability
Description
SapDriver no longer maps legacy pool option names (e.g., pool.max, pool.requestTimeout,
pool.idleTimeout) into the SAP HANA client pool options. Because ormconfig-loaded options are not
schema-validated, these legacy keys can still be present at runtime and will now be silently
ignored, changing pool limits/timeouts without any warning.
Code

src/driver/sap/SapDriver.ts[R280-288]

      const poolOptions: any = {
          maxConnectedOrPooled:
              this.options.pool?.maxConnectedOrPooled ??
-                this.options.pool?.max ??
              this.options.poolSize ??
              10,
-            maxPooledIdleTime:
-                this.options.pool?.maxPooledIdleTime ??
-                (this.options.pool?.idleTimeout
-                    ? this.options.pool.idleTimeout / 1000
-                    : 30),
+            maxPooledIdleTime: this.options.pool?.maxPooledIdleTime ?? 30,
          maxWaitTimeoutIfPoolExhausted:
-                this.options.pool?.maxWaitTimeoutIfPoolExhausted ??
-                this.options.pool?.requestTimeout ??
-                0,
+                this.options.pool?.maxWaitTimeoutIfPoolExhausted ?? 0,
      }
Evidence
SapDriver only reads the new pool option names when building poolOptions. Separately,
ConnectionOptionsReader loads and returns configuration objects from ormconfig (js/json/env) and
does not strip unknown properties during normalization, meaning legacy keys can still be present at
runtime but will have no effect.

src/driver/sap/SapDriver.ts[279-288]
src/connection/ConnectionOptionsReader.ts[94-204]
src/connection/ConnectionOptionsReader.ts[210-276]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
SapDriver no longer reads deprecated SAP pool option keys, but runtime-loaded configs (ormconfig js/json/env) can still contain those keys. This results in silent misconfiguration (pool limits/timeouts not applied).
### Issue Context
TypeORM loads ormconfig objects without schema validation and does not remove unknown properties. If an app still uses legacy keys, SapDriver will ignore them and use defaults.
### Fix Focus Areas
- src/driver/sap/SapDriver.ts[279-295]
- src/connection/ConnectionOptionsReader.ts[94-205]
- src/connection/ConnectionOptionsReader.ts[210-276]
- docs/docs/guides/8-migration-v1.md[61-80]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


14. Undocumented hanaClientDriver removal 📘 Rule violation ✓ Correctness
Description
The PR removes previously-supported (even if deprecated) SAP driver options and fallback behavior
without any accompanying documentation updates. This can break existing configurations and leaves
users without guidance on required migration changes.
Code

src/driver/sap/SapDataSourceOptions.ts[L25-28]

-    /**
-     * @deprecated Use {@link driver} instead.
-     */
-    readonly hanaClientDriver?: any
Evidence
Compliance requires documentation updates for user-facing API/usage changes. The diff removes
hanaClientDriver and multiple pool option properties, and also removes the runtime fallback that
previously accepted hanaClientDriver, but no docs changes are included and the PR checklist
indicates docs were not updated.

Rule 2: Docs updated for user-facing changes
src/driver/sap/SapDataSourceOptions.ts[25-28]
src/driver/sap/SapDriver.ts[887-890]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
This PR removes user-facing (deprecated but supported) SAP configuration options and fallback behavior, but does not update documentation to tell users how to migrate.
## Issue Context
`hanaClientDriver` and multiple pool options were removed from the public options interface and the driver no longer falls back to `hanaClientDriver` at runtime. Users need explicit migration guidance.
## Fix Focus Areas
- src/driver/sap/SapDataSourceOptions.ts[25-28]
- src/driver/sap/SapDriver.ts[887-890]】【”】【}}]}

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


15. Legacy pool config ignored 🐞 Bug ⛯ Reliability
Description
SapDriver no longer maps legacy pool option names (e.g., pool.max, pool.requestTimeout,
pool.idleTimeout) into the SAP HANA client pool options. Because ormconfig-loaded options are not
schema-validated, these legacy keys can still be present at runtime and will now be silently
ignored, changing pool limits/timeouts without any warning.
Code

src/driver/sap/SapDriver.ts[R280-288]

      const poolOptions: any = {
          maxConnectedOrPooled:
              this.options.pool?.maxConnectedOrPooled ??
-                this.options.pool?.max ??
              this.options.poolSize ??
              10,
-            maxPooledIdleTime:
-                this.options.pool?.maxPooledIdleTime ??
-                (this.options.pool?.idleTimeout
-                    ? this.options.pool.idleTimeout / 1000
-                    : 30),
+            maxPooledIdleTime: this.options.pool?.maxPooledIdleTime ?? 30,
          maxWaitTimeoutIfPoolExhausted:
-                this.options.pool?.maxWaitTimeoutIfPoolExhausted ??
-                this.options.pool?.requestTimeout ??
-                0,
+                this.options.pool?.maxWaitTimeoutIfPoolExhausted ?? 0,
      }
Evidence
SapDriver only reads the new pool option names when building poolOptions. Separately,
ConnectionOptionsReader loads and returns configuration objects from ormconfig (js/json/env) and
does not strip unknown properties during normalization, meaning legacy keys can still be present at
runtime but will have no effect.

src/driver/sap/SapDriver.ts[279-288]
src/connection/ConnectionOptionsReader.ts[94-204]
src/connection/ConnectionOptionsReader.ts[210-276]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
SapDriver no longer reads deprecated SAP pool option keys, but runtime-loaded configs (ormconfig js/json/env) can still contain those keys. This results in silent misconfiguration (pool limits/timeouts not applied).
### Issue Context
TypeORM loads ormconfig objects without schema validation and does not remove unknown properties. If an app still uses legacy keys, SapDriver will ignore them and use defaults.
### Fix Focus Areas
- src/driver/sap/SapDriver.ts[279-295]
- src/connection/ConnectionOptionsReader.ts[94-205]
- src/connection/ConnectionOptionsReader.ts[210-276]
- docs/docs/guides/8-migration-v1.md[61-80]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


16. hanaClientDriver fallback removed 🐞 Bug ⛯ Reliability
Description
loadDependencies() now only checks options.driver, so projects still using the deprecated
hanaClientDriver option will have their provided client ignored and may throw
DriverPackageNotInstalledError if @sap/hana-client isn’t installed.
Code

src/driver/sap/SapDriver.ts[R890-893]

+        const client = this.options.driver
      if (client) {
          this.client = client
Evidence
The driver injection path now exclusively uses options.driver and the SAP options interface no
longer includes hanaClientDriver, meaning older configuration will no longer inject a client. When
driver is absent, loadDependencies() falls back to loading @sap/hana-client, which fails if
the package isn’t installed.

src/driver/sap/SapDriver.ts[889-908]
src/driver/sap/SapDataSourceOptions.ts[19-24]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Older configs using the deprecated `hanaClientDriver` will no longer inject their provided driver, and may unexpectedly attempt to require `@sap/hana-client`.
### Issue Context
Even if TypeScript types no longer include `hanaClientDriver`, runtime configs (JS users, `as any`, env-based config readers) may still pass it. Silent ignore + fallback-to-require can cause confusing production failures.
### Fix Focus Areas
- src/driver/sap/SapDriver.ts[889-908]
### Suggested approach
- Detect `(this.options as any).hanaClientDriver` at runtime.
- Either:
- Throw a clear error: "`hanaClientDriver` was removed; use `driver` instead", OR
- Temporarily support it with `const client = this.options.driver ?? (this.options as any).hanaClientDriver` and log a one-time deprecation warning.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


17. Undocumented hanaClientDriver removal 📘 Rule violation ✓ Correctness
Description
The PR removes previously-supported (even if deprecated) SAP driver options and fallback behavior
without any accompanying documentation updates. This can break existing configurations and leaves
users without guidance on required migration changes.
Code

src/driver/sap/SapDataSourceOptions.ts[L25-28]

-    /**
-     * @deprecated Use {@link driver} instead.
-     */
-    readonly hanaClientDriver?: any
Evidence
Compliance requires documentation updates for user-facing API/usage changes. The diff removes
hanaClientDriver and multiple pool option properties, and also removes the runtime fallback that
previously accepted hanaClientDriver, but no docs changes are included and the PR checklist
indicates docs were not updated.

Rule 2: Docs updated for user-facing changes
src/driver/sap/SapDataSourceOptions.ts[25-28]
src/driver/sap/SapDriver.ts[887-890]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
This PR removes user-facing (deprecated but supported) SAP configuration options and fallback behavior, but does not update documentation to tell users how to migrate.
## Issue Context
`hanaClientDriver` and multiple pool options were removed from the public options interface and the driver no longer falls back to `hanaClientDriver` at runtime. Users need explicit migration guidance.
## Fix Focus Areas
- src/driver/sap/SapDataSourceOptions.ts[25-28]
- src/driver/sap/SapDriver.ts[887-890]】【”】【}}]}

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


18. Legacy pool config ignored 🐞 Bug ⛯ Reliability
Description
SapDriver no longer maps legacy pool option names (e.g., pool.max, pool.requestTimeout,
pool.idleTimeout) into the SAP HANA client pool options. Because ormconfig-loaded options are not
schema-validated, these legacy keys can still be present at runtime and will now be silently
ignored, changing pool limits/timeouts without any warning.
Code

src/driver/sap/SapDriver.ts[R280-288]

     const poolOptions: any = {
         maxConnectedOrPooled:
             this.options.pool?.maxConnectedOrPooled ??
-                this.options.pool?.max ??
             this.options.poolSize ??
             10,
-            maxPooledIdleTime:
-                this.options.pool?.maxPooledIdleTime ??
-                (this.options.pool?.idleTimeout
-                    ? this.options.pool.idleTimeout / 1000
-                    : 30),
+            maxPooledIdleTime: this.options.pool?.maxPooledIdleTime ?? 30,
         maxWaitTimeoutIfPoolExhausted:
-                this.options.pool?.maxWaitTimeoutIfPoolExhausted ??
-                this.options.pool?.requestTimeout ??
-                0,
+                this.options.pool?.maxWaitTimeoutIfPoolExhausted ?? 0,
     }
Evidence
SapDriver only reads the new pool option names when building poolOptions. Separately,
ConnectionOptionsReader loads and returns configuration objects from ormconfig (js/json/env) and
does not strip unknown properties during normalization, meaning legacy keys can still be present at
runtime but will have no effect.

src/driver/sap/SapDriver.ts[279-288]
src/connection/ConnectionOptionsReader.ts[94-204]
src/connection/ConnectionOptionsReader.ts[210-276]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
SapDriver no longer reads deprecated SAP pool option keys, but runtime-loaded configs (ormconfig js/json/env) can still contain those keys. This results in silent misconfiguration (pool limits/timeouts not applied).
### Issue Context
TypeORM loads ormconfig objects without schema validation and does not remove unknown properties. If an app still uses legacy keys, SapDriver will ignore them and use defaults.
### Fix Focus Areas
- src/driver/sap/SapDriver.ts[279-295]
- src/connection/ConnectionOptionsReader.ts[94-205]
- src/connection/ConnectionOptionsReader.ts[210-276]
- docs/docs/guides/8-migration-v1.md[61-80]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

19. Custom driver breaks stream 🐞 Bug ✓ Correctness
Description
When a custom SAP client is supplied via options.driver, loadDependencies() returns early
without initializing streamClient, but SapQueryRunner.stream() unconditionally calls
this.driver.streamClient.createObjectStream(...), which can crash at runtime.
Code

src/driver/sap/SapDriver.ts[R889-893]

  protected loadDependencies(): void {
-        const client = this.options.driver ?? this.options.hanaClientDriver
+        const client = this.options.driver
      if (client) {
          this.client = client
Evidence
streamClient is only assigned in the PlatformTools.load() path (when options.driver is not
provided). However, streaming queries always assume driver.streamClient is defined and do not
guard against it being undefined.

src/driver/sap/SapDriver.ts[889-902]
src/driver/sap/SapQueryRunner.ts[371-382]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Providing a custom SAP client via `options.driver` skips `streamClient` initialization, but streaming queries require it, leading to a runtime crash.
### Issue Context
This PR makes `driver` the only documented injection mechanism, so the `driver` path should be fully functional (including streaming) or fail with a clear message.
### Fix Focus Areas
- src/driver/sap/SapDriver.ts[889-902]
- src/driver/sap/SapQueryRunner.ts[371-382]
### Suggested approach
- In `loadDependencies()`, if `options.driver` is provided, still attempt to initialize `this.streamClient` (e.g., `PlatformTools.load("@sap/hana-client/extension/Stream")`) unless already set.
- Additionally, in `SapQueryRunner.stream()`, add a guard:
- if `!this.driver.streamClient`, throw a descriptive error telling users streaming requires the Stream extension / proper initialization.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


20. Custom driver breaks stream 🐞 Bug ✓ Correctness
Description
When a custom SAP client is supplied via options.driver, loadDependencies() returns early
without initializing streamClient, but SapQueryRunner.stream() unconditionally calls
this.driver.streamClient.createObjectStream(...), which can crash at runtime.
Code

src/driver/sap/SapDriver.ts[R889-893]

 protected loadDependencies(): void {
-        const client = this.options.driver ?? this.options.hanaClientDriver
+        const client = this.options.driver
     if (client) {
         this.client = client
Evidence
streamClient is only assigned in the PlatformTools.load() path (when options.driver is not
provided). However, streaming queries always assume driver.streamClient is defined and do not
guard against it being undefined.

src/driver/sap/SapDriver.ts[889-902]
src/driver/sap/SapQueryRunner.ts[371-382]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Providing a custom SAP client via `options.driver` skips `streamClient` initialization, but streaming queries require it, leading to a runtime crash.
### Issue Context
This PR makes `driver` the only documented injection mechanism, so the `driver` path should be fully functional (including streaming) or fail with a clear message.
### Fix Focus Areas
- src/driver/sap/SapDriver.ts[889-902]
- src/driver/sap/SapQueryRunner.ts[371-382]
### Suggested approach
- In `loadDependencies()`, if `options.driver` is provided, still attempt to initialize `this.streamClient` (e.g., `PlatformTools.load("@sap/hana-client/extension/Stream")`) unless already set.
- Additionally, in `SapQueryRunner.stream()`, add a guard:
- if `!this.driver.streamClient`, throw a descriptive error telling users streaming requires the Stream extension / proper initialization.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


21. Custom driver breaks stream 🐞 Bug ✓ Correctness
Description
When a custom SAP client is supplied via options.driver, loadDependencies() returns early
without initializing streamClient, but SapQueryRunner.stream() unconditionally calls
this.driver.streamClient.createObjectStream(...), which can crash at runtime.
Code

src/driver/sap/SapDriver.ts[R889-893]

   protected loadDependencies(): void {
-        const client = this.options.driver ?? this.options.hanaClientDriver
+        const client = this.options.driver
       if (client) {
           this.client = client
Evidence
streamClient is only assigned in the PlatformTools.load() path (when options.driver is not
provided). However, streaming queries always assume driver.streamClient is defined and do not
guard against it being undefined.

src/driver/sap/SapDriver.ts[889-902]
src/driver/sap/SapQueryRunner.ts[371-382]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Providing a custom SAP client via `options.driver` skips `streamClient` initialization, but streaming queries require it, leading to a runtime crash.
### Issue Context
This PR makes `driver` the only documented injection mechanism, so the `driver` path should be fully functional (including streaming) or fail with a clear message.
### Fix Focus Areas
- src/driver/sap/SapDriver.ts[889-902]
- src/driver/sap/SapQueryRunner.ts[371-382]
### Suggested approach
- In `loadDependencies()`, if `options.driver` is provided, still attempt to initialize `this.streamClient` (e.g., `PlatformTools.load("@sap/hana-client/extension/Stream")`) unless already set.
- Additionally, in `SapQueryRunner.stream()`, add a guard:
- if `!this.driver.streamClient`, throw a descriptive error telling users streaming requires the Stream extension / proper initialization.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View more (1)
22. Custom driver breaks stream 🐞 Bug ✓ Correctness
Description
When a custom SAP client is supplied via options.driver, loadDependencies() returns early
without initializing streamClient, but SapQueryRunner.stream() unconditionally calls
this.driver.streamClient.createObjectStream(...), which can crash at runtime.
Code

[src/driver/sap/SapDriver.ts[R889-893]](https://github.com/typeorm/typeorm/pull/12080/files#diff-a29f961f9e01ed...

@qodo-free-for-open-source-projects
Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (3) 📘 Rule violations (1) 📎 Requirement gaps (0)

Grey Divider


Action required

1. hanaClientDriver fallback removed 🐞 Bug ⛯ Reliability ⭐ New
Description
loadDependencies() now only checks options.driver, so projects still using the deprecated
hanaClientDriver option will have their provided client ignored and may throw
DriverPackageNotInstalledError if @sap/hana-client isn’t installed.
Code

src/driver/sap/SapDriver.ts[R890-893]

+        const client = this.options.driver
        if (client) {
            this.client = client
Evidence
The driver injection path now exclusively uses options.driver and the SAP options interface no
longer includes hanaClientDriver, meaning older configuration will no longer inject a client. When
driver is absent, loadDependencies() falls back to loading @sap/hana-client, which fails if
the package isn’t installed.

src/driver/sap/SapDriver.ts[889-908]
src/driver/sap/SapDataSourceOptions.ts[19-24]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
Older configs using the deprecated `hanaClientDriver` will no longer inject their provided driver, and may unexpectedly attempt to require `@sap/hana-client`.

### Issue Context
Even if TypeScript types no longer include `hanaClientDriver`, runtime configs (JS users, `as any`, env-based config readers) may still pass it. Silent ignore + fallback-to-require can cause confusing production failures.

### Fix Focus Areas
- src/driver/sap/SapDriver.ts[889-908]

### Suggested approach
- Detect `(this.options as any).hanaClientDriver` at runtime.
- Either:
 - Throw a clear error: "`hanaClientDriver` was removed; use `driver` instead", OR
 - Temporarily support it with `const client = this.options.driver ?? (this.options as any).hanaClientDriver` and log a one-time deprecation warning.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Undocumented hanaClientDriver removal 📘 Rule violation ✓ Correctness
Description
The PR removes previously-supported (even if deprecated) SAP driver options and fallback behavior
without any accompanying documentation updates. This can break existing configurations and leaves
users without guidance on required migration changes.
Code

src/driver/sap/SapDataSourceOptions.ts[L25-28]

-    /**
-     * @deprecated Use {@link driver} instead.
-     */
-    readonly hanaClientDriver?: any
Evidence
Compliance requires documentation updates for user-facing API/usage changes. The diff removes
hanaClientDriver and multiple pool option properties, and also removes the runtime fallback that
previously accepted hanaClientDriver, but no docs changes are included and the PR checklist
indicates docs were not updated.

Rule 2: Docs updated for user-facing changes
src/driver/sap/SapDataSourceOptions.ts[25-28]
src/driver/sap/SapDriver.ts[887-890]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
This PR removes user-facing (deprecated but supported) SAP configuration options and fallback behavior, but does not update documentation to tell users how to migrate.
## Issue Context
`hanaClientDriver` and multiple pool options were removed from the public options interface and the driver no longer falls back to `hanaClientDriver` at runtime. Users need explicit migration guidance.
## Fix Focus Areas
- src/driver/sap/SapDataSourceOptions.ts[25-28]
- src/driver/sap/SapDriver.ts[887-890]】【”】【}}]}

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Legacy pool config ignored 🐞 Bug ⛯ Reliability
Description
SapDriver no longer maps legacy pool option names (e.g., pool.max, pool.requestTimeout,
pool.idleTimeout) into the SAP HANA client pool options. Because ormconfig-loaded options are not
schema-validated, these legacy keys can still be present at runtime and will now be silently
ignored, changing pool limits/timeouts without any warning.
Code

src/driver/sap/SapDriver.ts[R280-288]

       const poolOptions: any = {
           maxConnectedOrPooled:
               this.options.pool?.maxConnectedOrPooled ??
-                this.options.pool?.max ??
               this.options.poolSize ??
               10,
-            maxPooledIdleTime:
-                this.options.pool?.maxPooledIdleTime ??
-                (this.options.pool?.idleTimeout
-                    ? this.options.pool.idleTimeout / 1000
-                    : 30),
+            maxPooledIdleTime: this.options.pool?.maxPooledIdleTime ?? 30,
           maxWaitTimeoutIfPoolExhausted:
-                this.options.pool?.maxWaitTimeoutIfPoolExhausted ??
-                this.options.pool?.requestTimeout ??
-                0,
+                this.options.pool?.maxWaitTimeoutIfPoolExhausted ?? 0,
       }
Evidence
SapDriver only reads the new pool option names when building poolOptions. Separately,
ConnectionOptionsReader loads and returns configuration objects from ormconfig (js/json/env) and
does not strip unknown properties during normalization, meaning legacy keys can still be present at
runtime but will have no effect.

src/driver/sap/SapDriver.ts[279-288]
src/connection/ConnectionOptionsReader.ts[94-204]
src/connection/ConnectionOptionsReader.ts[210-276]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
SapDriver no longer reads deprecated SAP pool option keys, but runtime-loaded configs (ormconfig js/json/env) can still contain those keys. This results in silent misconfiguration (pool limits/timeouts not applied).
### Issue Context
TypeORM loads ormconfig objects without schema validation and does not remove unknown properties. If an app still uses legacy keys, SapDriver will ignore them and use defaults.
### Fix Focus Areas
- src/driver/sap/SapDriver.ts[279-295]
- src/connection/ConnectionOptionsReader.ts[94-205]
- src/connection/ConnectionOptionsReader.ts[210-276]
- docs/docs/guides/8-migration-v1.md[61-80]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

4. Custom driver breaks stream 🐞 Bug ✓ Correctness ⭐ New
Description
When a custom SAP client is supplied via options.driver, loadDependencies() returns early
without initializing streamClient, but SapQueryRunner.stream() unconditionally calls
this.driver.streamClient.createObjectStream(...), which can crash at runtime.
Code

src/driver/sap/SapDriver.ts[R889-893]

    protected loadDependencies(): void {
-        const client = this.options.driver ?? this.options.hanaClientDriver
+        const client = this.options.driver
        if (client) {
            this.client = client
Evidence
streamClient is only assigned in the PlatformTools.load() path (when options.driver is not
provided). However, streaming queries always assume driver.streamClient is defined and do not
guard against it being undefined.

src/driver/sap/SapDriver.ts[889-902]
src/driver/sap/SapQueryRunner.ts[371-382]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
Providing a custom SAP client via `options.driver` skips `streamClient` initialization, but streaming queries require it, leading to a runtime crash.

### Issue Context
This PR makes `driver` the only documented injection mechanism, so the `driver` path should be fully functional (including streaming) or fail with a clear message.

### Fix Focus Areas
- src/driver/sap/SapDriver.ts[889-902]
- src/driver/sap/SapQueryRunner.ts[371-382]

### Suggested approach
- In `loadDependencies()`, if `options.driver` is provided, still attempt to initialize `this.streamClient` (e.g., `PlatformTools.load("@sap/hana-client/extension/Stream")`) unless already set.
- Additionally, in `SapQueryRunner.stream()`, add a guard:
 - if `!this.driver.streamClient`, throw a descriptive error telling users streaming requires the Stream extension / proper initialization.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@qodo-free-for-open-source-projects
Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@gioboa gioboa changed the title chore: remove SapConnectionOptions' deprecated properties refactor: remove SapConnectionOptions' deprecated properties Mar 4, 2026
@qodo-free-for-open-source-projects
Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (5) 📘 Rule violations (2) 📎 Requirement gaps (0)

Grey Divider


Action required

1. Undocumented hanaClientDriver removal 📘 Rule violation ✓ Correctness
Description
The PR removes previously-supported (even if deprecated) SAP driver options and fallback behavior
without any accompanying documentation updates. This can break existing configurations and leaves
users without guidance on required migration changes.
Code

src/driver/sap/SapDataSourceOptions.ts[L25-28]

-    /**
-     * @deprecated Use {@link driver} instead.
-     */
-    readonly hanaClientDriver?: any
Evidence
Compliance requires documentation updates for user-facing API/usage changes. The diff removes
hanaClientDriver and multiple pool option properties, and also removes the runtime fallback that
previously accepted hanaClientDriver, but no docs changes are included and the PR checklist
indicates docs were not updated.

Rule 2: Docs updated for user-facing changes
src/driver/sap/SapDataSourceOptions.ts[25-28]
src/driver/sap/SapDriver.ts[887-890]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
This PR removes user-facing (deprecated but supported) SAP configuration options and fallback behavior, but does not update documentation to tell users how to migrate.
## Issue Context
`hanaClientDriver` and multiple pool options were removed from the public options interface and the driver no longer falls back to `hanaClientDriver` at runtime. Users need explicit migration guidance.
## Fix Focus Areas
- src/driver/sap/SapDataSourceOptions.ts[25-28]
- src/driver/sap/SapDriver.ts[887-890]】【”】【}}]}

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Legacy pool config ignored 🐞 Bug ⛯ Reliability
Description
SapDriver no longer maps legacy pool option names (e.g., pool.max, pool.requestTimeout,
pool.idleTimeout) into the SAP HANA client pool options. Because ormconfig-loaded options are not
schema-validated, these legacy keys can still be present at runtime and will now be silently
ignored, changing pool limits/timeouts without any warning.
Code

src/driver/sap/SapDriver.ts[R280-288]

       const poolOptions: any = {
           maxConnectedOrPooled:
               this.options.pool?.maxConnectedOrPooled ??
-                this.options.pool?.max ??
               this.options.poolSize ??
               10,
-            maxPooledIdleTime:
-                this.options.pool?.maxPooledIdleTime ??
-                (this.options.pool?.idleTimeout
-                    ? this.options.pool.idleTimeout / 1000
-                    : 30),
+            maxPooledIdleTime: this.options.pool?.maxPooledIdleTime ?? 30,
           maxWaitTimeoutIfPoolExhausted:
-                this.options.pool?.maxWaitTimeoutIfPoolExhausted ??
-                this.options.pool?.requestTimeout ??
-                0,
+                this.options.pool?.maxWaitTimeoutIfPoolExhausted ?? 0,
       }
Evidence
SapDriver only reads the new pool option names when building poolOptions. Separately,
ConnectionOptionsReader loads and returns configuration objects from ormconfig (js/json/env) and
does not strip unknown properties during normalization, meaning legacy keys can still be present at
runtime but will have no effect.

src/driver/sap/SapDriver.ts[279-288]
src/connection/ConnectionOptionsReader.ts[94-204]
src/connection/ConnectionOptionsReader.ts[210-276]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
SapDriver no longer reads deprecated SAP pool option keys, but runtime-loaded configs (ormconfig js/json/env) can still contain those keys. This results in silent misconfiguration (pool limits/timeouts not applied).
### Issue Context
TypeORM loads ormconfig objects without schema validation and does not remove unknown properties. If an app still uses legacy keys, SapDriver will ignore them and use defaults.
### Fix Focus Areas
- src/driver/sap/SapDriver.ts[279-295]
- src/connection/ConnectionOptionsReader.ts[94-205]
- src/connection/ConnectionOptionsReader.ts[210-276]
- docs/docs/guides/8-migration-v1.md[61-80]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. hanaClientDriver fallback removed 🐞 Bug ⛯ Reliability
Description
loadDependencies() now only checks options.driver, so projects still using the deprecated
hanaClientDriver option will have their provided client ignored and may throw
DriverPackageNotInstalledError if @sap/hana-client isn’t installed.
Code

src/driver/sap/SapDriver.ts[R890-893]

+        const client = this.options.driver
       if (client) {
           this.client = client
Evidence
The driver injection path now exclusively uses options.driver and the SAP options interface no
longer includes hanaClientDriver, meaning older configuration will no longer inject a client. When
driver is absent, loadDependencies() falls back to loading @sap/hana-client, which fails if
the package isn’t installed.

src/driver/sap/SapDriver.ts[889-908]
src/driver/sap/SapDataSourceOptions.ts[19-24]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Older configs using the deprecated `hanaClientDriver` will no longer inject their provided driver, and may unexpectedly attempt to require `@sap/hana-client`.
### Issue Context
Even if TypeScript types no longer include `hanaClientDriver`, runtime configs (JS users, `as any`, env-based config readers) may still pass it. Silent ignore + fallback-to-require can cause confusing production failures.
### Fix Focus Areas
- src/driver/sap/SapDriver.ts[889-908]
### Suggested approach
- Detect `(this.options as any).hanaClientDriver` at runtime.
- Either:
- Throw a clear error: "`hanaClientDriver` was removed; use `driver` instead", OR
- Temporarily support it with `const client = this.options.driver ?? (this.options as any).hanaClientDriver` and log a one-time deprecation warning.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View more (2)
4. Undocumented hanaClientDriver removal 📘 Rule violation ✓ Correctness
Description
The PR removes previously-supported (even if deprecated) SAP driver options and fallback behavior
without any accompanying documentation updates. This can break existing configurations and leaves
users without guidance on required migration changes.
Code

src/driver/sap/SapDataSourceOptions.ts[L25-28]

-    /**
-     * @deprecated Use {@link driver} instead.
-     */
-    readonly hanaClientDriver?: any
Evidence
Compliance requires documentation updates for user-facing API/usage changes. The diff removes
hanaClientDriver and multiple pool option properties, and also removes the runtime fallback that
previously accepted hanaClientDriver, but no docs changes are included and the PR checklist
indicates docs were not updated.

Rule 2: Docs updated for user-facing changes
src/driver/sap/SapDataSourceOptions.ts[25-28]
src/driver/sap/SapDriver.ts[887-890]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
This PR removes user-facing (deprecated but supported) SAP configuration options and fallback behavior, but does not update documentation to tell users how to migrate.
## Issue Context
`hanaClientDriver` and multiple pool options were removed from the public options interface and the driver no longer falls back to `hanaClientDriver` at runtime. Users need explicit migration guidance.
## Fix Focus Areas
- src/driver/sap/SapDataSourceOptions.ts[25-28]
- src/driver/sap/SapDriver.ts[887-890]】【”】【}}]}

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. Legacy pool config ignored 🐞 Bug ⛯ Reliability
Description
SapDriver no longer maps legacy pool option names (e.g., pool.max, pool.requestTimeout,
pool.idleTimeout) into the SAP HANA client pool options. Because ormconfig-loaded options are not
schema-validated, these legacy keys can still be present at runtime and will now be silently
ignored, changing pool limits/timeouts without any warning.
Code

src/driver/sap/SapDriver.ts[R280-288]

      const poolOptions: any = {
          maxConnectedOrPooled:
              this.options.pool?.maxConnectedOrPooled ??
-                this.options.pool?.max ??
              this.options.poolSize ??
              10,
-            maxPooledIdleTime:
-                this.options.pool?.maxPooledIdleTime ??
-                (this.options.pool?.idleTimeout
-                    ? this.options.pool.idleTimeout / 1000
-                    : 30),
+            maxPooledIdleTime: this.options.pool?.maxPooledIdleTime ?? 30,
          maxWaitTimeoutIfPoolExhausted:
-                this.options.pool?.maxWaitTimeoutIfPoolExhausted ??
-                this.options.pool?.requestTimeout ??
-                0,
+                this.options.pool?.maxWaitTimeoutIfPoolExhausted ?? 0,
      }
Evidence
SapDriver only reads the new pool option names when building poolOptions. Separately,
ConnectionOptionsReader loads and returns configuration objects from ormconfig (js/json/env) and
does not strip unknown properties during normalization, meaning legacy keys can still be present at
runtime but will have no effect.

src/driver/sap/SapDriver.ts[279-288]
src/connection/ConnectionOptionsReader.ts[94-204]
src/connection/ConnectionOptionsReader.ts[210-276]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
SapDriver no longer reads deprecated SAP pool option keys, but runtime-loaded configs (ormconfig js/json/env) can still contain those keys. This results in silent misconfiguration (pool limits/timeouts not applied).
### Issue Context
TypeORM loads ormconfig objects without schema validation and does not remove unknown properties. If an app still uses legacy keys, SapDriver will ignore them and use defaults.
### Fix Focus Areas
- src/driver/sap/SapDriver.ts[279-295]
- src/connection/ConnectionOptionsReader.ts[94-205]
- src/connection/ConnectionOptionsReader.ts[210-276]
- docs/docs/guides/8-migration-v1.md[61-80]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

6. Custom driver breaks stream 🐞 Bug ✓ Correctness
Description
When a custom SAP client is supplied via options.driver, loadDependencies() returns early
without initializing streamClient, but SapQueryRunner.stream() unconditionally calls
this.driver.streamClient.createObjectStream(...), which can crash at runtime.
Code

src/driver/sap/SapDriver.ts[R889-893]

   protected loadDependencies(): void {
-        const client = this.options.driver ?? this.options.hanaClientDriver
+        const client = this.options.driver
       if (client) {
           this.client = client
Evidence
streamClient is only assigned in the PlatformTools.load() path (when options.driver is not
provided). However, streaming queries always assume driver.streamClient is defined and do not
guard against it being undefined.

src/driver/sap/SapDriver.ts[889-902]
src/driver/sap/SapQueryRunner.ts[371-382]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Providing a custom SAP client via `options.driver` skips `streamClient` initialization, but streaming queries require it, leading to a runtime crash.
### Issue Context
This PR makes `driver` the only documented injection mechanism, so the `driver` path should be fully functional (including streaming) or fail with a clear message.
### Fix Focus Areas
- src/driver/sap/SapDriver.ts[889-902]
- src/driver/sap/SapQueryRunner.ts[371-382]
### Suggested approach
- In `loadDependencies()`, if `options.driver` is provided, still attempt to initialize `this.streamClient` (e.g., `PlatformTools.load("@sap/hana-client/extension/Stream")`) unless already set.
- Additionally, in `SapQueryRunner.stream()`, add a guard:
- if `!this.driver.streamClient`, throw a descriptive error telling users streaming requires the Stream extension / proper initialization.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Advisory comments

7. Docs: poolSize fallback 🐞 Bug ✧ Quality ⭐ New
Description
SAP docs describe pool.maxConnectedOrPooled defaults but don’t mention that the common poolSize
option also affects SAP via fallback logic. Consider adding a short note documenting the precedence
(pool.maxConnectedOrPooledpoolSize10).
Code

docs/docs/drivers/sap.md[R25-31]

+- `driver` - Optional explicit `@sap/hana-client` module instance. If omitted, TypeORM loads `@sap/hana-client` automatically.
- `pool` — Connection pool configuration object:
    - `maxConnectedOrPooled` (number) — Max active or idle connections in the pool (default: 10).
    - `maxPooledIdleTime` (seconds) — Time before an idle connection is closed (default: 30).
    - `maxWaitTimeoutIfPoolExhausted` (milliseconds) - Time to wait for a connection to become available (default: 0, no wait). Requires `@sap/hana-client` version `2.27` or later.
    - `pingCheck` (boolean) — Whether to validate connections before use (default: false).
    - `poolCapacity` (number) — Maximum number of connections to be kept available (default: no limit).
Evidence
The SAP driver uses poolSize (from BaseDataSourceOptions) as a fallback when
pool.maxConnectedOrPooled is not set, but the SAP driver docs only list the SAP-specific pool
settings and their defaults.

src/driver/sap/SapDriver.ts[280-285]
src/data-source/BaseDataSourceOptions.ts[89-92]
docs/docs/drivers/sap.md[26-31]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
SAP HANA docs don’t mention that the common `poolSize` option still influences SAP pool sizing via fallback logic, which can surprise users when comparing docs to runtime behavior.

## Issue Context
`poolSize` is defined in `BaseDataSourceOptions` and is used by multiple drivers; SAP additionally supports a dedicated `pool` config.

## Fix Focus Areas
- docs/docs/drivers/sap.md[17-35]
- src/driver/sap/SapDriver.ts[279-288]
- src/data-source/BaseDataSourceOptions.ts[89-93]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@qodo-free-for-open-source-projects
Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@alumni alumni changed the title refactor: remove SapConnectionOptions' deprecated properties refactor(sap)!: remove SapConnectionOptions' deprecated properties Mar 4, 2026
Copy link
Copy Markdown
Member

@pkuczynski pkuczynski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small docs change requested...

@gioboa gioboa merged commit daeeba1 into typeorm:master Mar 4, 2026
61 checks passed
@gioboa gioboa deleted the fix/12079 branch March 5, 2026 10:09
@pkuczynski pkuczynski added this to the 1.0 milestone Mar 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Remove SapConnectionOptions / SapDriver deprecated properties. (XS)

3 participants