SQLite api - why blob?
Posted: Sun Oct 04, 2009 3:37 pm
The standard sqlite library sends newLISP strings to SQLite as blobs, while in SQLite the column might have been defined as containing text. This causes troubles.
E.g. I have a SQLite database with positions (see http://km.krot.org/pos.cgi for how it's used).
I do a select from command line:
Then I try the same from newLISP:
It returns
Now I do a small change:
Running the query again returns
I load the hack in by default, but was wondering about the reason behind having to assume strings are blobs.
Or is it only me having this kind of issue?
Thanks.
Kirill
E.g. I have a SQLite database with positions (see http://km.krot.org/pos.cgi for how it's used).
I do a select from command line:
Code: Select all
$ echo 'select timestamp from gps_data where message="newLISP";' | sqlite3 pos-db3
1254562769
Code: Select all
(load "/usr/local/share/newlisp/modules/sqlite3.lsp")
(sql3:open "pos-db3")
(println (sql3:sql "SELECT timestamp FROM gps_data WHERE message=?" '("newLISP")))
Code: Select all
()
Code: Select all
(setf sql3:sqlite3_bind_blob sql3:sqlite3_bind_text)
Code: Select all
((1254562769))
Or is it only me having this kind of issue?
Thanks.
Kirill