Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Unicode-aware implementations of LOWER() and UPPER() in SQL queries #865

Conversation

Jackenmen
Copy link
Contributor

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...

@netlify
Copy link

netlify bot commented Apr 7, 2023

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit 2e8dc5b
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/64300e4a19e3260008777036
😎 Deploy Preview https://deploy-preview-865--actualbudget.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@Jackenmen Jackenmen force-pushed the redefine_lower_and_upper_with_unicode_aware_impl branch from 634fb84 to 658fd10 Compare April 7, 2023 04:13
Copy link
Member

@MatissJanis MatissJanis left a comment

Choose a reason for hiding this comment

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

Tested an reviewed! Nice, now my Latvian UTF8 chars work too :)

Thanks!

@j-f1 j-f1 merged commit 835c1a5 into actualbudget:master Apr 7, 2023
@trafico-bot trafico-bot bot added ✨ Merged Pull Request has been merged successfully and removed ✅ Approved labels Apr 7, 2023
@Jackenmen Jackenmen deleted the redefine_lower_and_upper_with_unicode_aware_impl branch April 7, 2023 20:37
FlorianLang06 pushed a commit to FlorianLang06/actual that referenced this pull request Mar 7, 2024
…es (actualbudget#865)

Fixes actualbudget#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](sql-js/sql.js#551), I had to just
define them as separate functions and use that in the appropriate
places. It's probably better like that anyway...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Merged Pull Request has been merged successfully
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Can't use rules to match string fields by a Polish letter if it's at the beginning of a word
3 participants