Hacker News new | ask | show | jobs
by e12e 1569 days ago
Is this:

  select value from json_each(readfile('names.json'))
Built in to (standard) sqlite? It's a little unclear from your comment?
1 comments

It seems readfile is from an extension but present in cli. json_each is present in standard sqlite core from 3.38.0 as json1 extension is also now part of core.

json_each : https://www.sqlite.org/json1.html#jeach

readfile : https://sqlite.org/cli.html#file_i_o_functions

> Note that the readfile(X) and writefile(X,Y) functions are extension functions and are not built into the core SQLite library. These routines are available as a loadable extension in the ext/misc/fileio.c source file in the SQLite source code repositories.

json1 being part of core is pretty big for me. I won’t have to build one anymore.