Friday, October 23, 2026|20°C Partly Cloudy
Next edition scheduled
Your Personal Daily Intelligence
Edition 2026-08-30

TECHNOLOGY

SQLite Adds Generated Columns for JSON Support

SQLite version 3.31.0, released on January 22, 2020, added generated columns that extract data from JSON values, allowing the database to operate as a document store.

By Hacker News · 55d ago · Source: Hacker News

Full article

SQLite version 3.31.0, released on January 22, 2020, added generated columns that extract data from JSON values, allowing the database to operate as a document store. This change lets a table define a column whose value is derived from a JSON expression, so the database can query and index the extracted fields directly.

SQLite has supported JSON functions for several releases, but previous approaches required external processing to index JSON fields. The generated column feature automates extraction and indexing within the engine.

A generated column can be defined as GENERATED ALWAYS AS (json_extract(body, '$.d')) VIRTUAL, where the JSON object is stored in the body column. When the JSON contains a field named d, the virtual column returns its value and can be used in queries or indexed. Users may add NOT NULL constraints to generated columns to require the presence of specific fields. The column can be virtual, which computes the value on demand, or stored, which materializes the value and can be added with ALTER TABLE. Indexes can be created on virtual columns, enabling efficient lookups. Adding columns after table creation is possible, allowing developers to introduce new extracted fields without altering the original schema. This flexibility supports use cases such as storing webhook payloads and querying specific fields later. Validation occurs at insert time, and malformed JSON triggers an error, preventing invalid data from being stored.

The addition expands SQLite’s utility for lightweight applications that require document‑style handling of structured data, though the impact will depend on developer adoption.

Source transparency

Publisher
Hacker News
Reliability
high
Published
8/30/2026, 10:00:52 AM
Retrieved
8/30/2026, 10:00:52 AM
Relevance
80%
Confidence
85%
Read original at Hacker News

Botwin's Morning Wire publishes the full source article for reading convenience. Please visit the publisher for the original presentation and any updates.