Skip to content

Conversation

igalklebanov
Copy link
Member

@igalklebanov igalklebanov commented Jun 8, 2025

Hey 👋

part of #783

This PR sets the foundations for dialects to implement query cancellation.
An executable<O> interface is created and all relevant builders implement it.
All execute and stream function accept an options object that might include abortSignal.
This abortSignal is passed down to the executor, and handled there.
The connection receives a hint at query time that it might need to prepare itself for cancelation - e.g. in PostgreSQL you need to make a request to get the pid of the connection.
The connection has a cancelQuery method that, in dialects that support it, cancel the query on the database side.

Verifying this works with PostgreSQL.

Copy link

vercel bot commented Jun 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
kysely ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 29, 2025 2:34am

Copy link

pkg-pr-new bot commented Jun 8, 2025

kysely_koa_example

npm i https://pkg.pr.new/kysely-org/kysely@1484

commit: 4b3dc8f

@igalklebanov igalklebanov added enhancement New feature or request api Related to library's API labels Jun 28, 2025
@igalklebanov igalklebanov changed the title TBD feat(core): ground work for query cancellation. Jun 29, 2025
Copy link
Member Author

Choose a reason for hiding this comment

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

The names were conflicting with the general QueryOptions this PR introduces.

apply executable @ select.

test suite prep.

??

best bench results.

...

update qb.

merge qb.

insert qb.

delete qb.

kysely.

raw builder.

fix regression in takeFirst.

more core.

abort.

...

...

...

...

...

...

...

...

...

executeQuery.

...

...

...

...

...

...

...

...

...

...

...

...

...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Related to library's API breaking change Includes breaking changes built-in dialect Related to a built-in dialect enhancement New feature or request internal postgres Related to PostgreSQL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants