1

My sqlite database has columns which consist of TEXT objects containing spaces. I'm new to both emacs and programming, and while I want to use emacsql for reasons, it's crucial that I can select on string objects containing spaces.

e.g. (emacsql db [:select * :from table1 :where (= name "John Q Doe-Deer")]) doesn't work, and neither does 'John\ Q\ Doe-Deer: they both returned nil even though an analogous query works in command-line sqlite. What am I missing?

1

Any readable lisp value can be stored as a value in EmacSQL, including numbers, strings, symbols, lists, vectors, and closures. EmacSQL has no concept of "TEXT" values; it's all just lisp objects. The lisp object nil corresponds 1:1 with NULL in the database.

All values (except nil) are stored as text and then read back. So (a b) would be stored as "(a b)" and "John Q Doe-Deer" as "\"John Q Doe-Deer\"".

Also see https://github.com/skeeto/emacsql/issues/13.

  • I tried that, but it still didn't work. – yarrow Jan 31 '16 at 15:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.