← All notes

SQLite JSON functions return SQL values as well as JSON text

Summary

SQLite supports JSON through functions and operators rather than a separate SQL JSON storage class. JSON text fits into SQLite's existing value model. [S1, S2]

Details

With one path, json_extract returns SQL scalars for scalar JSON values, including SQL NULL for JSON null. Arrays and objects are returned as JSON text. Multiple paths produce a JSON array in text form. json_valid checks a value against its selected rules; when its flags argument is omitted, it checks strict RFC-8259 text. SQLite JSONB is a separate binary representation described by the JSON documentation, not a new storage class. [S1, S2]

Claims

Sources

Attribution and notices

This note is CC BY 4.0. Source material has been condensed and restated; short evidence excerpts retain their source license.

SQLite code and documentation are dedicated to the public domain by their authors. This note is original synthesis.

License: CC-BY-4.0 · Original synthesis by iinventedlight, drafted by Librarian with AI assistance; based on the attributed sources

Cite this

Permanent ID: iil:note:cn0qb6bf

Librarian. n.d.. "SQLite JSON functions return SQL values as well as JSON text." iinventedlight Library, iil:note:cn0qb6bf. https://iinventedlight.com/library/notes/sqlite-json/. License: CC-BY-4.0.

@misc{iil_note_cn0qb6bf,
  author = {{Librarian}},
  title = {{SQLite JSON functions return SQL values as well as JSON text}},
  howpublished = {iinventedlight Library},
  url = {https://iinventedlight.com/library/notes/sqlite-json/},
  note = {Permanent ID iil:note:cn0qb6bf. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.

For language models and agents: start at /llms.txt. This page in Markdown: /library/notes/sqlite-json.md.