add queryId to CompiledQuery and all transformer methods.#176
add queryId to CompiledQuery and all transformer methods.#176igalklebanov merged 4 commits intokysely-org:v0.28from
queryId to CompiledQuery and all transformer methods.#176Conversation
6790982 to
3a9d03f
Compare
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Thank you for continuing to update this branch @igalklebanov What do you think of this PR @koskimas? Are you going to merge it? This issue has been open for 2 years. I understand not wanting to break things, because it will be a pain to deal with. I am an open source maintainer, I get it. But serious projects really need this. It is essentially broken already to me, in its current state. Because my services are doing this constantly and I don't really have a good way to deal with it in Kysely. I feel backed into a corner. I have spent the past two weeks gathering data to try to fix this. I came up with this graph (query duation): And it is very symetrical with this graph (available connections): That causes downtime. I need to cancel queries after a timeout. I am planning to try some postgres workarounds, like using |
5269cd2 to
5d38c1b
Compare
a84367a to
124c0dc
Compare
b2b78db to
ae5cb1e
Compare
fcf13b9 to
471ef40
Compare
471ef40 to
19e5f43
Compare
|
Open in Stackblitz • kysely_koa_example commit: |
8da42a4 to
7300455
Compare
... ...
7300455 to
09c9294
Compare
queryId to CompiledQuery to allow async communication between more components.queryId to CompiledQuery and all transformer methods.
… more components. (#176)
commit 04040e3 Author: lucianolix <lucianopinedo@gmail.com> Date: Fri Feb 21 02:15:50 2025 -0400 whitespace diff trigger commit af9718d Author: lucianolix <lucianopinedo@gmail.com> Date: Fri Feb 21 02:14:58 2025 -0400 remove unnecessary file change commit 883a0c2 Merge: 36f8a1d 45b71e2 Author: lucianolix <lucianopinedo@gmail.com> Date: Fri Feb 21 02:10:34 2025 -0400 XMerge branch 'v0.28' into alter-type-builder commit 45b71e2 Merge: 107076a 0497525 Author: lucianolix <33232807+lucianolix@users.noreply.github.com> Date: Fri Feb 21 02:09:24 2025 -0400 Merge branch 'kysely-org:v0.28' into v0.28 commit 36f8a1d Author: lucianolix <lucianopinedo@gmail.com> Date: Thu Feb 20 20:41:07 2025 -0400 run prettier commit ae5ddc2 Author: lucianolix <lucianopinedo@gmail.com> Date: Thu Feb 20 20:37:01 2025 -0400 remove ; commit 31eea41 Author: lucianolix <lucianopinedo@gmail.com> Date: Thu Feb 20 18:53:28 2025 -0400 change remaining wrong identifierNodes to valueNodes, test fixes commit f007de7 Author: lucianolix <lucianopinedo@gmail.com> Date: Thu Feb 20 18:33:22 2025 -0400 Swap IdentifierNodes for ValueNodes commit e658a82 Author: lucianolix <lucianopinedo@gmail.com> Date: Thu Feb 20 17:13:14 2025 -0400 remove unused import, typing tests commit 2cb3935 Author: lucianolix <lucianopinedo@gmail.com> Date: Thu Feb 20 03:03:10 2025 -0400 missing space on query compiler commit b054013 Author: lucianolix <lucianopinedo@gmail.com> Date: Thu Feb 20 03:01:27 2025 -0400 enforce mutual exclusivity between before and after commit 933e2d0 Author: lucianolix <lucianopinedo@gmail.com> Date: Thu Feb 20 02:52:03 2025 -0400 query compiler impl of add value commit dedb9c2 Author: lucianolix <lucianopinedo@gmail.com> Date: Thu Feb 20 02:50:07 2025 -0400 Docs, better examples, swapped addValue to callback pattern commit e6826b4 Author: lucianolix <lucianopinedo@gmail.com> Date: Thu Feb 20 01:59:52 2025 -0400 add docs to alter type builder commit 62aa655 Author: lucianolix <lucianopinedo@gmail.com> Date: Thu Feb 20 01:48:59 2025 -0400 add documentation for alterType func inside schema.ts commit ccb5a9f Author: lucianolix <lucianopinedo@gmail.com> Date: Wed Feb 19 03:31:00 2025 -0400 WIP full api spec! commit 0497525 Author: Martin Adámek <banan23@gmail.com> Date: Sun Feb 9 13:27:47 2025 +0100 refactor: separate isolation level and access mode with a comma in MySQL (kysely-org#1350) commit f32c231 Author: Martin Adámek <banan23@gmail.com> Date: Sun Feb 9 12:48:17 2025 +0100 feat: Allow read-only transactions in Postgres and MySQL (kysely-org#1342) * feat: Allow read-only transactions in Postgres and MySQL Closes kysely-org#1341 * use `accessMode` instead * add tests * access mode type and validation, rearranging stuff a bit. Co-authored-by: Martin Adámek <615580+B4nan@users.noreply.github.com> * rearranging stuff a bit. Co-authored-by: Martin Adámek <615580+B4nan@users.noreply.github.com> * align/simplify tests a bit Co-authored-by: Martin Adámek <615580+B4nan@users.noreply.github.com> --------- Co-authored-by: igalklebanov <igalklebanov@gmail.com> Co-authored-by: Martin Adámek <615580+B4nan@users.noreply.github.com> commit 6467b77 Author: Alessio Napolitano <121714208+alenap93@users.noreply.github.com> Date: Sat Feb 8 23:59:59 2025 +0100 feat: expands limit in select accepting null value (kysely-org#1347) * feat: expands limit in select accepting null value * explain in jsdocs, move test case. Co-authored-by: Alessio Napolitano <121714208+alenap93@users.noreply.github.com> --------- Co-authored-by: igalklebanov <igalklebanov@gmail.com> commit 989bac2 Author: Reid Swan <reidswan@outlook.com> Date: Sat Feb 1 16:02:34 2025 +0200 feat: Add disableTransactions option to Migrator (kysely-org#1335) Co-authored-by: Igal Klebanov <igalklebanov@gmail.com> commit 9918cc8 Author: Igal Klebanov <igalklebanov@gmail.com> Date: Mon Jan 27 01:20:10 2025 +0200 add `queryId` to `CompiledQuery` to allow async communication between more components. (kysely-org#176) commit 8e1dc8e Author: Igal Klebanov <igalklebanov@gmail.com> Date: Sat Jan 25 23:36:48 2025 +0200 revisiting `orderBy`. (kysely-org#1326) commit bc0e2dd Author: igalklebanov <igalklebanov@gmail.com> Date: Sat Jan 18 21:17:30 2025 +0200 minor ci tweaks. .. commit c1963b7 Author: igalklebanov <igalklebanov@gmail.com> Date: Sat Jan 18 20:43:31 2025 +0200 improve join tests dialect coverage. commit 1623b48 Author: igalklebanov <igalklebanov@gmail.com> Date: Sat Jan 18 20:00:36 2025 +0200 dry up joins. commit 92c7e44 Author: Ersin Akinci <5427394+ersinakinci@users.noreply.github.com> Date: Sat Jan 18 10:31:07 2025 -0700 Add support for cross join and cross join lateral (kysely-org#1325) Co-authored-by: Igal Klebanov <igalklebanov@gmail.com> commit b61300c Author: Simon Schick <simonsimcity@gmail.com> Date: Fri Jan 17 17:45:41 2025 +0100 Support json_agg(column_ref) (kysely-org#1316) Co-authored-by: Simon Schick <392589+SimonSimCity@users.noreply.github.com> Co-authored-by: Igal Klebanov <igalklebanov@gmail.com> commit 92bd46d Author: Drew Marshall <31295028+drew-marsh@users.noreply.github.com> Date: Sun Jan 12 09:05:16 2025 -0800 Add outer and cross apply (mssql) (kysely-org#1074) Co-authored-by: Drew Marshall <31295028+drew-marsh@users.noreply.github.com> Co-authored-by: Drew Marshall <thedrewguy@gmail.como> Co-authored-by: igalklebanov <igalklebanov@gmail.com> commit e99655f Author: Igal Klebanov <igalklebanov@gmail.com> Date: Sat Jan 11 14:08:17 2025 +0200 add TypeScript benchmarks. (kysely-org#1314) commit 8f8e83c Author: Ivashkin Olexiy <32811685+ivashog@users.noreply.github.com> Date: Thu Jan 9 12:23:43 2025 +0200 Add `within group` clause support for aggregate function builder (kysely-org#1024) Co-authored-by: Ivashkin Olexiy <32811685+ivashog@users.noreply.github.com> Co-authored-by: Dev K0te <dev.k0te42@gmail.com> Co-authored-by: igalklebanov <igalklebanov@gmail.com> commit 37038c9 Author: vincentiusvin <54709710+vincentiusvin@users.noreply.github.com> Date: Mon Jan 6 09:08:36 2025 +0700 SQLite's OR CONFLICT clause for inserts (kysely-org#976) Co-authored-by: vincentiusvin <54709710+vincentiusvin@users.noreply.github.com> Co-authored-by: Igal Klebanov <igalklebanov@gmail.com> commit 859ec4b Author: Sam Clearman <sam@samclearman.com> Date: Sun Jan 5 14:55:18 2025 -0800 Add `Date` as a valid return type for `max` and `min` (kysely-org#1062) commit 5ee89a6 Author: igalklebanov <igalklebanov@gmail.com> Date: Sun Jan 5 13:58:29 2025 +0200 feat: add HandleEmtpyInListsPlugin. (kysely-org#925) * feat: empty where in plugin * test: add new tests * chore: remove unneccesary typeguards * fix: change to binary operator node * test: update tests to do both in and not in * test: for having * chore: rm test * test: nullable tests * chore: nit * chore: condense suite * chore: db config override * chore: extra console log * chore: empty arr plugin docs * HandleEmptyInListsPlugin initial commit. Co-authored-by: Austin Woon Quan <43132101+austinwoon@users.noreply.github.com> --------- Co-authored-by: Austin Woon <austin@open.gov.sg> Co-authored-by: igalklebanov <igalklebanov@gmail.com> remove only. commit 3978530 Author: Igal Klebanov <igalklebanov@gmail.com> Date: Sun Dec 1 15:26:53 2024 +0100 add `returning` support in `MERGE` queries. (kysely-org#1171) commit 605307c Author: igalklebanov <igalklebanov@gmail.com> Date: Sun Dec 1 09:57:21 2024 +0200 fix jsdocs. commit f8f3194 Author: igalklebanov <igalklebanov@gmail.com> Date: Sun Nov 24 02:41:15 2024 +0200 fix package-lock. commit a83b722 Author: Igal Klebanov <igalklebanov@gmail.com> Date: Tue Nov 5 00:27:58 2024 +0200 chore: enforce min TS version (kysely-org#1194) commit 3ddfc1b Author: Igal Klebanov <igalklebanov@gmail.com> Date: Thu Oct 24 17:28:12 2024 +0300 fix TS backwards compat following `ControlledTransaction`. (kysely-org#1193) commit f83eb25 Author: Igal Klebanov <igalklebanov@gmail.com> Date: Sat Oct 19 16:32:22 2024 +0300 `await using kysely = new Kysely()` support. (kysely-org#1167) commit 5a9d1bc Author: Igal Klebanov <igalklebanov@gmail.com> Date: Sat Oct 5 20:12:23 2024 +0300 add `ControlledTransaction`. (kysely-org#962) Co-authored-by: Igal Klebanov <igal@grainfinance.co> commit eacdc2e Author: Igal Klebanov <igalklebanov@gmail.com> Date: Sat Oct 5 18:55:29 2024 +0300 ci: run 22.x commit 7c81a39 Author: wirekang <wirekang@gmail.com> Date: Sun Sep 29 22:41:57 2024 +0900 Remove preventAwait (kysely-org#1160) Related kysely-org#748 commit 8b8ccf7 Author: Dapper Mink <quentinjanuelkij@gmail.com> Date: Fri Aug 2 19:55:48 2024 +0900 feat: support refresh materialized view (kysely-org#990) * feat: add postgres range types (kysely-org#1086) * feat: support refresh naterialized view * fix tests by adding .materialized() to remove the matview * fix failing test * fix: References typo (kysely-org#1092) * chore: refresh-view-node.ts => refresh-materialized-view-node.ts * chore: export node in index.ts --------- Co-authored-by: Isak <16906089+kansson@users.noreply.github.com> Co-authored-by: Jonathan Wu <jonathanwu70@gmail.com> commit 5291044 Author: Sami Koskimäki <koskomi@gmail.com> Date: Mon Jul 22 15:18:49 2024 +0300 add reusable helpers recipe and implement missing expression features (kysely-org#1085) * add reusable helpers recipe and implement missing expression features * force node 22.4.1 in CI because of an npm bug commit 39978d1 Author: Sami Koskimäki <koskomi@gmail.com> Date: Fri Jul 19 12:34:50 2024 +0300 Speedup types with huge databases. Fixes kysely-org#867 (kysely-org#1080) commit d8f9401 Author: Sami Koskimäki <koskomi@gmail.com> Date: Sun Jul 14 14:59:58 2024 +0300 Support update table1, table2, ... query support. Closes kysely-org#192 (kysely-org#1079) commit 2854cac Author: Igal Klebanov <igalklebanov@gmail.com> Date: Sun Jul 7 23:02:15 2024 +0300 `InferResult` should output plural. (kysely-org#1064) commit 7738533 Author: lucianolix <lucianopinedo@gmail.com> Date: Tue Feb 18 01:47:15 2025 -0400 WIP: boilerplate for alter type commit ffc4058 Author: Igal Klebanov <igalklebanov@gmail.com> Date: Sun Feb 16 22:43:26 2025 +0200 docs: add Marvin's (Deno) quote. (kysely-org#1360) * Update quotes.ts * add avatar. * reddit icon. commit 107076a Author: Martin Adámek <banan23@gmail.com> Date: Sun Feb 9 13:27:47 2025 +0100 refactor: separate isolation level and access mode with a comma in MySQL (kysely-org#1350) commit f7b3d90 Author: Martin Adámek <banan23@gmail.com> Date: Sun Feb 9 12:48:17 2025 +0100 feat: Allow read-only transactions in Postgres and MySQL (kysely-org#1342) * feat: Allow read-only transactions in Postgres and MySQL Closes kysely-org#1341 * use `accessMode` instead * add tests * access mode type and validation, rearranging stuff a bit. Co-authored-by: Martin Adámek <615580+B4nan@users.noreply.github.com> * rearranging stuff a bit. Co-authored-by: Martin Adámek <615580+B4nan@users.noreply.github.com> * align/simplify tests a bit Co-authored-by: Martin Adámek <615580+B4nan@users.noreply.github.com> --------- Co-authored-by: igalklebanov <igalklebanov@gmail.com> Co-authored-by: Martin Adámek <615580+B4nan@users.noreply.github.com> commit 5bfd7a9 Author: Alessio Napolitano <121714208+alenap93@users.noreply.github.com> Date: Sat Feb 8 23:59:59 2025 +0100 feat: expands limit in select accepting null value (kysely-org#1347) * feat: expands limit in select accepting null value * explain in jsdocs, move test case. Co-authored-by: Alessio Napolitano <121714208+alenap93@users.noreply.github.com> --------- Co-authored-by: igalklebanov <igalklebanov@gmail.com> commit fdbc74a Author: Reid Swan <reidswan@outlook.com> Date: Sat Feb 1 16:02:34 2025 +0200 feat: Add disableTransactions option to Migrator (kysely-org#1335) Co-authored-by: Igal Klebanov <igalklebanov@gmail.com> commit 1bd4e26 Author: Igal Klebanov <igalklebanov@gmail.com> Date: Mon Jan 27 01:20:10 2025 +0200 add `queryId` to `CompiledQuery` to allow async communication between more components. (kysely-org#176) commit 25fe2d0 Author: Igal Klebanov <igalklebanov@gmail.com> Date: Sat Jan 25 23:36:48 2025 +0200 revisiting `orderBy`. (kysely-org#1326) commit 22895c1 Author: igalklebanov <igalklebanov@gmail.com> Date: Sat Jan 18 21:17:30 2025 +0200 minor ci tweaks. .. commit 8b252b2 Author: igalklebanov <igalklebanov@gmail.com> Date: Sat Jan 18 20:43:31 2025 +0200 improve join tests dialect coverage. commit d306db7 Author: igalklebanov <igalklebanov@gmail.com> Date: Sat Jan 18 20:00:36 2025 +0200 dry up joins. commit 8bbbc69 Author: Ersin Akinci <5427394+ersinakinci@users.noreply.github.com> Date: Sat Jan 18 10:31:07 2025 -0700 Add support for cross join and cross join lateral (kysely-org#1325) Co-authored-by: Igal Klebanov <igalklebanov@gmail.com> commit ac6934a Author: Simon Schick <simonsimcity@gmail.com> Date: Fri Jan 17 17:45:41 2025 +0100 Support json_agg(column_ref) (kysely-org#1316) Co-authored-by: Simon Schick <392589+SimonSimCity@users.noreply.github.com> Co-authored-by: Igal Klebanov <igalklebanov@gmail.com> commit b6a7dab Author: Drew Marshall <31295028+drew-marsh@users.noreply.github.com> Date: Sun Jan 12 09:05:16 2025 -0800 Add outer and cross apply (mssql) (kysely-org#1074) Co-authored-by: Drew Marshall <31295028+drew-marsh@users.noreply.github.com> Co-authored-by: Drew Marshall <thedrewguy@gmail.como> Co-authored-by: igalklebanov <igalklebanov@gmail.com> commit a5686c6 Author: Igal Klebanov <igalklebanov@gmail.com> Date: Sat Jan 11 14:08:17 2025 +0200 add TypeScript benchmarks. (kysely-org#1314) commit 6e94c15 Author: Ivashkin Olexiy <32811685+ivashog@users.noreply.github.com> Date: Thu Jan 9 12:23:43 2025 +0200 Add `within group` clause support for aggregate function builder (kysely-org#1024) Co-authored-by: Ivashkin Olexiy <32811685+ivashog@users.noreply.github.com> Co-authored-by: Dev K0te <dev.k0te42@gmail.com> Co-authored-by: igalklebanov <igalklebanov@gmail.com> commit 77be243 Author: vincentiusvin <54709710+vincentiusvin@users.noreply.github.com> Date: Mon Jan 6 09:08:36 2025 +0700 SQLite's OR CONFLICT clause for inserts (kysely-org#976) Co-authored-by: vincentiusvin <54709710+vincentiusvin@users.noreply.github.com> Co-authored-by: Igal Klebanov <igalklebanov@gmail.com> commit 5e4597c Author: Sam Clearman <sam@samclearman.com> Date: Sun Jan 5 14:55:18 2025 -0800 Add `Date` as a valid return type for `max` and `min` (kysely-org#1062) commit 3b4d6e2 Author: igalklebanov <igalklebanov@gmail.com> Date: Sun Jan 5 13:58:29 2025 +0200 feat: add HandleEmtpyInListsPlugin. (kysely-org#925) * feat: empty where in plugin * test: add new tests * chore: remove unneccesary typeguards * fix: change to binary operator node * test: update tests to do both in and not in * test: for having * chore: rm test * test: nullable tests * chore: nit * chore: condense suite * chore: db config override * chore: extra console log * chore: empty arr plugin docs * HandleEmptyInListsPlugin initial commit. Co-authored-by: Austin Woon Quan <43132101+austinwoon@users.noreply.github.com> --------- Co-authored-by: Austin Woon <austin@open.gov.sg> Co-authored-by: igalklebanov <igalklebanov@gmail.com> remove only. commit c75bb45 Author: Igal Klebanov <igalklebanov@gmail.com> Date: Sun Dec 1 15:26:53 2024 +0100 add `returning` support in `MERGE` queries. (kysely-org#1171) commit d53328e Author: igalklebanov <igalklebanov@gmail.com> Date: Sun Dec 1 09:57:21 2024 +0200 fix jsdocs. commit e3e30e1 Author: igalklebanov <igalklebanov@gmail.com> Date: Sun Nov 24 02:41:15 2024 +0200 fix package-lock. commit 575b3f4 Author: Igal Klebanov <igalklebanov@gmail.com> Date: Tue Nov 5 00:27:58 2024 +0200 chore: enforce min TS version (kysely-org#1194) commit ddc275f Author: Igal Klebanov <igalklebanov@gmail.com> Date: Thu Oct 24 17:28:12 2024 +0300 fix TS backwards compat following `ControlledTransaction`. (kysely-org#1193) commit cf7ddb9 Author: Igal Klebanov <igalklebanov@gmail.com> Date: Sat Oct 19 16:32:22 2024 +0300 `await using kysely = new Kysely()` support. (kysely-org#1167) commit 0a28f87 Author: Igal Klebanov <igalklebanov@gmail.com> Date: Sat Oct 5 20:12:23 2024 +0300 add `ControlledTransaction`. (kysely-org#962) Co-authored-by: Igal Klebanov <igal@grainfinance.co> commit ab11ce3 Author: Igal Klebanov <igalklebanov@gmail.com> Date: Sat Oct 5 18:55:29 2024 +0300 ci: run 22.x commit 5b18e30 Author: wirekang <wirekang@gmail.com> Date: Sun Sep 29 22:41:57 2024 +0900 Remove preventAwait (kysely-org#1160) Related kysely-org#748 commit b026a45 Author: Dapper Mink <quentinjanuelkij@gmail.com> Date: Fri Aug 2 19:55:48 2024 +0900 feat: support refresh materialized view (kysely-org#990) * feat: add postgres range types (kysely-org#1086) * feat: support refresh naterialized view * fix tests by adding .materialized() to remove the matview * fix failing test * fix: References typo (kysely-org#1092) * chore: refresh-view-node.ts => refresh-materialized-view-node.ts * chore: export node in index.ts --------- Co-authored-by: Isak <16906089+kansson@users.noreply.github.com> Co-authored-by: Jonathan Wu <jonathanwu70@gmail.com> commit a4671da Author: Sami Koskimäki <koskomi@gmail.com> Date: Mon Jul 22 15:18:49 2024 +0300 add reusable helpers recipe and implement missing expression features (kysely-org#1085) * add reusable helpers recipe and implement missing expression features * force node 22.4.1 in CI because of an npm bug commit 56100e6 Author: Sami Koskimäki <koskomi@gmail.com> Date: Fri Jul 19 12:34:50 2024 +0300 Speedup types with huge databases. Fixes kysely-org#867 (kysely-org#1080) commit 73227d6 Author: Sami Koskimäki <koskomi@gmail.com> Date: Sun Jul 14 14:59:58 2024 +0300 Support update table1, table2, ... query support. Closes kysely-org#192 (kysely-org#1079) commit 6074e10 Author: Igal Klebanov <igalklebanov@gmail.com> Date: Sun Jul 7 23:02:15 2024 +0300 `InferResult` should output plural. (kysely-org#1064)
… more components. (#176)
… more components. (#176)
…xtended DatabaseConnection and QueryExecutor interfaces with AbortSignal support - Updated QueryExecutorBase with cancellation logic and error handling - Added compatibility with PR kysely-org#176 queryId changes - Ready to proceed with Phase 2: PostgreSQL Implementation



does what #173 tried to achieve, but in a simpler way as suggested by @koskimas.
queryIdtoCompiledQuery- nowDatabaseConnectionhas access to it inexecuteQueryandstreamQuerymethods in a non-breaking way.queryIdas a 2nd optional (for now) argument in alltransformmethods. Now plugins can enjoy even more flexibility - not just in roottransformQueryandtransformResultsmethods.createQueryIdto ease dialect/plugin implementation by 3rd parties.numUpdatedOrDeletedRowsusage as it has been deprecated for 2 years now.