sincecutoff.com
← all changes

SQLite `printf()` and `format()` add JSON string literal conversions

Introduced 2026-10-09 · score 0.97

HOW TO USE IT

When rendering a JSON string literal with SQLite’s built-in formatter, use `%J` to include surrounding double quotes or `%j` to omit them when embedding within a larger JSON literal.

SELECT printf('%J', <value>);
SELECT printf('%j', <value>);
SELECT format('%J', <value>);

WHY THIS HELPS

Render a JSON string literal from SQL or built-in printf formatting.

REQUIREMENTS AND LIMITATIONS

  • Version: 3.54.0
  • %J (required): Substitution for a zero-terminated string; renders a JSON string literal with double quotes on both ends. A null pointer renders unquoted `null`.
  • %j (required): Substitution for a zero-terminated string; renders JSON string content without surrounding double quotes. A null pointer produces no output.
  • <value> (required): String argument substituted by `%J` or `%j`.
  • Prerequisite: Use SQLite 3.54.0 or later; `%j` and `%J` first appeared in 3.54.0.

FIRST-PARTY EVIDENCE

Check the installed version and the source before using it. Entry JSON

Report a problem with this card