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?

Drew
  • 77,472
  • 10
  • 114
  • 243
yarrow
  • 31
  • 3

1 Answers1

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.

tarsius
  • 25,685
  • 4
  • 70
  • 109