Skip to content

fix: sql dialect returning order issue#1691

Merged
igalklebanov merged 3 commits intokysely-org:masterfrom
hwisu:fix-sql-dialect-returning-order-by
Jan 25, 2026
Merged

fix: sql dialect returning order issue#1691
igalklebanov merged 3 commits intokysely-org:masterfrom
hwisu:fix-sql-dialect-returning-order-by

Conversation

@hwisu
Copy link
Copy Markdown
Contributor

@hwisu hwisu commented Jan 25, 2026

Closes #1631

Howdy,
I made a small fix and added one test case.
I tried to get assigned, but since it looked like a small fix, I went ahead and opened a PR first.
Thanks for your understanding!

naive reproduction : https://github.com/hwisu/kysely-1631
discord request (from me) : https://discord.com/channels/890118421587578920/1073949928453328897/1462700413253062666

@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 25, 2026

@hwisu is attempting to deploy a commit to the Kysely Team Team on Vercel.

A member of the Team first needs to authorize it.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jan 25, 2026

commit: cd2be66

Copy link
Copy Markdown
Member

@igalklebanov igalklebanov left a comment

Choose a reason for hiding this comment

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

Hey 👋

Thanks! 🙏

Your fix worked. 👏

Made some changes since it was duplicating the entire update query visitor into the SQLite query compiler. This is wasteful given that only SQLite's spec (under certain system flag/s), supports limit/order by AND returning clauses in an update query. A much cheaper solution was to just reorder the clause handling in the default query compiler.

@igalklebanov igalklebanov added bug Something isn't working sqlite Related to sqlite sql Related to general SQL internal labels Jan 25, 2026
@igalklebanov igalklebanov merged commit 6e9a71b into kysely-org:master Jan 25, 2026
30 of 31 checks passed
@hwisu
Copy link
Copy Markdown
Contributor Author

hwisu commented Jan 25, 2026

Thanks for the feedback! Appreciate the cleanup and the simpler approach here. 🌮

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

Labels

bug Something isn't working internal sql Related to general SQL sqlite Related to sqlite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

returning needs to come before order by in sqlite for an update..where query.

2 participants