You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
…es (#865)
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](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...
…es (actualbudget#865)
Fixesactualbudget#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...
Per Application-Defined SQL Functions documentation, custom SQL functions can be marked as deterministic by setting
SQLITE_DETERMINISTIC
bit. This allows such functions to be used in certain contexts where they otherwise wouldn't be able to such as with the WHERE clause of partial indexes or in generated columns (https://www.sqlite.org/c3ref/c_deterministic.html#sqlitedeterministic).As a point of reference, the better-sqlite3 library exposes this through the
options
argument in itsDatabase#function()
method. One more option that it exposes through this mechanism isSQLITE_DIRECTONLY
bit so it may make sense to support that as well.The text was updated successfully, but these errors were encountered: