noborus / trdsql

CLI tool that can execute SQL queries on CSV, LTSV, JSON, YAML and TBLN. Can output to various formats.
https://noborus.github.io/trdsql/
MIT License
1.96k stars 73 forks source link

Want to get Integer values from JSON data instead of exponential notation #151

Closed suzuki closed 3 years ago

suzuki commented 3 years ago

About

Version

% trdsql --version
trdsql version v0.8.0

CSV

data.csv

id,name
1000000,"foo"
1000001,"bar"

Result

% trdsql -icsv -ih "SELECT * FROM data.csv"
1000000,foo
1000001,bar

JSON

data.json

[
  {
    "id": 1000000,
    "name": "foo"
  },
  {
    "id": 1000001,
    "name": "bar"
  }
]

Result

 % trdsql -ijson "SELECT * FROM data.json"
1e+06,foo
1.000001e+06,bar
noborus commented 3 years ago

Thank you very much. This was wrong because trdsql has a policy of not doing extra conversions as much as possible.