Open simonw opened 2 years ago
Maybe something like this:
google-drive-to-sqlite download --db files.db \
--sql "select id from drive_files where mimeType = 'application/pdf'"
The --db
option there is a tiny bit inconsistent with other commands where the database is the first argument, but since download
is usually used without a database I think it makes sense.
The SQL query can return the following columns:
id
- the ID of the file to be processed output
- the path to save it to on disk, equivalent to the -o
optionI thought about also including format
to allow export
commands to use a different export format for each file, but this would conflict with the required first argument to that command.
I think just having --sql
but making it take two arguments - filename and query - would be better:
google-drive-to-sqlite download \
--sql files.db "select id from drive_files where mimeType = 'application/pdf'"
twitter-to-sqlite
has this: https://datasette.io/tools/twitter-to-sqlite#user-content-providing-input-from-a-sql-query-with---sql-and---attachSome kind of equivalent for the
download
andexport
commands would be neat.