Closed ser1zw closed 1 year ago
I got errors below when trying 4.10. JSON sample in README.md.
README.md
$ cat sample2.json [ { "id": 1, "name": "Drolet", "attribute": { "country": "Maldives", "color": "burlywood" } }, { "id": 2, "name": "Shelly", "attribute": { "country": "Yemen", "color": "plum" } }, { "id": 3, "name": "Tuck", "attribute": { "country": "Mayotte", "color": "antiquewhite" } } ] $ trdsql -ijson "SELECT id, name, JSON_EXTRACT(attribute,'$country'), JSON_EXTRACT(attribute,'$color') FROM sample2.json"
Using SQLite3 driver:
2022/11/19 07:04:22 export: JSON path error near ''
Using MySQL driver:
2022/11/19 07:04:46 export: Error 3143 (42000): Invalid JSON path expression. The error is around character position 0.
The correct SQL is probably here.
$ trdsql -ijson "SELECT id, name, JSON_EXTRACT(attribute,'$.country'), JSON_EXTRACT(attribute,'$.color') FROM sample2.json" 1,Drolet,Maldives,burlywood 2,Shelly,Yemen,plum 3,Tuck,Mayotte,antiquewhite
Version:
$ trdsql --version trdsql version v0.10.1
Thank you! you are right.
I got errors below when trying 4.10. JSON sample in
README.md
.Using SQLite3 driver:
Using MySQL driver:
The correct SQL is probably here.
Version: