[PR #4238] [CLOSED] [WIP] [TypeScript] Make runQuery generic #5277

Closed
opened 2026-02-28 21:09:40 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/4238
Author: @joel-jeremy
Created: 1/24/2025
Status: Closed

Base: masterHead: ts-runQuery


📝 Commits (4)

📊 Changes

78 files changed (+1181 additions, -408 deletions)

View changed files

📝 packages/desktop-client/src/components/autocomplete/AccountAutocomplete.tsx (+2 -2)
📝 packages/desktop-client/src/components/autocomplete/PayeeAutocomplete.test.tsx (+1 -1)
📝 packages/desktop-client/src/components/autocomplete/PayeeAutocomplete.tsx (+1 -1)
📝 packages/desktop-client/src/components/mobile/accounts/Accounts.tsx (+2 -2)
📝 packages/desktop-client/src/components/modals/CategoryGroupMenuModal.tsx (+1 -1)
📝 packages/desktop-client/src/components/modals/CloseAccountModal.tsx (+3 -3)
📝 packages/desktop-client/src/components/payees/ManagePayees.tsx (+12 -6)
📝 packages/desktop-client/src/components/payees/PayeeTableRow.tsx (+2 -2)
📝 packages/desktop-client/src/components/schedules/ScheduleDetails.tsx (+1 -1)
📝 packages/desktop-client/src/components/transactions/TransactionsTable.test.tsx (+3 -3)
📝 packages/desktop-client/src/hooks/useClosedAccounts.ts (+1 -4)
📝 packages/desktop-client/src/hooks/useOffBudgetAccounts.ts (+1 -4)
📝 packages/desktop-client/src/hooks/useOnBudgetAccounts.ts (+1 -4)
📝 packages/loot-core/src/client/accounts/accountsSlice.ts (+1 -1)
📝 packages/loot-core/src/client/data-hooks/schedules.tsx (+1 -1)
📝 packages/loot-core/src/client/transfer.test.ts (+2 -1)
📝 packages/loot-core/src/mocks/budget.ts (+11 -8)
📝 packages/loot-core/src/mocks/index.ts (+5 -5)
📝 packages/loot-core/src/server/accounts/link.ts (+1 -1)
📝 packages/loot-core/src/server/accounts/parse-file.test.ts (+1 -1)

...and 58 more files

📄 Description

This PR is to make the runQuery function generic to make it easy to type DB query results and propagate the proper types from the bottom up.

There are some minimal changes just to help TypeScript infer types better but other than that, most of the changes are just annotating the query functions with the correct return types.

Note: We have 2 runQuerys in the codebase. One is for AQL (server/aql folder) and the other is for direct DB access (server/db folder). This PR is for the latter.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/4238 **Author:** [@joel-jeremy](https://github.com/joel-jeremy) **Created:** 1/24/2025 **Status:** ❌ Closed **Base:** `master` ← **Head:** `ts-runQuery` --- ### 📝 Commits (4) - [`ab40428`](https://github.com/actualbudget/actual/commit/ab40428ed3c485742312d45bdaebe955bf1779ed) [TypeScript] Make runQuery generic - [`999ed1c`](https://github.com/actualbudget/actual/commit/999ed1cb3de89aaca7799b0f8c47015824a1016a) Release notes - [`4fe5834`](https://github.com/actualbudget/actual/commit/4fe5834532404ee7e4991f4e9762fa25c06e12ce) Fix types - [`f515ed8`](https://github.com/actualbudget/actual/commit/f515ed81a0fbfda00be630d237f95e6d0efc37c8) DB models ### 📊 Changes **78 files changed** (+1181 additions, -408 deletions) <details> <summary>View changed files</summary> 📝 `packages/desktop-client/src/components/autocomplete/AccountAutocomplete.tsx` (+2 -2) 📝 `packages/desktop-client/src/components/autocomplete/PayeeAutocomplete.test.tsx` (+1 -1) 📝 `packages/desktop-client/src/components/autocomplete/PayeeAutocomplete.tsx` (+1 -1) 📝 `packages/desktop-client/src/components/mobile/accounts/Accounts.tsx` (+2 -2) 📝 `packages/desktop-client/src/components/modals/CategoryGroupMenuModal.tsx` (+1 -1) 📝 `packages/desktop-client/src/components/modals/CloseAccountModal.tsx` (+3 -3) 📝 `packages/desktop-client/src/components/payees/ManagePayees.tsx` (+12 -6) 📝 `packages/desktop-client/src/components/payees/PayeeTableRow.tsx` (+2 -2) 📝 `packages/desktop-client/src/components/schedules/ScheduleDetails.tsx` (+1 -1) 📝 `packages/desktop-client/src/components/transactions/TransactionsTable.test.tsx` (+3 -3) 📝 `packages/desktop-client/src/hooks/useClosedAccounts.ts` (+1 -4) 📝 `packages/desktop-client/src/hooks/useOffBudgetAccounts.ts` (+1 -4) 📝 `packages/desktop-client/src/hooks/useOnBudgetAccounts.ts` (+1 -4) 📝 `packages/loot-core/src/client/accounts/accountsSlice.ts` (+1 -1) 📝 `packages/loot-core/src/client/data-hooks/schedules.tsx` (+1 -1) 📝 `packages/loot-core/src/client/transfer.test.ts` (+2 -1) 📝 `packages/loot-core/src/mocks/budget.ts` (+11 -8) 📝 `packages/loot-core/src/mocks/index.ts` (+5 -5) 📝 `packages/loot-core/src/server/accounts/link.ts` (+1 -1) 📝 `packages/loot-core/src/server/accounts/parse-file.test.ts` (+1 -1) _...and 58 more files_ </details> ### 📄 Description <!-- Thank you for submitting a pull request! Make sure to follow the instructions to write release notes for your PR — it should only take a minute or two: https://github.com/actualbudget/docs#writing-good-release-notes --> This PR is to make the `runQuery` function generic to make it easy to type DB query results and propagate the proper types from the bottom up. There are some minimal changes just to help TypeScript infer types better but other than that, most of the changes are just annotating the query functions with the correct return types. Note: We have 2 `runQuery`s in the codebase. One is for AQL (`server/aql` folder) and the other is for direct DB access (`server/db` folder). This PR is for the latter. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-02-28 21:09:40 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#5277