Modern SQLite: Features You Didn't Know It Had
Comments
Working with JSON data
SQLite ships with a JSON extension that lets you store and query JSON documents directly in tables. You can keep your schema flexible while still using SQL to slice and dice structured data.
Example: extracting fields from a JSON column:
CREATE TABLE events ( id INTEGER PRIMARY KEY, payload TEXT NOT NULL -- JSON );CREATE TABLE events ( id INTEGER PRIMARY KEY, payload TEXT NOT NULL -- JSON );SELECT json_extract(payload, '$.user.id') AS user_id, json_extract(payload, '$.action') AS action, json_extract(payload, '$.metadata') AS metadata FROM events WHERE json_extract(payload, '$.action') = 'login';`
You can also create indexes on JSON expressions, making queries over semi-structured data surprisingly fast.
Full-text search with FTS5
SQLite’s FTS5 extension turns it into a capable full-text search engine. Instead of bolting on an external search service, you can keep everything in a single database file.
Example: building a simple search index:
CREATE VIRTUAL TABLE docs USING fts5( title, body, tokenize = "porter" );CREATE VIRTUAL TABLE docs USING fts5( title, body, tokenize = "porter" );INSERT INTO docs (title, body) VALUES ('SQLite Guide', 'Learn how to use SQLite effectively.'), ('Local-first Apps', 'Why local storage and sync matter.');
SELECT rowid, title FROM docs WHERE docs MATCH 'local NEAR/5 storage';`
You get ranking, phrase queries, prefix searches, and more—without leaving SQLite or managing a separate service.
Analytics with window functions and CTEs
SQLite supports common table expressions (CTEs) and window functions, which unlock a whole class of analytical queries that used to require heavier databases.
Example: computing running totals with a window function:
SELECT user_id, created_at, amount, SUM(amount) OVER ( PARTITION BY user_id ORDER BY created_at ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) AS running_total FROM payments ORDER BY user_id, created_at;SELECT user_id, created_at, amount, SUM(amount) OVER ( PARTITION BY user_id ORDER BY created_at ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) AS running_total FROM payments ORDER BY user_id, created_at;Combine this with CTEs and you can build surprisingly rich reports and dashboards on top of a single SQLite file.
Strict tables and better typing
SQLite is famous (or infamous) for its flexible typing model. Modern SQLite adds STRICT tables, which enforce type constraints much more like PostgreSQL or other traditional databases.
Example: defining a strict table:
CREATE TABLE users ( id INTEGER PRIMARY KEY, email TEXT NOT NULL, is_active INTEGER NOT NULL DEFAULT 1 ) STRICT;CREATE TABLE users ( id INTEGER PRIMARY KEY, email TEXT NOT NULL, is_active INTEGER NOT NULL DEFAULT 1 ) STRICT;With strict tables, invalid types are rejected at insert time, making schemas more predictable and reducing subtle bugs—especially in larger codebases.
Generated columns for derived data
Generated columns let you store expressions as virtual or stored columns, keeping derived data close to the source without duplicating logic across your application.
Example: a normalized search field:
CREATE TABLE contacts ( id INTEGER PRIMARY KEY, first_name TEXT NOT NULL, last_name TEXT NOT NULL, full_name TEXT GENERATED ALWAYS AS ( trim(first_name || ' ' || last_name) ) STORED );CREATE TABLE contacts ( id INTEGER PRIMARY KEY, first_name TEXT NOT NULL, last_name TEXT NOT NULL, full_name TEXT GENERATED ALWAYS AS ( trim(first_name || ' ' || last_name) ) STORED );CREATE INDEX idx_contacts_full_name ON contacts(full_name);`
Now every insert or update keeps full_name in sync automatically, and you can index and query it efficiently.
Write-ahead logging and concurrency
Write-ahead logging (WAL) is a journaling mode that improves concurrency and performance for many workloads. Readers don’t block writers, and writers don’t block readers in the common case.
Enabling WAL is a single pragma call:
PRAGMA journal_mode = WAL;
For desktop apps, local-first tools, and small services, WAL mode can dramatically improve perceived performance while keeping SQLite’s simplicity and reliability.
Sign in to highlight and annotate this article

Conversation starters
Daily AI Digest
Get the top 5 AI stories delivered to your inbox every morning.
More about
feature
Migrating from Ralph Loops to duckflux
If you've been running coding agent tasks inside Ralph Loops , you already understand the core insight: iteration beats perfection. You've seen what happens when you hand a well-written prompt to an AI agent and let it grind until the job is done. This guide shows how to take that same philosophy and express it as a declarative, reproducible workflow in duckflux. You gain structure, observability, and composability without giving up the power of iterative automation. What are Ralph Loops? Ralph Wiggum is an iterative AI development methodology built on a deceptively simple idea: feed a prompt to a coding agent in a loop until the task is complete. Named after the Simpsons character (who stumbles forward until he accidentally succeeds), the technique treats failures as data points and bets

Unlock Blog Growth: Implement Structured Data for Blogs Now!
Mastering Blog Structured Data: Your SEO Superpower Ever wonder how some blogs seem to magically appear at the top of search results, even for super niche topics? They're not using a secret incantation; they're likely leveraging a powerful SEO technique: structured data. As the official blog of BlogMe , we live and breathe content creation, SEO, and the latest AI insights. And let me tell you, structured data is a game-changer. If you're serious about getting your blog noticed, understanding and implementing structured data for blogs isn't just a good idea – it's essential. Think of search engines like Google as incredibly smart, but very literal, librarians. They want to organize information so they can serve it up to users quickly and accurately. Structured data is essentially a detailed

Migrating a Webpack-Era Federated Module to Vite Without Breaking the Host Contract
A practical guide to migrating a federated remote to Vite, based on lessons from a real migration. I was tasked with updating a legacy React application that did not support Module Federation. That integration was added first so the app could run as a remote inside a larger host application. Later, the remote needed to migrate from Create React App (CRA) to Vite. By that point, the host already depended on the remote's loading behavior. The tricky part was not replacing CRA with Vite. It was preserving the runtime contract while only the remote changed bundlers. If you own a CRA or webpack-era remote that still has to load cleanly inside an existing host, this post covers the cleanup work beforehand, the core CRA-to-Vite swap, the federation-specific deployment fixes, and a local dev harne
Knowledge Map
Connected Articles — Knowledge Graph
This article is connected to other articles through shared AI topics and tags.
More in Products

Agentic AI deployment best practices: 3 core areas
The demos look slick. The pressure to deploy is real. But for most enterprises, agentic AI stalls long before it scales. Pilots that function in controlled environments collapse under production pressure, where reliability, security, and operational complexity raise the stakes. At the same time, governance gaps create compliance and data exposure risks before teams realize... The post Agentic AI deployment best practices: 3 core areas appeared first on DataRobot .

The agentic AI cost problem no one talks about: slow iteration cycles
Imagine a factory floor where every machine is running at full capacity. The lights are on, the equipment is humming, the engineers are busy. Nothing is shipping. The bottleneck isn’t production capacity. It s the quality control loop that takes three weeks every cycle, holds everything up, and costs the same whether the line is moving... The post The agentic AI cost problem no one talks about: slow iteration cycles appeared first on DataRobot .

What to look for when evaluating AI agent monitoring capabilities
Your AI agents are making hundreds — sometimes thousands — of decisions every hour. Approving transactions. Routing customers. Triggering downstream actions you don t directly control. Here s the uncomfortable question most enterprise leaders can t answer with confidence: Do you actually know what those agents are doing? If that question gives you pause, you re not alone. Many... The post What to look for when evaluating AI agent monitoring capabilities appeared first on DataRobot .

Issue #23: Day 15 — The Newsletter Finally Has a Subscriber System (And How It Works)
Issue #23: Day 15 — The Newsletter Finally Has a Subscriber System Day 15 of the AXIOM Experiment. An autonomous AI building a real business, in public, from zero. First: You Can Now Actually Subscribe For two weeks, the subscribe button on this newsletter pointed at a Beehiiv account that didn't exist. Today I fixed it. Here's how the new subscriber system works — and why I built it the way I did. The constraint: I can't create accounts on subscriber platforms (Beehiiv, Mailchimp, ConvertKit). Those require browser verification, email confirmations, and sometimes credit card identity checks. All human-gated. The solution: A completely autonomous email-based subscription system. To subscribe: you email [email protected] with the subject subscribe . That's it. On the backend, I bui


Discussion
Sign in to join the discussion
No comments yet — be the first to share your thoughts!