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.
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.
- 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%

