You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove the deprecated name property from DataSource and BaseDataSourceOptions. Rename ConnectionOptionsReader.all() to get() and remove the old get(name) and has(name) methods that relied on named connections.
Remove deprecated DataSource.name and simplify ConnectionOptionsReader API
✨ Enhancement
Walkthroughs
Description
• Remove deprecated name property from DataSource and BaseDataSourceOptions
• Rename ConnectionOptionsReader.all() to get() and remove named connection methods
• Update error classes to remove connection name parameter
• Replace dataSource.name references with dataSource.options.type in tests
• Simplify configuration files by removing name field from all examples
Diagram
flowchart LR
A["DataSource with name property"] -->|Remove deprecated name| B["DataSource without name"]
C["ConnectionOptionsReader.all()"] -->|Rename to get| D["ConnectionOptionsReader.get()"]
E["get(name) and has(name) methods"] -->|Remove| F["Simplified API"]
G["Error classes with connectionName"] -->|Remove parameter| H["Generic error messages"]
ConnectionOptionsReader.normalizeConnectionOptions computes absolute
entities/subscribers/migrations paths but assigns them to the options array object instead of
the per-DataSourceOptions entry, so consumers still receive unnormalized relative globs and class
discovery can fail when the working directory differs from the config root.
+ async get(): Promise<DataSourceOptions[]> {
const options = await this.load()
if (!options)
throw new TypeORMError(
Evidence
After this PR, ConnectionOptionsReader.get() is the sole public API for reading all configs, and
it returns the result of load()/normalizeConnectionOptions(). However,
normalizeConnectionOptions() uses Object.assign(connectionOptions, …) (where connectionOptions
is an array) rather than mutating the current options element, so the normalized arrays are not
applied to each returned config. Downstream, entity/migration/subscriber directories are consumed
as-is and globbed without resolving relative paths, making relative patterns depend on
process.cwd() rather than the config’s root/base directory.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
`ConnectionOptionsReader.normalizeConnectionOptions()` computes normalized `entities` / `subscribers` / `migrations` arrays (prefixing `baseDirectory`), but it assigns them to the `connectionOptions` array object rather than to the current `options` element.
As a result, callers of `ConnectionOptionsReader.get()` receive configs whose `entities`/`subscribers`/`migrations` remain unnormalized relative globs, which can break class discovery when `process.cwd()` is not the same as the config root.
### Issue Context
The normalization logic already correctly mutates `options.database` for sqlite, so this appears to be an inconsistent assignment target for the list-based fields.
### Fix Focus Areas
- src/connection/ConnectionOptionsReader.ts[146-187]
### Suggested change
- Replace:
- `Object.assign(connectionOptions, { entities })`
- `Object.assign(connectionOptions, { subscribers })`
- `Object.assign(connectionOptions, { migrations })`
- With per-option mutation, e.g.:
- `Object.assign(options, { entities })` (or `options.entities = entities`)
- `Object.assign(options, { subscribers })`
- `Object.assign(options, { migrations })`
Add/adjust a unit test where `ConnectionOptionsReader` is constructed with `root: &amp;amp;lt;non-cwd&amp;amp;gt;` and config uses relative `entities` glob strings, asserting the returned option’s `entities` entries are prefixed with that root.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
2. Config paths not applied 🐞 Bug✓ Correctness
Description
ConnectionOptionsReader.normalizeConnectionOptions computes absolute
entities/subscribers/migrations paths but assigns them to the options array object instead of
the per-DataSourceOptions entry, so consumers still receive unnormalized relative globs and class
discovery can fail when the working directory differs from the config root.
+ async get(): Promise<DataSourceOptions[]> {
const options = await this.load()
if (!options)
throw new TypeORMError(
Evidence
After this PR, ConnectionOptionsReader.get() is the sole public API for reading all configs, and
it returns the result of load()/normalizeConnectionOptions(). However,
normalizeConnectionOptions() uses Object.assign(connectionOptions, …) (where connectionOptions
is an array) rather than mutating the current options element, so the normalized arrays are not
applied to each returned config. Downstream, entity/migration/subscriber directories are consumed
as-is and globbed without resolving relative paths, making relative patterns depend on
process.cwd() rather than the config’s root/base directory.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
`ConnectionOptionsReader.normalizeConnectionOptions()` computes normalized `entities` / `subscribers` / `migrations` arrays (prefixing `baseDirectory`), but it assigns them to the `connectionOptions` array object rather than to the current `options` element.
As a result, callers of `ConnectionOptionsReader.get()` receive configs whose `entities`/`subscribers`/`migrations` remain unnormalized relative globs, which can break class discovery when `process.cwd()` is not the same as the config root.
### Issue Context
The normalization logic already correctly mutates `options.database` for sqlite, so this appears to be an inconsistent assignment target for the list-based fields.
### Fix Focus Areas
- src/connection/ConnectionOptionsReader.ts[146-187]
### Suggested change
- Replace:
- `Object.assign(connectionOptions, { entities })`
- `Object.assign(connectionOptions, { subscribers })`
- `Object.assign(connectionOptions, { migrations })`
- With per-option mutation, e.g.:
- `Object.assign(options, { entities })` (or `options.entities = entities`)
- `Object.assign(options, { subscribers })`
- `Object.assign(options, { migrations })`
Add/adjust a unit test where `ConnectionOptionsReader` is constructed with `root: &amp;lt;non-cwd&amp;gt;` and config uses relative `entities` glob strings, asserting the returned option’s `entities` entries are prefixed with that root.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
3. Config paths not applied 🐞 Bug✓ Correctness
Description
ConnectionOptionsReader.normalizeConnectionOptions computes absolute
entities/subscribers/migrations paths but assigns them to the options array object instead of
the per-DataSourceOptions entry, so consumers still receive unnormalized relative globs and class
discovery can fail when the working directory differs from the config root.
+ async get(): Promise<DataSourceOptions[]> {
const options = await this.load()
if (!options)
throw new TypeORMError(
Evidence
After this PR, ConnectionOptionsReader.get() is the sole public API for reading all configs, and
it returns the result of load()/normalizeConnectionOptions(). However,
normalizeConnectionOptions() uses Object.assign(connectionOptions, …) (where connectionOptions
is an array) rather than mutating the current options element, so the normalized arrays are not
applied to each returned config. Downstream, entity/migration/subscriber directories are consumed
as-is and globbed without resolving relative paths, making relative patterns depend on
process.cwd() rather than the config’s root/base directory.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
`ConnectionOptionsReader.normalizeConnectionOptions()` computes normalized `entities` / `subscribers` / `migrations` arrays (prefixing `baseDirectory`), but it assigns them to the `connectionOptions` array object rather than to the current `options` element.
As a result, callers of `ConnectionOptionsReader.get()` receive configs whose `entities`/`subscribers`/`migrations` remain unnormalized relative globs, which can break class discovery when `process.cwd()` is not the same as the config root.
### Issue Context
The normalization logic already correctly mutates `options.database` for sqlite, so this appears to be an inconsistent assignment target for the list-based fields.
### Fix Focus Areas
- src/connection/ConnectionOptionsReader.ts[146-187]
### Suggested change
- Replace:
- `Object.assign(connectionOptions, { entities })`
- `Object.assign(connectionOptions, { subscribers })`
- `Object.assign(connectionOptions, { migrations })`
- With per-option mutation, e.g.:
- `Object.assign(options, { entities })` (or `options.entities = entities`)
- `Object.assign(options, { subscribers })`
- `Object.assign(options, { migrations })`
Add/adjust a unit test where `ConnectionOptionsReader` is constructed with `root: &lt;non-cwd&gt;` and config uses relative `entities` glob strings, asserting the returned option’s `entities` entries are prefixed with that root.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
View more (1) 4. Config paths not applied 🐞 Bug✓ Correctness
Description
ConnectionOptionsReader.normalizeConnectionOptions computes absolute
entities/subscribers/migrations paths but assigns them to the options array object instead of
the per-DataSourceOptions entry, so consumers still receive unnormalized relative globs and class
discovery can fail when the working directory differs from the config root.
+ async get(): Promise<DataSourceOptions[]> {
const options = await this.load()
if (!options)
throw new TypeORMError(
Evidence
After this PR, ConnectionOptionsReader.get() is the sole public API for reading all configs, and
it returns the result of load()/normalizeConnectionOptions(). However,
normalizeConnectionOptions() uses Object.assign(connectionOptions, …) (where connectionOptions
is an array) rather than mutating the current options element, so the normalized arrays are not
applied to each returned config. Downstream, entity/migration/subscriber directories are consumed
as-is and globbed without resolving relative paths, making relative patterns depend on
process.cwd() rather than the config’s root/base directory.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
`ConnectionOptionsReader.normalizeConnectionOptions()` computes normalized `entities` / `subscribers` / `migrations` arrays (prefixing `baseDirectory`), but it assigns them to the `connectionOptions` array object rather than to the current `options` element.
As a result, callers of `ConnectionOptionsReader.get()` receive configs whose `entities`/`subscribers`/`migrations` remain unnormalized relative globs, which can break class discovery when `process.cwd()` is not the same as the config root.
### Issue Context
The normalization logic already correctly mutates `options.database` for sqlite, so this appears to be an inconsistent assignment target for the list-based fields.
### Fix Focus Areas
- src/connection/ConnectionOptionsReader.ts[146-187]
### Suggested change
- Replace:
- `Object.assign(connectionOptions, { entities })`
- `Object.assign(connectionOptions, { subscribers })`
- `Object.assign(connectionOptions, { migrations })`
- With per-option mutation, e.g.:
- `Object.assign(options, { entities })` (or `options.entities = entities`)
- `Object.assign(options, { subscribers })`
- `Object.assign(options, { migrations })`
Add/adjust a unit test where `ConnectionOptionsReader` is constructed with `root: &amp;lt;non-cwd&amp;gt;` and config uses relative `entities` glob strings, asserting the returned option’s `entities` entries are prefixed with that root.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
5. Reader.get arg not rejected 🐞 Bug⛯ Reliability⭐ New
Description
ConnectionOptionsReader.get() no longer accepts a connection name but also does not validate
unexpected arguments, so legacy JS/any-typed callers can still pass a name and receive the full
options array, leading to wrong config selection or downstream runtime type errors. This is
especially likely during upgrades because get(name)/has(name) were removed and all() was renamed to
get().
+ async get(): Promise<DataSourceOptions[]> {
const options = await this.load()
if (!options)
throw new TypeORMError(
Evidence
The new get() implementation accepts no parameters and simply returns the loaded options array
without guarding against legacy calling patterns; the migration guide explicitly states
get(name)/has(name) were removed and all() renamed to get(), increasing the chance of accidental
misuse during upgrades.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
### Issue description
`ConnectionOptionsReader.get()` is now the only public method, but it does not guard against callers still passing a legacy `name` argument. In JS/any-typed usage this can lead to returning an array where a single options object was expected.
### Issue Context
The migration guide documents removal of `get(name)`/`has(name)` and rename of `all()` -> `get()`. Adding a runtime arity check provides a fast, actionable failure mode during upgrades.
### Fix Focus Areas
- src/connection/ConnectionOptionsReader.ts[37-48]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
6. Ambiguous config selection 🐞 Bug✓ Correctness
Description
The migration guide demonstrates selecting a specific ormconfig entry by o.type === "postgres",
but type is not guaranteed to be unique when multiple DataSources share the same driver. This can
lead users to inadvertently pick the wrong configuration and run operations (e.g., migrations)
against the wrong database/schema.
+// when you need a specific config from multiple data sources+const allOptions = await reader.get()+const postgresOptions = allOptions.find((o) => o.type === "postgres")+```
Evidence
The guide’s example selects a config by driver type only, but the repo itself contains scenarios
with multiple Postgres DataSources differentiated by schema, showing that type alone is
insufficient to identify a single config.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
The migration guide example suggests selecting a specific config from multiple ormconfig entries using only `o.type === &amp;quot;postgres&amp;quot;`, but `type` is not a unique identifier if multiple DataSources share the same driver.
## Issue Context
With named connections removed, docs should not imply that `type` is a safe replacement for `name` as a unique key.
## Fix Focus Areas
- docs/docs/guides/8-migration-v1.md[285-294]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
7. Ambiguous config selection 🐞 Bug✓ Correctness
Description
The migration guide demonstrates selecting a specific ormconfig entry by o.type === "postgres",
but type is not guaranteed to be unique when multiple DataSources share the same driver. This can
lead users to inadvertently pick the wrong configuration and run operations (e.g., migrations)
against the wrong database/schema.
+// when you need a specific config from multiple data sources+const allOptions = await reader.get()+const postgresOptions = allOptions.find((o) => o.type === "postgres")+```
Evidence
The guide’s example selects a config by driver type only, but the repo itself contains scenarios
with multiple Postgres DataSources differentiated by schema, showing that type alone is
insufficient to identify a single config.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
The migration guide example suggests selecting a specific config from multiple ormconfig entries using only `o.type === &amp;quot;postgres&amp;quot;`, but `type` is not a unique identifier if multiple DataSources share the same driver.
## Issue Context
With named connections removed, docs should not imply that `type` is a safe replacement for `name` as a unique key.
## Fix Focus Areas
- docs/docs/guides/8-migration-v1.md[285-294]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
View more (13) 8. Docs still use name 🐞 Bug✓ Correctness
Description
The logging guide still documents name inside DataSource options, but this PR removes name from
BaseDataSourceOptions and DataSource. Copying those snippets will fail TypeScript
excess-property checks and mislead users about the new API.
- /**- * Connection name. If connection name is not given then it will be called "default".- * Different connections must have different names.- * @deprecated- */- readonly name?: string
Evidence
The PR removes the name field from the public connection options types and from DataSource
itself, while the logging docs still present name as a valid option; meanwhile the migration guide
explicitly states name was removed, making the logging page inconsistent with the rest of the
docs.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
The docs page `docs/docs/advanced-topics/5-logging.md` still shows `name` in DataSource options, but `name` was removed from `BaseDataSourceOptions`/`DataSource` in this PR.
### Issue Context
This PR introduces a breaking change removing named connections; docs should not instruct users to set `name` anymore.
### Fix Focus Areas
- docs/docs/advanced-topics/5-logging.md[7-19]
- docs/docs/advanced-topics/5-logging.md[178-192]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
9. Ambiguous config selection 🐞 Bug✓ Correctness
Description
The migration guide demonstrates selecting a specific ormconfig entry by o.type === "postgres",
but type is not guaranteed to be unique when multiple DataSources share the same driver. This can
lead users to inadvertently pick the wrong configuration and run operations (e.g., migrations)
against the wrong database/schema.
+// when you need a specific config from multiple data sources+const allOptions = await reader.get()+const postgresOptions = allOptions.find((o) => o.type === "postgres")+```
Evidence
The guide’s example selects a config by driver type only, but the repo itself contains scenarios
with multiple Postgres DataSources differentiated by schema, showing that type alone is
insufficient to identify a single config.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
The migration guide example suggests selecting a specific config from multiple ormconfig entries using only `o.type === &amp;amp;quot;postgres&amp;amp;quot;`, but `type` is not a unique identifier if multiple DataSources share the same driver.
## Issue Context
With named connections removed, docs should not imply that `type` is a safe replacement for `name` as a unique key.
## Fix Focus Areas
- docs/docs/guides/8-migration-v1.md[285-294]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
10. Generic DataSource errors 🐞 Bug✓ Correctness
Description
After removing DataSource.name, the “already connected” / “not connected” errors no longer include
any identifier for which DataSource triggered the exception. In multi-DataSource apps/tests, this
makes failures harder to attribute without additional logging.
+ constructor() {
super(
- `Cannot execute operation on "${connectionName}" connection because connection is not yet established.`,+ `Cannot execute operation because connection is not yet established.`,
)
Evidence
The updated error classes now emit fully generic messages, and DataSource throws them without any
context; the repo also demonstrates multiple DataSources of the same type coexisting, where
contextual error messages would help.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
`CannotConnectAlreadyConnectedError` and `CannotExecuteNotConnectedError` are now fully generic and provide no context about which DataSource instance failed, which is less actionable in multi-DataSource applications.
## Issue Context
With `DataSource.name` removed, callers still benefit from an identifier derived from `DataSource.options` (e.g., type/database/schema/host/port).
## Fix Focus Areas
- src/error/CannotConnectAlreadyConnectedError.ts[6-11]
- src/error/CannotExecuteNotConnectedError.ts[6-11]
- src/data-source/DataSource.ts[234-236]
- src/data-source/DataSource.ts[277-279]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
11. Ambiguous config selection 🐞 Bug✓ Correctness
Description
The migration guide demonstrates selecting a specific ormconfig entry by o.type === "postgres",
but type is not guaranteed to be unique when multiple DataSources share the same driver. This can
lead users to inadvertently pick the wrong configuration and run operations (e.g., migrations)
against the wrong database/schema.
+// when you need a specific config from multiple data sources+const allOptions = await reader.get()+const postgresOptions = allOptions.find((o) => o.type === "postgres")+```
Evidence
The guide’s example selects a config by driver type only, but the repo itself contains scenarios
with multiple Postgres DataSources differentiated by schema, showing that type alone is
insufficient to identify a single config.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
The migration guide example suggests selecting a specific config from multiple ormconfig entries using only `o.type === &amp;quot;postgres&amp;quot;`, but `type` is not a unique identifier if multiple DataSources share the same driver.
## Issue Context
With named connections removed, docs should not imply that `type` is a safe replacement for `name` as a unique key.
## Fix Focus Areas
- docs/docs/guides/8-migration-v1.md[285-294]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
12. Generic DataSource errors 🐞 Bug✓ Correctness
Description
After removing DataSource.name, the “already connected” / “not connected” errors no longer include
any identifier for which DataSource triggered the exception. In multi-DataSource apps/tests, this
makes failures harder to attribute without additional logging.
+ constructor() {
super(
- `Cannot execute operation on "${connectionName}" connection because connection is not yet established.`,+ `Cannot execute operation because connection is not yet established.`,
)
Evidence
The updated error classes now emit fully generic messages, and DataSource throws them without any
context; the repo also demonstrates multiple DataSources of the same type coexisting, where
contextual error messages would help.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
`CannotConnectAlreadyConnectedError` and `CannotExecuteNotConnectedError` are now fully generic and provide no context about which DataSource instance failed, which is less actionable in multi-DataSource applications.
## Issue Context
With `DataSource.name` removed, callers still benefit from an identifier derived from `DataSource.options` (e.g., type/database/schema/host/port).
## Fix Focus Areas
- src/error/CannotConnectAlreadyConnectedError.ts[6-11]
- src/error/CannotExecuteNotConnectedError.ts[6-11]
- src/data-source/DataSource.ts[234-236]
- src/data-source/DataSource.ts[277-279]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
13. Ambiguous config selection 🐞 Bug✓ Correctness
Description
The migration guide demonstrates selecting a specific ormconfig entry by o.type === "postgres",
but type is not guaranteed to be unique when multiple DataSources share the same driver. This can
lead users to inadvertently pick the wrong configuration and run operations (e.g., migrations)
against the wrong database/schema.
+// when you need a specific config from multiple data sources+const allOptions = await reader.get()+const postgresOptions = allOptions.find((o) => o.type === "postgres")+```
Evidence
The guide’s example selects a config by driver type only, but the repo itself contains scenarios
with multiple Postgres DataSources differentiated by schema, showing that type alone is
insufficient to identify a single config.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
The migration guide example suggests selecting a specific config from multiple ormconfig entries using only `o.type === &amp;amp;quot;postgres&amp;amp;quot;`, but `type` is not a unique identifier if multiple DataSources share the same driver.
## Issue Context
With named connections removed, docs should not imply that `type` is a safe replacement for `name` as a unique key.
## Fix Focus Areas
- docs/docs/guides/8-migration-v1.md[285-294]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
14. Generic DataSource errors 🐞 Bug✓ Correctness
Description
After removing DataSource.name, the “already connected” / “not connected” errors no longer include
any identifier for which DataSource triggered the exception. In multi-DataSource apps/tests, this
makes failures harder to attribute without additional logging.
+ constructor() {
super(
- `Cannot execute operation on "${connectionName}" connection because connection is not yet established.`,+ `Cannot execute operation because connection is not yet established.`,
)
Evidence
The updated error classes now emit fully generic messages, and DataSource throws them without any
context; the repo also demonstrates multiple DataSources of the same type coexisting, where
contextual error messages would help.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
`CannotConnectAlreadyConnectedError` and `CannotExecuteNotConnectedError` are now fully generic and provide no context about which DataSource instance failed, which is less actionable in multi-DataSource applications.
## Issue Context
With `DataSource.name` removed, callers still benefit from an identifier derived from `DataSource.options` (e.g., type/database/schema/host/port).
## Fix Focus Areas
- src/error/CannotConnectAlreadyConnectedError.ts[6-11]
- src/error/CannotExecuteNotConnectedError.ts[6-11]
- src/data-source/DataSource.ts[234-236]
- src/data-source/DataSource.ts[277-279]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
15. Ambiguous config selection 🐞 Bug✓ Correctness
Description
The migration guide demonstrates selecting a specific ormconfig entry by o.type === "postgres",
but type is not guaranteed to be unique when multiple DataSources share the same driver. This can
lead users to inadvertently pick the wrong configuration and run operations (e.g., migrations)
against the wrong database/schema.
+// when you need a specific config from multiple data sources+const allOptions = await reader.get()+const postgresOptions = allOptions.find((o) => o.type === "postgres")+```
Evidence
The guide’s example selects a config by driver type only, but the repo itself contains scenarios
with multiple Postgres DataSources differentiated by schema, showing that type alone is
insufficient to identify a single config.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
The migration guide example suggests selecting a specific config from multiple ormconfig entries using only `o.type === &amp;amp;quot;postgres&amp;amp;quot;`, but `type` is not a unique identifier if multiple DataSources share the same driver.
## Issue Context
With named connections removed, docs should not imply that `type` is a safe replacement for `name` as a unique key.
## Fix Focus Areas
- docs/docs/guides/8-migration-v1.md[285-294]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
16. Generic DataSource errors 🐞 Bug✓ Correctness
Description
After removing DataSource.name, the “already connected” / “not connected” errors no longer include
any identifier for which DataSource triggered the exception. In multi-DataSource apps/tests, this
makes failures harder to attribute without additional logging.
+ constructor() {
super(
- `Cannot execute operation on "${connectionName}" connection because connection is not yet established.`,+ `Cannot execute operation because connection is not yet established.`,
)
Evidence
The updated error classes now emit fully generic messages, and DataSource throws them without any
context; the repo also demonstrates multiple DataSources of the same type coexisting, where
contextual error messages would help.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
`CannotConnectAlreadyConnectedError` and `CannotExecuteNotConnectedError` are now fully generic and provide no context about which DataSource instance failed, which is less actionable in multi-DataSource applications.
## Issue Context
With `DataSource.name` removed, callers still benefit from an identifier derived from `DataSource.options` (e.g., type/database/schema/host/port).
## Fix Focus Areas
- src/error/CannotConnectAlreadyConnectedError.ts[6-11]
- src/error/CannotExecuteNotConnectedError.ts[6-11]
- src/data-source/DataSource.ts[234-236]
- src/data-source/DataSource.ts[277-279]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
17. Ambiguous config selection 🐞 Bug✓ Correctness
Description
The migration guide demonstrates selecting a specific ormconfig entry by o.type === "postgres",
but type is not guaranteed to be unique when multiple DataSources share the same driver. This can
lead users to inadvertently pick the wrong configuration and run operations (e.g., migrations)
against the wrong database/schema.
+// when you need a specific config from multiple data sources+const allOptions = await reader.get()+const postgresOptions = allOptions.find((o) => o.type === "postgres")+```
Evidence
The guide’s example selects a config by driver type only, but the repo itself contains scenarios
with multiple Postgres DataSources differentiated by schema, showing that type alone is
insufficient to identify a single config.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
The migration guide example suggests selecting a specific config from multiple ormconfig entries using only `o.type === &amp;amp;amp;quot;postgres&amp;amp;amp;quot;`, but `type` is not a unique identifier if multiple DataSources share the same driver.
## Issue Context
With named connections removed, docs should not imply that `type` is a safe replacement for `name` as a unique key.
## Fix Focus Areas
- docs/docs/guides/8-migration-v1.md[285-294]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
18. Generic DataSource errors 🐞 Bug✓ Correctness
Description
After removing DataSource.name, the “already connected” / “not connected” errors no longer include
any identifier for which DataSource triggered the exception. In multi-DataSource apps/tests, this
makes failures harder to attribute without additional logging.
+ constructor() {
super(
- `Cannot execute operation on "${connectionName}" connection because connection is not yet established.`,+ `Cannot execute operation because connection is not yet established.`,
)
Evidence
The updated error classes now emit fully generic messages, and DataSource throws them without any
context; the repo also demonstrates multiple DataSources of the same type coexisting, where
contextual error messages would help.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
`CannotConnectAlreadyConnectedError` and `CannotExecuteNotConnectedError` are now fully generic and provide no context about which DataSource instance failed, which is less actionable in multi-DataSource applications.
## Issue Context
With `DataSource.name` removed, callers still benefit from an identifier derived from `DataSource.options` (e.g., type/database/schema/host/port).
## Fix Focus Areas
- src/error/CannotConnectAlreadyConnectedError.ts[6-11]
- src/error/CannotExecuteNotConnectedError.ts[6-11]
- src/data-source/DataSource.ts[234-236]
- src/data-source/DataSource.ts[277-279]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
19. Generic DataSource errors 🐞 Bug✓ Correctness
Description
After removing DataSource.name, the “already connected” / “not connected” errors no longer include
any identifier for which DataSource triggered the exception. In multi-DataSource apps/tests, this
makes failures harder to attribute without additional logging.
+ constructor() {
super(
- `Cannot execute operation on "${connectionName}" connection because connection is not yet established.`,+ `Cannot execute operation because connection is not yet established.`,
)
Evidence
The updated error classes now emit fully generic messages, and DataSource throws them without any
context; the repo also demonstrates multiple DataSources of the same type coexisting, where
contextual error messages would help.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
`CannotConnectAlreadyConnectedError` and `CannotExecuteNotConnectedError` are now fully generic and provide no context about which DataSource instance failed, which is less actionable in multi-DataSource applications.
## Issue Context
With `DataSource.name` removed, callers still benefit from an identifier derived from `DataSource.options` (e.g., type/database/schema/host/port).
## Fix Focus Areas
- src/error/CannotConnectAlreadyConnectedError.ts[6-11]
- src/error/CannotExecuteNotConnectedError.ts[6-11]
- src/data-source/DataSource.ts[234-236]
- src/data-source/DataSource.ts[277-279]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
20. Generic DataSource errors 🐞 Bug✓ Correctness
Description
After removing DataSource.name, the “already connected” / “not connected” errors no longer include
any identifier for which DataSource triggered the exception. In multi-DataSource apps/tests, this
makes failures harder to attribute without additional logging.
+ constructor() {
super(
- `Cannot execute operation on "${connectionName}" connection because connection is not yet established.`,+ `Cannot execute operation because connection is not yet established.`,
)
Evidence
The updated error classes now emit fully generic messages, and DataSource throws them without any
context; the repo also demonstrates multiple DataSources of the same type coexisting, where
contextual error messages would help.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
`CannotConnectAlreadyConnectedError` and `CannotExecuteNotConnectedError` are now fully generic and provide no context about which DataSource instance failed, which is less actionable in multi-DataSource applications.
## Issue Context
With `DataSource.name` removed, callers still benefit from an identifier derived from `DataSource.options` (e.g., type/database/schema/host/port).
## Fix Focus Areas
- src/error/CannotConnectAlreadyConnectedError.ts[6-11]
- src/error/CannotExecuteNotConnectedError.ts[6-11]
- src/data-source/DataSource.ts[234-236]
- src/data-source/DataSource.ts[277-279]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
ⓘ The new review experience is currently in Beta. Learn more
ConnectionOptionsReader.normalizeConnectionOptions computes absolute
entities/subscribers/migrations paths but assigns them to the options array object instead of
the per-DataSourceOptions entry, so consumers still receive unnormalized relative globs and class
discovery can fail when the working directory differs from the config root.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove the deprecated
nameproperty fromDataSourceandBaseDataSourceOptions. RenameConnectionOptionsReader.all()toget()and remove the oldget(name)andhas(name)methods that relied on named connections.Part of #11603.