What Changed in SQLite Recently, and Why Beginners Should Care

SQLite is the database many of us meet first: it is a single file, it needs no server, and it ships inside Python and most phones. It keeps improving quietly. This explainer covers a few changes from the last few years that affect what you see while learning, with the version where each arrived.

First, a word on versions

Every SQLite release has a number such as 3.45.1. The first number has been 3 for a very long time; the second number goes up with each feature release. You can see your version by running this in the sqlite3 command-line tool:

SELECT sqlite_version();

In Python, import sqlite3; print(sqlite3.sqlite_version) shows the version of the SQLite library your Python uses. That matters, because a tutorial may use a feature your copy does not have yet.

Change 1: STRICT tables (version 3.37.0, November 2021)

Traditionally SQLite is relaxed about types. If you declare a column as INTEGER and insert the text 'hello', SQLite stores it anyway. That surprises people coming from other databases.

Since version 3.37.0 you can ask for strict checking per table:

CREATE TABLE pets (
  id    INTEGER PRIMARY KEY,
  name  TEXT NOT NULL,
  age   INTEGER
) STRICT;

Now inserting 'hello' into age gives an error. For learners this is helpful: mistakes show up straight away instead of hiding in your data.

Change 2: JSON functions built in (version 3.38.0, February 2022)

SQLite has had JSON functions for years as an optional extension. From version 3.38.0 they are included by default. You can store a small JSON document in a text column and pull values out:

SELECT json_extract('{"name": "Rex", "age": 4}', '$.name');
-- Rex

This is handy for experiments, but a gentle warning: putting everything in JSON skips the lessons of tables and keys. Learn the relational way first; use JSON for genuinely flexible extras.

Change 3: the -> and ->> operators (also 3.38.0)

The same release added short operators borrowed from PostgreSQL and MySQL style. data ->> '$.name' returns the plain value. If you see these in a tutorial and get a syntax error, your SQLite is older than 3.38.0.

What this means for you

If a tutorial uses...You need at leastCheck with
STRICT at the end of CREATE TABLE3.37.0SELECT sqlite_version();
json_extract without loading an extension3.38.0same
->> on a JSON column3.38.0same

Where to read more

The SQLite project publishes a release history page listing every version and its changes. It is short, plainly written and a good first release log to practise reading. Our primer on how to read a release note shows what to look for.

The takeaway

Most of what you learn about tables, rows and queries has not changed in decades. Small features like STRICT tables simply make the learning smoother. When something in a tutorial does not work, check the version before assuming you made a mistake.

A free learning page for beginners. Practise on a test database, never on real customer data, and check the official documentation for your database version.

General commentary only: this page does not report specific news events and does not cite a survey or data source. Treat any trends described as unverified.

Related pages on this site