I tried to play around with .import but it seems to limited with csv and delimited file. Is it possible to import gzip file ? or at least, pipe from command line ?
Also, could I skip some un-wanted column like mysql "LOAD DATA INFILE" ?
I tried to play around with .import but it seems to limited with csv and delimited file. Is it possible to import gzip file ? or at least, pipe from command line ?
Also, could I skip some un-wanted column like mysql "LOAD DATA INFILE" ?
You can create a named pipe. It will act like a normal file but decompress on the fly. SQLite will know nothing about it.
It turns out the example on wikipedia is with gzip. http://en.wikipedia.org/wiki/Named_pipe
You could write a parser for data that would convert it to a series of SQL statements. Perl is a good language for that. It can even handle gzip'd files.
Are you running this in a *Nix OS? If so, you could create a temporary file to hold the decompressed data:
tf="$(mktemp)" &&
zcat <my_records.csv.gz >"$tf"
sqlite3 /path/to/database.sqlite3 ".import $tf"
rm -f "$tf"