branch: externals/triples commit 3593f55dfbbd750737c98bbcb8d21736a630cf24 Author: Andrew Hyatt <ahy...@gmail.com> Commit: Andrew Hyatt <ahy...@gmail.com>
Support numbers stored via emacsql. Although the triples columns are all TEXT type, emacsql was able to store raw numbers in them, not strings. This makes it possible to retrieve those numbers. --- triples.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/triples.el b/triples.el index ca42b023db..c003db4b86 100644 --- a/triples.el +++ b/triples.el @@ -116,10 +116,13 @@ one, because sqlite cannot handle symbols." This imitates the way emacsql returns items, with strings becoming either symbols, lists, or strings depending on whether the string itself is wrapped in quotes." - (if (and (string-prefix-p "\"" result) + (if (and (stringp result) + (string-prefix-p "\"" result) (string-suffix-p "\"" result)) (string-remove-suffix "\"" (string-remove-prefix "\"" result)) - (read result))) + (if (numberp result) + result + (read result)))) (defun triples--insert (db subject predicate object &optional properties) "Insert triple to DB: SUBJECT, PREDICATE, OBJECT with PROPERTIES.