github.com/pachyderm/pachyderm@v1.13.4/examples/redshift/json_to_sql/README.md (about) 1 # JSON to SQL 2 3 This directory contains a small go script that consumes single-layer .json files from stdin and outputs them as SQL INSERT statements. Each field in each record of the input is converted to a column name, and the value of that field is written to that column. 4 5 The binary takes a single argument: the name of the table that the data should be written to. For example: 6 7 ```shell 8 $ go build to_sql.go && cat test.json | ./to_sql cars 9 INSERT INTO cars (year, make, model) VALUES (2005, Toyota, Corolla); 10 INSERT INTO cars (model, year, make) VALUES (Civic, 1998, Honda); 11 INSERT INTO cars (make, model, year) VALUES (Tesla, Roadster, 2008); 12 INSERT INTO cars (make, model, year) VALUES (Bugatti, Chiron, 2016); 13 INSERT INTO cars (make, model, year) VALUES (Dodge, Viper, 2015); 14 ```