4 ms·
It's discussed in the README: https://github.com/dinedal/textql#key-differences-between-textql-and-sqlite-importing https://github.com/dinedal/textql#key-differ
by TAForObvReasons 9y ago
It's discussed in the README: https://github.com/dinedal/textql#key-differences-between-textql-and-sqlite-importing https://github.com/dinedal/textql#key-differences-between-te...
> 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.
- codemac 9y ago#!/usr/bin/env rc row_headers='' output_mode=column fn usage { echo $0 usage echo -o <sqlite output mode> '#' which output mode to use echo -r '#' if present, output row headers echo -h '#' this message } while(~ $1 -*) { switch($1) { case -o output_mode=$2 shift case -r row_headers='.headers on' case -h usage exit 0 case * echo Bad args: $* usage exit 1 } shift } test $#* -ne 1 && echo Wrong number of arguments && usage && exit 1 sql_statement=$1 sqlite_bin='' { which sqlite > /dev/null >[2=1] && sqlite_bin=sqlite } || { which sqlite3 >/dev/null >[2=1] && sqlite_bin=sqlite3 } table_name=atable stdin_file=/proc/$pid/fd/0 { echo .mode csv echo .import $stdin_file $table_name echo $row_headers echo .mode $output_mode echo $sql_statement } | $sqlite_bin