5

SQLite adds support for WebAssembly in 3.40.0

 1 year ago
source link: https://devm.io/databases/sqlite-webassembly-sql-3-40
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

There’s a new release available for SQLite that’s ready to download. Version 3.40.0 is here and adds some new tweaks, features, and brings support for compiling to WebAssembly. Let’s see what’s new and review the most notable changes.

SQLite is a compact, simple, free-to-use SQL library written in C. It helps to implement small, self-contained SQL databases engines.

SQLite 3.40.0 changes

  • SQLite to WebAssembly: SQLite 3.40.0 adds support for compiling to WebAssembly and the ability to run it in your browser. However, please note that the WASM build is considered to be in a public beta stage in 3.40.0 and is not yet finalized. Some changes are expected to be made and the final, stable version is set to come in a future release. You will also need a JavaScript-capable browser. Read more about SQLite to WASM here.
  • Query planner: Improvements were made to the query planner, including the ability to recognize covering indexes on large tables with more than 63 columns and data that is queried by the index from those additional columns.
  • SQLITE_MAX_ALLOCATION_SIZE option: This new option can be used to limit the size of memory allocations.
  • New interface: The sqlite3_value_encoding() interface is now added.
  • Security has been improved with the addition of making schema_version read-only when in defensive mode.
  • Enhancements were made to the RAGMA integrity_check and VACUUM INTO statements.
  • From now on, instances can have the same name as long as they are in different schemas.
  • Various enhancements for improved performance were made.

Saving code from corruption

3.40.0 also adds the helpful recovery extension. In the worst case scenario, this enables you to recover data from a corrupt SQLite database and save it. You can manually recover code using the .recover" command in the command line interface. Alternatively, you can also build the recovery API into your application.

Of course, there are recovery limitations. Sometimes data will be unusable, was permanently deleted, is unrecoverable, or is somehow defective and not fit for reuse.

From the documentation:

It is best to think of the recovery API as a salvage undertaking. Recovery will extract as much usable data as it can from the wreck of the old database, but some parts may be damaged beyond repair and some rework and testing should be performed prior to returning the recovered database to service.”

View the full release log for a comprehensive list of all changes in SQLite 3.40.0. Download the new version, or test out SQLite in the browser.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK