dinedal / textql

Execute SQL against structured text like CSV or TSV
MIT License
9.05k stars 300 forks source link

exit-status option? #116

Open abathur opened 5 years ago

abathur commented 5 years ago

Not urgent, but I was writing a query to check a CSV for duplicate rows and realized it might be nice to have a flag for returning an exit status. In my specific case an option to return a status for an empty result set would be fine.

A more-flexible implementation might be an option to create the table with a pre-supplied schema before trying to load the rows. In that case, I could add a schema that prohibits the duplicate rows, and (I imagine) the integrity errors would trigger to return an exit status as it already does for malformed queries.