Hacker News new | past | comments | ask | show | jobs | submit login

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 for more about SQLite typing.)



Your 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


Interesting, thanks.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: