Skip to content
Back to skills

Sqlite Knowledge Patch

ASecurity

SQLite

  • 25 stars
  • 0 votes
  • 0 copies
  • 8 views
  • Added September 5, 2026
ai-agentsgoshellsqlexpressgitapidatabase

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 9 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add Nevaberry/nevaberry-plugins --skill sqlite-knowledge-patch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Sqlite Knowledge Patch?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Sqlite Knowledge Patch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nevaberry-sqlite-knowledge-patch-nevaberry-plugins/badge)](https://www.skillsdirectory.com/skills/nevaberry-sqlite-knowledge-patch-nevaberry-plugins)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: sqlite-knowledge-patch
description: SQLite
version: "3.54.1"
license: MIT
metadata:
  author: Nevaberry
---


# SQLite Compatibility Guidance

Load this skill when upgrading SQLite, maintaining SQL or CLI scripts, embedding
the C API, or working with JSONB, full-text search, sessions, and database storage.
The references retain the detailed conditions, examples, and historical behavior
needed for compatibility work. Start with the relevant topic below.

## Reference index

| Reference | Topics |
| --- | --- |
| [C APIs and Configuration](references/c-api-and-configuration.md) | Preparation, callbacks, authorizers, limits, text results, metadata, counters, page caches |
| [CLI, Builds, and Utilities](references/cli-build-and-utilities.md) | Script compatibility, output, dumps, prompts, replication, build options, Tcl |
| [Core Scalar Functions](references/core-scalar-functions.md) | Conditionals, collation, conversion, formatting, Unicode, dates, concatenation |
| [FTS5, Sessions, and Extensions](references/fts5-sessions-and-extensions.md) | Tokenizers, contentless tables, virtual tables, changesets, arrays, series, page inspection |
| [JSON and JSONB](references/json-and-jsonb.md) | Validation, JSON5, BLOB compatibility, labels, path edits, traversal, formatting |
| [SQL Language and Schema](references/sql-language-and-schema.md) | Constraints, triggers, parsing, query plans, statistics, expression indexes, legacy syntax |
| [Storage, Locking, and Correctness](references/storage-locking-and-correctness.md) | Timeouts, WAL, transactions, VFSes, OPFS, serialization, file compatibility, query fixes |

## Breaking changes and deprecations

### Release selection

SQLite withdrew 3.52.0 because some new features caused backward-compatibility
issues. All features planned for it moved to 3.53.0.

### CLI script and output changes

- End SQL statements with `;` in scripts that used a line containing only `go`
  or `/`. Build with `-DSQLITE_SHELL_LEGACY_COMMAND_TERMINATOR` to retain them.
- `.indexes PATTERN` matches index names. Scripts using table-name patterns may
  need to change them.
- Interactive sessions default to Unicode boxes; batch sessions retain the
  legacy default. Tabular modes right-align numeric values by default.
- Columnar modes default to `--titles always`, including empty results.
  Use `-titles on` for headers only on nonempty results, or `--rowcount on`
  to display the number of rows.
- Switching to `.mode line`, `.mode list`, `.mode column`, or `.mode tcl`
  restores that mode's default separators. Set a custom `.separator` afterward.
- The CLI disables double-quoted string literals by default from 3.41.0.
  Use single quotes, or the legacy settings documented in the CLI reference.
  From 3.45.0, replay of `.dump` output adjusts compatibility settings automatically.

### Dumps and file compatibility

The CLI escapes most control characters by default. `.dump` uses `unistr()` for
special characters; restoring those expressions requires SQLite 3.50.0 or later.
Set `--escape off` when producing a dump for an older SQLite version.

SQLite 3.50.0 can open OPFS SAHPool databases from earlier releases. Databases
created by the 3.50.0 or later SAHPool VFS require a VFS at least as new as 3.50.0.

SQLite 3.45.1 restored interpreting JSON-looking BLOBs as text when they cannot
be interpreted as JSONB. A BLOB can have different values under the two
interpretations; convert values known to contain legacy JSON text to `TEXT`.

### Replacements and platform requirements

| Existing interface or option | Compatibility guidance |
| --- | --- |
| `SQLITE_USE_STDIO_FOR_CONSOLE` | Removed; use `SQLITE_USE_W32_FOR_CONSOLE_IO` for Win32 console I/O in Windows command-line tools. |
| `sqlite3_analyzer` | Deprecated; the optional `diskused()` extension reports space use, and the CLI exposes it as `.diskused`. |
| `PRAGMA legacy_file_format` | A no-op from 3.31.0; use `SQLITE_DBCONFIG_LEGACY_FILE_FORMAT` with `sqlite3_db_config()`. |
| `sqlite3_pcache_methods` and `SQLITE_CONFIG_PCACHE` | Deprecated; use `sqlite3_pcache_methods2` and `SQLITE_CONFIG_PCACHE2`, with `SQLITE_CONFIG_GETPCACHE2` to retrieve configuration. |

Windows builds require Windows Vista or later, dropping Windows XP and Windows
CE support. Windows RT support was dropped in 3.53.0. Compile with
`-DSQLITE_UWP=1` for UWP and WebUI applications.

## SQL and schema quick reference

`ALTER TABLE` can add and remove `NOT NULL` and `CHECK` constraints on existing
tables. SQLite 3.54.0 rejects adding, dropping, or renaming columns with the
special names `ROWID`, `_ROWID_`, or `OID`.

```sql
CREATE TABLE readings (value REAL);
ALTER TABLE readings ALTER COLUMN value SET NOT NULL;
ALTER TABLE readings ALTER COLUMN value DROP NOT NULL;
```

`STRICT` tables enforce declared types on generated columns; a write can fail
if the generated expression produces an incompatible value. Column affinity
is applied before `CHECK` evaluation on `INSERT` and `UPDATE` from 3.32.0.

Run `REINDEX EXPRESSIONS;` to rebuild expression indexes. SQLite 3.53.0 also adds
self-healing for stale expression indexes. `PRAGMA optimize` automatically
analyzes tables lacking `sqlite_stat1` entries.

The planner can build automatic indexes for `WITHOUT ROWID` tables. For plans
with equal estimated cost, it chooses fewer bytes per row. Covering-index
reporting in `EXPLAIN QUERY PLAN` changed; verbatim plan-text tests can differ.

## Scalar functions and formatting

SQLite 3.48.0 adds two-argument `iif(test, value)` and the `if()` alias. From
3.49.0, both accept multiple test/value pairs and an optional fallback, using
short-circuit evaluation. No successful test and no fallback yields `NULL`.

```sql
SELECT iif(0, 'yes');                           -- NULL
SELECT if(0, 'first', 1, 'second', 'fallback'); -- second
```

Use `unistr()` to decode Unicode escapes and `unistr_quote()` to serialize a
value for generated SQL. For text with control characters such as U+0001,
`unistr_quote()` emits a `unistr()` expression. `%#q` and `%#Q` in `format()` or `sqlite3_mprintf()` escape
control characters in a form `unistr()` can decode. Built-in printf and SQL
`format()` support `%J` and `%j` for JSON string escaping.

Floating-point to text conversion rounds to 17 significant digits by default.
Use `SQLITE_DBCONFIG_FP_DIGITS` with `sqlite3_db_config()` to choose another
precision, such as the previous 15 digits.

`concat_ws()` retains empty strings, including surrounding separators, from
3.50.2. Aggregate `group_concat()` returns an empty string for a sole empty
input; a window frame with one empty string also produces an empty string.

`utc` and `localtime` leave values unchanged when SQLite already knows they are
in the requested time zone. Use `weekday -N` to shift backward to weekday `N`
and `end of month` to select the month's last day.

## JSON and JSONB quick reference

- Use `json_valid(X, 8)` to validate the full JSONB structure. Flag `4` checks
  only the outer wrapper; `jsonb(X)` can return a BLOB after checking only its
  outermost element.
- `json_valid(X, flags)` errors for flags outside `1` through `15` and returns
  SQL `NULL` if either argument is SQL `NULL`.
- `json_group_object()` skips rows whose label is SQL `NULL`. Duplicate label
  preservation in `json()` is undefined, though currently preserved;
  `json_object()` currently accepts duplicates. Ensure unique labels when
  output must behave consistently across versions.
- `json_insert()`, `json_replace()`, and `json_set()` apply edits left to right;
  a later path can refer to an object created by an earlier pair.
- `json_array_insert()` inserts at an array index and shifts subsequent
  elements. `jsonb_array_insert()` returns JSONB.
- `jsonb_each()` walks immediate children; `jsonb_tree()` walks recursively.
  Their `value` column returns JSONB blobs for arrays and objects, and usual
  SQL values for scalars.

## Full-text search, sessions, and extensions

Use `fts5_tokenizer_v2` for a locale-aware tokenizer and `locale=1` on FTS5
tables needing locale support. Set `contentless_unindexed=1` to persist
`UNINDEXED` values in a contentless FTS5 table.

For `xInstToken()` with prefix queries, enable token collection through the
table's `insttoken` setting or wrap one search expression in `fts5_insttoken()`.
An FTS5 table can be dropped even if its custom tokenizer is unavailable.

The session extension tracks tables with generated columns and `WITHOUT ROWID`
tables. `sqlite3changeset_apply_v3()` applies changesets;
`sqlite3changegroup_config()` configures a `sqlite3_changegroup`. To add one
change, call `sqlite3changegroup_change_begin()`, supply values through the
`sqlite3changegroup_change_*` setters, then call `sqlite3changegroup_change_finish()`.

The amalgamation includes carray and percentile, disabled by default. Compile
with `-DSQLITE_ENABLE_CARRAY` or `-DSQLITE_ENABLE_PERCENTILE` to enable each.
`sqlite3_carray_bind_v2()` binds a C array to the parameter passed to `carray()`.
`generate_series()` requires `START` from 3.37.0; predicates on `value` can bound
generated rows, including an upper bound when the call omits `stop`.

## C API and connection controls

Pass `SQLITE_PREPARE_DONT_LOG` to `sqlite3_prepare_v3()` to keep malformed SQL
out of the error log; its return code still reports preparation success.
Virtual tables can use `SQLITE_PREPARE_FROM_DDL` for SQL derived from the schema.
Long-running preparation can invoke progress handlers and respond to
`sqlite3_interrupt()` from 3.41.0.

`SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE`, `SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE`,
and `SQLITE_DBCONFIG_ENABLE_COMMENTS` default to enabled. Setting them to zero
respectively prevents creation through `ATTACH`, opens attachments read-only,
and disables SQL comments. Existing `sqlite_schema` comments remain accepted;
the comments setting still controls newly submitted SQL.

Use `SQLITE_LIMIT_PARSER_DEPTH`, `SQLITE_LIMIT_SCHEMA`, and
`SQLITE_LIMIT_TRIGGER_STEPS` with `sqlite3_limit()` for connection limits.
The lowest `SQLITE_LIMIT_LENGTH` is 30 bytes; the default maximum number of
SQL function arguments is 1000.

`sqlite3_str_truncate()` shortens a string builder in place. Use
`sqlite3_result_str()` to return a `sqlite3_str` result from a C-defined SQL
function. `sqlite3_incomplete()` detects unfinished SQL for continuation prompts.

## Locking, WAL, and browser storage

On builds supporting blocking locks, `sqlite3_setlk_timeout()` sets their
timeout independently of `sqlite3_busy_timeout()`. From 3.50.1, it also applies
when opening a snapshot transaction or waiting for another process's recovery.
From 3.50.2, setting it holds the database connection mutex.

Use `PRAGMA wal_checkpoint=NOOP;` or `SQLITE_CHECKPOINT_NOOP` with
`sqlite3_wal_checkpoint_v2()` to report WAL frames and checkpointed frames.
`SQLITE_DBSTATUS_TEMPBUF_SPILL` monitors temporary buffers spilling to disk;
`sqlite3_db_status64()` returns 64-bit counters, and the option also works with
`sqlite3_db_status()`.

The `opfs` VFS honors `mode=ro`. The `opfs-wl` VFS uses Web Locks for OPFS
locking; select `vfs=opfs-wl` on browsers providing `Atomics.waitAsync()`.

## CLI and build quick reference

Use `--ifexists` at startup or with `.open` to fail on a missing database path.
An argument naming a nonempty `.sql` or `.txt` file executes that file as a
script; it can contain SQL and dot-commands. `.timer once` times the next SQL
statement only. Set `--timeout S` on `.progress` to interrupt SQL after `S` seconds.

Canonical-source `configure` uses Autosetup; most targets build with a C compiler and
`make` or `nmake`. Tests and Tcl-dependent tools still require Tcl. The main
amalgamation-tarball `./configure` also uses Autosetup; deprecated `tea/` uses
Autotools. `make install` honors `DESTDIR` for staging from 3.47.1.

Files in this skill

  • SKILL.md8.4 KB
  • coverage.json1.3 KB
  • references/c-api-and-configuration.md2.7 KB
  • references/cli-build-and-utilities.md4 KB
  • references/core-scalar-functions.md5.6 KB
  • references/fts5-sessions-and-extensions.md1.5 KB
  • references/json-and-jsonb.md4.3 KB
  • references/sql-language-and-schema.md1.5 KB
  • references/storage-locking-and-correctness.md3.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.