Skip to content

feat: add support for CancellationToken in generated methods#420

Draft
ballistic-booger wants to merge 2 commits into
DaredevilOSS:mainfrom
ballistic-booger:add-query-cancellation-token-support
Draft

feat: add support for CancellationToken in generated methods#420
ballistic-booger wants to merge 2 commits into
DaredevilOSS:mainfrom
ballistic-booger:add-query-cancellation-token-support

Conversation

@ballistic-booger

Copy link
Copy Markdown
Contributor
  • implement CancellationGen to handle optional CancellationToken threading
  • update DbDriver to expose Cancellation property
  • modify CommonGen to support cancellation arguments in method parameters and reader calls
  • update multiple generator types (One, Many, Exec, ExecRows, ExecLastId, CopyFrom) to include CancellationToken in signatures and DB calls
  • update MySqlConnector, Npgsql, and Sqlite drivers to pass CancellationToken to connection and command execution
  • add withCancellationToken option to PluginOptions and RawOptions
  • update README.md with documentation and usage examples for cancellation
  • add unit tests for CancellationGen and integration tests for generated code across all engines

@ballistic-booger ballistic-booger marked this pull request as draft June 25, 2026 22:55
@ballistic-booger ballistic-booger force-pushed the add-query-cancellation-token-support branch from 4763a95 to 58b0769 Compare June 25, 2026 23:00
- implement CancellationGen to handle CancellationToken injection into generated method signatures and DB calls
- update DbDriver and CommonGen to support cancellation arguments in async methods
- thread CancellationToken into OpenConnectionAsync, ExecuteAsync, QueryAsync, and other database operations across MySqlConnector, Npgsql, and Sqlite drivers
- add WithCancellationToken option to PluginOptions and RawOptions
- update README.md with documentation and examples for cancellation
- add comprehensive unit tests for CancellationGen and end-to-end codegen validation
- update example request files to include the new plugin option
@ballistic-booger ballistic-booger force-pushed the add-query-cancellation-token-support branch from 58b0769 to e1bd84d Compare June 25, 2026 23:20
…n option

The withCancellationToken option was added to serialized plugin options,
but only the Postgres request.message fixtures were regenerated. Regenerate
the MySQL and SQLite ones so the codegen sync check passes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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