|
|
|
|
|
by dinedal
1809 days ago
|
|
You can do this with https://github.com/dinedal/textql as well, and a little easier as you don't need to import the data explicitly. SQL_QUERY=<<-EOS
SELECT
category.name AS category,
composition.key,
composition.composer,
composition.name AS composition,
concert.name AS concert
FROM
category,
concert,
composition,
program
WHERE
julianday(concert.date) < julianday('now')
AND composition.category = category.name
AND program.key = composition.key
AND program.date = concert.date
ORDER BY
category.sequence,
composition.key
;
EOS
textql --header --dlm=tab --sql $SQL_QUERY category.tsv composition.tsv concert.tsv program.tsv
|
|
One nitpick with textql is that it says "sqlite import will not accept stdin, breaking unix pipes. textql will happily do so.", but that's not true, you just need to tell it to use stdin by doing:
I do this all the time for using gzip and sqlite to get compressed import with progress. For example filtering a compressed CSV from a SQL query with progress for import: