Skip to content

fix(postgres): load tables and columns sequentially to avoid concurrent queries - #12916

Closed
lazerg wants to merge 1 commit into
typeorm:masterfrom
lazerg:fix/12914-postgres-load-tables-sequential
Closed

lazerg wants to merge 1 commit into
typeorm:masterfrom
lazerg:fix/12914-postgres-load-tables-sequential

Conversation

@lazerg

@lazerg lazerg commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Description of change

loadTables() in the Postgres and CockroachDB query runners still built tables and their columns inside nested Promise.all calls. Enum/array columns (Postgres) and generated columns (both drivers) query from the column callback, so several queries were sent on one client at once and pg >= 8.19 printed the client.query() deprecation warning on schema:log, migration:generate and synchronize. Both loops now run with for...of, the same way #12105 did for the catalog queries above them.

Added a test for each driver that wraps queryRunner.query and checks that getTables() never has more than one query in flight. On master the Postgres one sees 99 at once and the CockroachDB one sees 5.

Pull-Request Checklist

@github-actions github-actions Bot added the linked-issue PR references an issue label Sep 30, 2026
@pkg-pr-new

pkg-pr-new Bot commented Sep 30, 2026

Copy link
Copy Markdown
  • typeorm-sql-js-example

    npm i https://pkg.pr.new/typeorm@12916
    

commit: cba56be

@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
  • Author self-review: I have reviewed the code review findings, and addressed the relevant ones.

Grey Divider

Tip of the day
💡 Did you know, you can route each severity your way: inline, summary, both, or drop

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@lazerg

lazerg commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

@alumni, please have a look when you have time

@lazerg

lazerg commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

Closing due to inactivity.

@lazerg lazerg closed this Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

linked-issue PR references an issue

Development

Successfully merging this pull request may close these issues.

postgres: loadTables() still runs concurrent queries on one client (pg deprecation warning, error in pg 9)

1 participant