Skip to content

fix: fixing missing read parent - #5497

Closed
jacek-prisma wants to merge 2 commits into
mainfrom
fix/read-parent-fix-test
Closed

fix: fixing missing read parent#5497
jacek-prisma wants to merge 2 commits into
mainfrom
fix/read-parent-fix-test

Conversation

@jacek-prisma

@jacek-prisma jacek-prisma commented Jun 24, 2025

Copy link
Copy Markdown
Contributor

This fixes a problem with MySQL flavour when the foreign key relation mode is used with the query compiler. In this scenario our update node in the query graph ends up having no prior read node. The read node is necessary for databases that don't support RETURNING. The query engine has a workaround for it which involves issuing queries dynamically at runtime whenever selectors for an update are missing but we can't do that in the query compiler workflow. I've modified how the graph is constructed to always add a read node prior to the update. I've also included a minor optimization for the case when relation mode is set to prisma (to avoid introducing a performance regression) - we avoid issuing a read query when insert_emulated_on_update connects no edges to it.

@github-actions

github-actions Bot commented Jun 24, 2025

Copy link
Copy Markdown
Contributor

WASM Query Engine file Size

Engine This PR Base branch Diff
Postgres 2.185MiB 2.185MiB 217.000B
Postgres (gzip) 875.186KiB 875.252KiB -68.000B
Mysql 2.150MiB 2.150MiB 168.000B
Mysql (gzip) 859.988KiB 860.088KiB -103.000B
Sqlite 2.059MiB 2.059MiB 220.000B
Sqlite (gzip) 825.145KiB 825.212KiB -69.000B
SQL Server 2.115MiB 2.115MiB 220.000B
SQL Server (gzip) 848.294KiB 848.223KiB 73.000B

@codspeed-hq

codspeed-hq Bot commented Jun 24, 2025

Copy link
Copy Markdown

CodSpeed Performance Report

Merging #5497 will not alter performance

Comparing fix/read-parent-fix-test (a2b4da8) with main (63298ba)

Summary

✅ 11 untouched benchmarks

@jacek-prisma
jacek-prisma deleted the fix/read-parent-fix-test branch October 10, 2025 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant