Closed AshwinJay closed 8 years ago
That's because it uses sqlite underneath and index is reserved word there.
@schmooser This is easily a fixable behavior by creating the table with double quoted column names. EG:
sqlite> create table tbl ("index" string);
sqlite> .tables
tbl
sqlite> insert into tbl ("index") values ('1');
sqlite> select * from tbl;
1
sqlite>
Of course this also requires a user to know that they need to double quote the column name in SQL as well, but at least the syntax error would no longer be an issue.
This has been fixed in the latest version:
$ cat data2.csv
id,name,index
1,John,a
2,Jacob,b
3,Jingleheimer,c
4,schmidt,d
$ textql -header -sql 'select [index] from data2' data2.csv
a
b
c
d
Hi, this is a nice utility you've built, thanks.
I just wanted to let you know that header columns with name like "index" throws:
2014/12/29 12:00:22 near "index": syntax error
I renamed it from "index" to "fooindex" and it worked!