- Columns are the union of all keys
- Every record is scanned and the full set of keys becomes the column list. A record missing a key gets NULL for that column, so records with differing shapes still produce valid statements with a consistent column list.
- JSON types map directly
- Numbers are written unquoted, true and false become boolean literals, strings are quoted with their single quotes doubled, and null becomes NULL. No inference is needed, which removes the main source of error in the CSV equivalent.
- Nested objects become JSON strings
- An object or array value is serialised to JSON text and inserted as a quoted string. That is usually what you want for a JSON or JSONB column in PostgreSQL, or a JSON column in MySQL, but if the target column is a scalar type, flatten the data first.
- Escaping and identifier quoting
- Single quotes in values are doubled, and identifier quoting follows the selected dialect: double quotes for PostgreSQL, backticks for MySQL, square brackets for SQL Server. Quote characters inside a table or column name are escaped by doubling too.