3 ms·
I can currently do this: sqlite> create table mydata (id integer, value1 integer, description text); sqlite> .separator "," sqlite> .import mydataf
by yummyfajitas 13y ago
I can currently do this:
sqlite> create table mydata (id integer, value1 integer, description text);
sqlite> .separator ","
sqlite> .import mydatafile.csv mydata
I assume textql is basically just running a similar SQL query, but perhaps autodetecting column types for you? (Haven't looked at the code.) Is that the value proposition, or does it do something more?
- twotwotwo 13y agohttps://github.com/dinedal/textql/blob/master/main.go https://github.com/dinedal/textql/blob/master/main.go around line 154: appears to make TEXT cols for everything. SQLite is pretty liberal about types so some math works anyway: sqlite> select "3"+"3"; 6 though note: sqlite> select "24" < 300; 0 sqlite> select "9" < "10"; 0 (see http://www.sqlite.org/datatype3.html http://www.sqlite.org/datatype3.html for more about SQLite typing.)
- rogerbinns 13y agoYour examples should be using single quotes for strings not double quotes. The latter are for quoting identifiers (eg if you named a table "select") and through an accident of SQLite history degrade to a string if no matching identifier is found. + is the SQL numeric addition operator. || is string concatenation. sqlite> select 3 || 3 ; 33 sqlite> select 'a'+'b' ; 0
- twotwotwo 13y agoInteresting, thanks.
- kamaal 13y ago>>I assume textql is basically just running a similar SQL query textql imports your data into SQLite. In other words its a import utility.
- theseoafs 13y agoThat capability is built into SQLite already -- it comes with an import utility. textql seems to just be a wrapper around this.
- dinedal 13y agoAuthor here: Key differences: - sqlite import demands an on disk db, textql will use an in memory db if it can, increases performance - sqlite import will not accept stdin, breaking unix pipes. textql will happily do so. I will make a note of this in the project readme, seems to crop up a lot.
- userbinator 13y agoIf your description column has any embedded commas in it that are escaped in quoted fields as per the CSV spec, it won't work whereas textql will.