Sqlite Weekly Versions Save

Weekly SQLite news, articles and extensions ✨

22.40

1 year ago

Ciao! Hope you are enjoying the week ツ Here is what's going on in the SQLite world lately:

Reusing the result of user-defined function within the same query

Nice trick to avoid recomputing a function in a query.

Does the design of deferred transactions lead to deadlocks?

Transactions are a tricky beast, so it's worth revisiting the differences between deferred and immediate ones.

Book: SQLite Forensics

In this book, Paul Sanderson covers the format of the SQLite database, and associated journal and Write-Ahead Logs (WAL) in great detail.

A distributed SQLite benchmark: How mvSQLite scales

mvSQLite is the open-source, SQLite-compatible distributed database built on FoundationDB. In this post, Heyang Zhou benchmarks mvSQLite to see how a single database scales when adding more machines to the cluster.

LibSQL: an open contribution SQLite fork

libSQL is an open source, open contribution fork of SQLite. The team behind it aims to evolve it to suit many more use cases than SQLite was originally designed for.

That's all for now. See you next week!

22.39

1 year ago

Hola! Hope you are enjoying the week ツ Here is what's going on in the SQLite world lately:

Introducing LiteFS

LiteFS is a distributed file system specifically built for replicating SQLite databases. This allows each application node to have a full local copy of the database and respond to requests with minimal latency.

SQLite for Secrecy Management

Charles Fisher describes how to use SQLite as an application secrets provider.

mvSQLite: Distributed, MVCC SQLite on top of FoundationDB

mvSQLite is the open-source, SQLite-compatible distributed database made by Heyang Zhou. In contrast to rqlite, dqlite, and Litestream, mvSQLite offers not only read but also write scalability, provides the strictest consistency, and is a drop-in addition to SQLite.

Atuin: Magical shell history

Atuin (made by Ellie Huxtable) replaces the existing shell history with an SQLite database, recording additional commands context. It also provides optional and fully encrypted history synchronisation between machines.

rqlite 7.7

rqlite is a lightweight, distributed relational database, which uses SQLite as its storage engine. Release 7.7.0 adds support for the non-deterministic RANDOM function via statement-rewriting.

pgsqlite: A pure python module to import SQLite databases into Postgres

A CLI tool to load SQLite3 databases into PostgresSQL. Supports tables and indexes, but not views or triggers.

That's all for now. See you next week!

22.38

1 year ago

Salut! Hope you are enjoying the week ツ Here is what's going on in the SQLite world lately:

Recipes from Python SQLite docs

Redowan Delowar has collected 16 examples of handling SQLite with Python, from executing ordinary statements to dumping the database and using full-text search.

Executing one statement within another

You probably haven't heard of this, but SQLite transactions are deferred by default (transaction does not actually start until the database is first accessed). A deferred transaction can start as 'read' and later upgrade to 'write'.

In contrast to 'deferred' transactions there are also 'immediate' ones. Immediate causes the database to start a new write immediately, without waiting for a write statement.

This forum thread explores a valid use case for immediate transactions, and their limitations.

Temporary Tables in Triggers

Triggers in any schema other than temp may only access objects in their own schema. However, triggers in temp may access any object by name, even cross-schema.

This forum thread describes a clever way of utilizing this fact.

Faster user-defined functions in SQLite

Functions created with the define extension used to be quite slow. Frankly, 30x times slower than the built-in ones. Not anymore!

In addition, the define extension now includes the eval() function for executing dynamic SQL.

PocketBase: Open source backend built with Go+SQLite

Gani Georgiev has developed an open source Firebase / Supabase alternative in a single-file binary! Provides realtime subscriptions, user management, admin UI and REST-ish API.

sqlitescanner: Query SQLite data from DuckDB

DuckDB is an in-process SQL OLAP database management system ("SQLite for analytics" if you will).

The sqlitescanner extension allows DuckDB to directly read data from the SQLite database file. This is a great chance to try DuckDB on top of your existing databases!

That's all for now. See you next week!

22.37

1 year ago

Hello! Hope you are enjoying the week ツ Here is what's going on in the SQLite world lately:

How the SQLite virtual machine works

SQLite is unique among embedded databases in that it not only has a transactional, b-tree storage layer but it also includes a robust SQL execution engine. In this article, Ben Johnson dives into how SQLite parses, optimizes, & executes SQL queries.

User-Defined Functions in SQLite

SQLite does not directly support user-defined functions. Unless you use the define extension, which allows writing functions in regular SQL.

Parsing and generating URLs in SQLite

Alex Garcia made an SQLite extension for parsing and generating URLs and query strings.

Marmot: A distributed SQLite replicator

Distributed SQLite replicator by Zohaib Sibte Hassan. It enables multi-master replication of SQLite databases among multiple nodes. Marmot builds on standards like RAFT and CBOR, and uses triggers to store change logs that are replicated to peers.

Dense vector search in SQLite?

A clever trick of using CROSS JOIN to force a hand-picked plan.

UPSERT language feature

UPSERT causes the INSERT to behave as an UPDATE or a no-op if the INSERT violates a unique constraint. Non-standard SQL, but compatible with PostgreSQL and super-handy in everyday work.

How SQLite Is Tested

A look inside the rigorous SQLite testing process.

That's all for now. See you next week!