In SQLite you can just do sqlite> .import myfile.csv mytable sqlite> select ... What does this tool give you that SQLite doesn't do out of the box?
From the README: Key differences between textql and sqlite importing sqlite import will not accept stdin, breaking unix pipes. textql will happily do so. textql supports quote escaped delimiters, sqlite does not. textql leverages the sqlite in memory database feature as much as possible and only touches disk if asked.
TextQL: Execute SQL Against CSV or TSV
11–20 of 95 posts
Re: TextQL: Execute SQL Against CSV or TSV
#12Re: TextQL: Execute SQL Against CSV or TSV
#13This looks very simple and easy to use. Are there any differences with using this instead of CSVKit? https://csvkit.readthedocs.io/en/1.0.3/ It includes a tool called csvsql. Example usage - csvsql --query "select name from data where age > 30" data.csv > new.csv
Re: TextQL: Execute SQL Against CSV or TSV
#14Earlier quoted context omitted.
From the README: Key differences between textql and sqlite importing sqlite import will not accept stdin, breaking unix pipes. textql will happily do so. textql supports quote escaped delimiters, sqlite does not. textql leverages the sqlite in memory database feature as much as possible and only touches disk if asked.
But it is SQLite under the covers? A better title then would be an SQLite wrapper for use in shell pipelines.
Re: TextQL: Execute SQL Against CSV or TSV
#15If you work with CSV a lot, then also check out xsv, "a command line program for indexing, slicing, analyzing, splitting and joining CSV files", from Andrew Gallant (burntsushi of Go and Rust fame): https://github.com/BurntSushi/xsv
Re: TextQL: Execute SQL Against CSV or TSV
#16This looks very simple and easy to use. Are there any differences with using this instead of CSVKit? https://csvkit.readthedocs.io/en/1.0.3/ It includes a tool called csvsql. Example usage - csvsql --query "select name from data where age > 30" data.csv > new.csv
https://pandas.pydata.org/pandas-docs/stable/comparison_with...
Re: TextQL: Execute SQL Against CSV or TSV
#17 CREATE EXTENSION file_fdw;
CREATE SERVER import FOREIGN DATA WRAPPER file_fdw;
CREATE FOREIGN TABLE foo (
col1 text,
col2 text,
...
) SERVER import
OPTIONS ( filename '/path/to/foo.csv', format 'csv' );
SELECT col1 FROM foo WHERE col2='x';Re: TextQL: Execute SQL Against CSV or TSV
#18Re: TextQL: Execute SQL Against CSV or TSV
#19PostgreSQL does this out of the box with : CREATE EXTENSION file_fdw; CREATE SERVER import FOREIGN DATA WRAPPER file_fdw; CREATE FOREIGN TABLE foo ( col1 text, col2 text, ... ) SERVER import OPTIONS ( filename '/path/to/foo.csv', format 'csv' ); SELECT col1 FROM foo WHERE col2='x';
Re: TextQL: Execute SQL Against CSV or TSV
#20Earlier quoted context omitted.
But it is SQLite under the covers? A better title then would be an SQLite wrapper for use in shell pipelines.
That's a silly complaint. It's a tool powered by SQLite. Under your extended definition, tools like web browsers (which use SQLite to power various things) would be SQLite wrappers.