Repository navigation
This release adds SQLite's native math functions and updates SQLite to 3.54.1. Existing legacy math and string functions remain enabled by default, so existing query results are preserved.
Deprecation warnings
Calling a legacy function now logs a warning. A function called for every row can produce many warnings, even for familiar names such as sqrt. Legacy functions are planned to be disabled by default in the next major release.
To try native SQLite behavior now:
const SQL = await initSqlJs({ useOldExtensionFunctions: false });The first initialization chooses the mode for all databases from that module. For a worker, pass config: { useOldExtensionFunctions: false } on its first message.
Check your queries before opting in:
log(100)changes from the natural logarithm to2; useln()for the natural logarithm.- Some invalid inputs return
NULLinstead of zero. Nativesign()returns an integer and works in expression indexes and generated columns. - Legacy-only functions such as
reverse,charindex,stdev,variance, andmedianare unavailable, including in saved views and triggers.
Both modes also gain native functions including ln, log2, mod, trunc, pow, ceiling, and two-argument log.
See the migration discussion and SQLite's math function reference for details. Install with npm install sql.js@1.16.0, or download a distribution below.