Is there even a need to embed it into sqlite itself? Since you're on the shell, and in keeping with the whole 'do one thing well' mandate: pipe it through jq instead.
Beautiful creature that jq... Regards. Brian P Curley On Jan 21, 2018 9:54 AM, "J Decker" <d3c...@gmail.com> wrote: > On Sat, Jan 20, 2018 at 9:54 PM, Simon Slavin <slav...@bigfraud.org> > wrote: > > > Feature request for the Shell Tool: ".mode json". > > > > Output should be as a JSON array of objects, with one object for each row > > of the table. Output should start with the "[" character and end with > > "]". Rows should be separated with ",\n". Quotes in strings should be > > escaped for JSON, with a leading backslash. NULL should be supported as > > the four lower-case characters "null", ignoring ".nullvalue". > > > Numbers should be unquoted. > > NaN, Infinity are not definable through JSON. > > > > The above setting should also affect the ".import filename [table]" > > command as described in section 8 of <https://sqlite.org/cli.html> . > > Columns should be created as necessary. Signed zeros should be imported > as > > zero. > > > > The above facilities should be implemented whether or not > > DSQLITE_ENABLE_JSON1 was enabled when compiling the shell tool. They are > > for export and import, not for handling JSON within SQLite. > > > > Implementation questions: > > > > I am not sure what the program should do if asked to import a value which > > is an array or object. Perhaps, for compatibility with the JSON1 > > extension, those should be imported as a string. > > > > I am not sure whether the program should respect the settings for > > ".separator" for JSON mode, either for output or .import. > > > > I am not sure how BLOBs should be handled, either for output or .import. > > > could be arrays of bytes. A reviver could covert it to UInt8Array when > used on javascript side. can't just use character strings; many > combinations of bytes are invalid unicode code points. > [0,1,2,255] > > > > > > Simon. > > _______________________________________________ > > sqlite-users mailing list > > sqlite-users@mailinglists.sqlite.org > > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > > > _______________________________________________ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users