Skip to content

DeprecationWarning: Calling client.query() when the client is already executing a query is deprecated and will be removed in [email protected] #12238

Closed

Description

@max-brigade

Feature Description

DeprecationWarning: Calling client.query() when the client is already executing a query is deprecated and will be removed in [email protected]. Use async/await or an external async flow control mechanism instead.

seeing this when using
relationLoadStrategy: 'query'
since pg update

The Solution

Seems these can no longer be handled with promise.all

Considered Alternatives

not using relationLoadStrategy: 'query',

Additional Context

No response

Relevant Database Driver(s)

  • aurora-mysql
  • aurora-postgres
  • better-sqlite3
  • cockroachdb
  • cordova
  • expo
  • mongodb
  • mysql
  • nativescript
  • oracle
  • postgres
  • react-native
  • sap
  • spanner
  • sqlite
  • sqlite-abstract
  • sqljs
  • sqlserver

Are you willing to resolve this issue by submitting a Pull Request?

No

Activity

  1. max-brigade commented on Mar 19, 2026

    @max-brigade
    Author

    It also seems to happen when calling .save on a ManyToMany relation

  2. aklemen commented on Mar 19, 2026

    @aklemen

    This was already addressed in #12105 (duplicate issue #12055).

  3. max-brigade commented on Mar 19, 2026

    @max-brigade
    Author

    Isn't #12105 only addressing migrations and not relationLoadStrategy: 'query', and saving of ManyToMany relations?

  4. max-brigade commented on Apr 7, 2026

    @max-brigade
    Author

    typeorm+0.3.28.patch

    Here's a patch changing all occurences of concurrent queries in our codebase, to run sequentially on postgres. Unfortunately, I don't have the time to turn this into a proper PR.

  5. pkuczynski commented on Apr 15, 2026

    @pkuczynski
    Member

    This is the remaining half of the pg@9 deprecation warning that was partially addressed by #12105 (merged). That fix serialized the loadTables(), clearDatabase(), and dropEnumTypes() paths, but the relationLoadStrategy: 'query' relation loading code path still fires concurrent client.query() calls against the same client and triggers the same deprecation warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions