Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion sqlite.asd
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
(:file "cache")
(:file "sqlite" :depends-on ("sqlite-ffi" "cache")))

:depends-on (:iterate :cffi)
:depends-on (:iterate :cffi :babel)

:in-order-to ((test-op (load-op sqlite-tests))))

(register-system-packages "babel" '(#:babel-encodings))

(defmethod perform ((o asdf:test-op) (c (eql (find-system :sqlite))))
(funcall (intern "RUN-ALL-SQLITE-TESTS" :sqlite-tests)))
5 changes: 3 additions & 2 deletions sqlite.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,9 @@ Supported types:
(double-float (sqlite-ffi:sqlite3-bind-double (handle statement) index value))
(real (sqlite-ffi:sqlite3-bind-double (handle statement) index (coerce value 'double-float)))
(string (sqlite-ffi:sqlite3-bind-text (handle statement) index value -1 (sqlite-ffi:destructor-transient)))
((vector (unsigned-byte 8)) (cffi:with-pointer-to-vector-data (ptr value)
(sqlite-ffi:sqlite3-bind-blob (handle statement) index ptr (length value) (sqlite-ffi:destructor-transient))))
((vector (unsigned-byte 8)) (babel-encodings:with-checked-simple-vector ((value value) (start (nth-value 1 (array-displacement value))) (end (length value)))
Comment thread
vindvaki marked this conversation as resolved.
Outdated
(cffi:with-pointer-to-vector-data (ptr value)
(sqlite-ffi:sqlite3-bind-blob (handle statement) index (cffi:inc-pointer ptr start) (length value) (sqlite-ffi:destructor-transient)))))
(vector (cffi:with-foreign-object (array :unsigned-char (length value))
(loop
for i from 0 below (length value)
Expand Down