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".
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. Simon. _______________________________________________ sqlite-users mailing list [email protected] http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

