[PR #865] [MERGED] Use Unicode-aware implementations of LOWER() and UPPER() in SQL queries #29301

Closed
opened 2026-04-18 05:57:55 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/865
Author: @Jackenmen
Created: 4/7/2023
Status: Merged
Merged: 4/7/2023
Merged by: @j-f1

Base: masterHead: redefine_lower_and_upper_with_unicode_aware_impl


📝 Commits (4)

  • 029aa53 Redefine LOWER() and UPPER() with Unicode-aware implementation
  • 2536d14 Define a new SQL function instead of redefining built-in ones
  • 658fd10 Add a release note
  • 2e8dc5b Add a comment about the deterministic bit

📊 Changes

6 files changed (+58 additions, -30 deletions)

View changed files

📝 packages/loot-core/src/platform/server/sqlite/index.electron.ts (+10 -1)
📝 packages/loot-core/src/platform/server/sqlite/index.web.ts (+36 -24)
📝 packages/loot-core/src/server/accounts/payees.js (+1 -1)
📝 packages/loot-core/src/server/aql/compiler.js (+1 -1)
📝 packages/loot-core/src/server/db/index.js (+4 -3)
upcoming-release-notes/865.md (+6 -0)

📄 Description

Fixes #840 by creating application-defined SQL functions (https://www.sqlite.org/appfunc.html) for Unicode-aware implementations of LOWER() and UPPER(). This uses String.prototype.toLower/UpperCase() JS method.

I initially wanted to just redefine LOWER() and UPPER() but due to sql.js not supporting the definition of deterministic functions, I had to just define them as separate functions and use that in the appropriate places. It's probably better like that anyway...


🔄 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/865 **Author:** [@Jackenmen](https://github.com/Jackenmen) **Created:** 4/7/2023 **Status:** ✅ Merged **Merged:** 4/7/2023 **Merged by:** [@j-f1](https://github.com/j-f1) **Base:** `master` ← **Head:** `redefine_lower_and_upper_with_unicode_aware_impl` --- ### 📝 Commits (4) - [`029aa53`](https://github.com/actualbudget/actual/commit/029aa53100db4551dedf1ce88f1c717da283463a) Redefine LOWER() and UPPER() with Unicode-aware implementation - [`2536d14`](https://github.com/actualbudget/actual/commit/2536d14d35e59dc4e0a6816181861b5f0365c47e) Define a new SQL function instead of redefining built-in ones - [`658fd10`](https://github.com/actualbudget/actual/commit/658fd107aa6b84663d9996ca3738b5245f2c831a) Add a release note - [`2e8dc5b`](https://github.com/actualbudget/actual/commit/2e8dc5b8c531da19254ba27f929685aac6db1b5f) Add a comment about the deterministic bit ### 📊 Changes **6 files changed** (+58 additions, -30 deletions) <details> <summary>View changed files</summary> 📝 `packages/loot-core/src/platform/server/sqlite/index.electron.ts` (+10 -1) 📝 `packages/loot-core/src/platform/server/sqlite/index.web.ts` (+36 -24) 📝 `packages/loot-core/src/server/accounts/payees.js` (+1 -1) 📝 `packages/loot-core/src/server/aql/compiler.js` (+1 -1) 📝 `packages/loot-core/src/server/db/index.js` (+4 -3) ➕ `upcoming-release-notes/865.md` (+6 -0) </details> ### 📄 Description Fixes #840 by creating application-defined SQL functions (https://www.sqlite.org/appfunc.html) for Unicode-aware implementations of `LOWER()` and `UPPER()`. This uses `String.prototype.toLower/UpperCase()` JS method. I initially wanted to just redefine `LOWER()` and `UPPER()` but due to [sql.js not supporting the definition of deterministic functions](https://github.com/sql-js/sql.js/issues/551), I had to just define them as separate functions and use that in the appropriate places. It's probably better like that anyway... --- <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-04-18 05:57:55 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#29301