SQLite 3.51 Brings New JSONB Functions and Better Performance

SQLite 3.51 introduces new JSONB functions, improved query performance, enhanced CLI tools, and expanded support for 64-bit WebAssembly builds.

The team behind SQLite, a free and open-source self-contained relational database engine widely used in embedded systems and applications, released SQLite 3.51, with the headline change being the addition of jsonb_each() and jsonb_tree(), new functions that mirror existing JSON utilities but return data in the binary JSONB format for array and object types.

Moreover, two well-known extensions, carray and percentile, are now included by default in the amalgamation, although they are still disabled unless explicitly enabled at compile time. There are also enhancements to the Tcl interface, which make scripting more flexible. These include an -asdict flag that represents row data as dictionaries and enables user-defined functions to break execution and return SQL NULL values.

On the command line, the .timer command now measures time with microsecond precision. Output modes handle wide characters correctly, and .imposter can now create read-only imposter tables that safely interact with VACUUM operations.

Other small but thoughtful details include a new --ifexists option for safer database handling and a restriction that prevents column widths exceeding 30,000 characters, which helps mitigate potential misuse.

On the performance tuning side, SQLite 3.51.0 reduces CPU overhead when committing read transactions, detects empty joins earlier, and skips redundant evaluations of scalar subqueries. Window function queries, particularly those using “BETWEEN … FOLLOWING,” benefit from optimized execution that reduces processing time for large datasets.

On top of that, SQLite’s internal tools have become smarter. The printf() and SQL format() functions no longer display negative zero values like “-0.00,” while error messages from FTS5 are more descriptive. Plus, STRICT typing now applies to computed columns, improving schema consistency.

Beyond the database core, JavaScript/WASM builds now support 64-bit WebAssembly, with the canonical builds remaining 32-bit. Creating a 64-bit build is as simple as running make. There’s also improved compatibility with VxWorks and stronger protection against database corruption when POSIX advisory locks are broken.

For more information on all technical changes, see the release announcement.

Bobby Borisov

Bobby Borisov

Bobby, an editor-in-chief at Linuxiac, is a Linux professional with over 20 years of experience. With a strong focus on Linux and open-source software, he has worked as a Senior Linux System Administrator, Software Developer, and DevOps Engineer for small and large multinational companies.

Leave a Reply

Your email address will not be published. Required fields are marked *