by xtreak29 · 4y ago · 0 comments
https://sqlite.org/forum/forumpost/567caa57234b98e46b885bcf8...
https://sqlite.org/forum/forumpost/f4b44e09cea20851014420a8b...
sqlite-utils is also a helpful project for various utilities : https://sqlite.org/forum/forumpost/ff5b6198eb6e794d2f774ce06...
I guess you are trying to do below from your comment.
$ echo '["Kate", "John", "Jim"]' > names.json
$ ./sqlite3
SQLite version 3.38.0 2022-02-22 18:58:40
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> create table users(id integer primary key, name text);
sqlite> insert into users(name) select value from json_each(readfile('names.json'));
sqlite> select * from users;
1|Kate
2|John
3|Jim select value from json_each(readfile('names.json'))
Built in to (standard) sqlite? It's a little unclear from your comment?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.