Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
58 changes: 29 additions & 29 deletions sqlite-ffi.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -42,35 +42,35 @@
(use-foreign-library sqlite3-lib)

(defcenum error-code
(:OK 0)
(:ERROR 1)
(:INTERNAL 2)
(:PERM 3)
(:ABORT 4)
(:BUSY 5)
(:LOCKED 6)
(:NOMEM 7)
(:READONLY 8)
(:INTERRUPT 9)
(:IOERR 10)
(:CORRUPT 11)
(:NOTFOUND 12)
(:FULL 13)
(:CANTOPEN 14)
(:PROTOCOL 15)
(:EMPTY 16)
(:SCHEMA 17)
(:TOOBIG 18)
(:CONSTRAINT 19)
(:MISMATCH 20)
(:MISUSE 21)
(:NOLFS 22)
(:AUTH 23)
(:FORMAT 24)
(:RANGE 25)
(:NOTADB 26)
(:ROW 100)
(:DONE 101))
(:ok 0)
(:error 1)
(:internal 2)
(:perm 3)
(:abort 4)
(:busy 5)
(:locked 6)
(:nomem 7)
(:readonly 8)
(:interrupt 9)
(:ioerr 10)
(:corrupt 11)
(:notfound 12)
(:full 13)
(:cantopen 14)
(:protocol 15)
(:empty 16)
(:schema 17)
(:toobig 18)
(:constraint 19)
(:mismatch 20)
(:misuse 21)
(:nolfs 22)
(:auth 23)
(:format 24)
(:range 25)
(:notadb 26)
(:row 100)
(:done 101))

(defcstruct sqlite3)

Expand Down
2 changes: 1 addition & 1 deletion sqlite.asd
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
:in-order-to ((test-op (load-op sqlite-tests))))

(defmethod perform ((o asdf:test-op) (c (eql (find-system :sqlite))))
(funcall (intern "RUN-ALL-TESTS" :sqlite-tests)))
(funcall (intern (symbol-name '#:run-all-tests) :sqlite-tests)))
8 changes: 4 additions & 4 deletions sqlite.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
(not (eq (sqlite-error-code obj) :ok)))
(sqlite-error-message obj))
(format stream "~&Code ~A: ~A."
(or (sqlite-error-code obj) :OK)
(or (sqlite-error-code obj) :ok)
(or (sqlite-error-message obj) "no message")))
(when (sqlite-error-db-handle obj)
(format stream "~&Database: ~A"
Expand Down Expand Up @@ -460,7 +460,7 @@ See BIND-PARAMETER for the list of supported parameter types."
(progn ,@body)
(disconnect ,db))))

(defmacro-driver (FOR vars IN-SQLITE-QUERY query-expression ON-DATABASE db &optional WITH-PARAMETERS parameters)
(defmacro-driver (for vars in-sqlite-query query-expression on-database db &optional with-parameters parameters)
(let ((statement (gensym "STATEMENT-"))
(kwd (if generate 'generate 'for)))
`(progn (with ,statement = (prepare-statement ,db ,query-expression))
Expand All @@ -477,7 +477,7 @@ See BIND-PARAMETER for the list of supported parameter types."
(collect `(statement-column-value ,statement ,i))))
(terminate)))))))

(defmacro-driver (FOR vars IN-SQLITE-QUERY/NAMED query-expression ON-DATABASE db &optional WITH-PARAMETERS parameters)
(defmacro-driver (for vars in-sqlite-query/named query-expression on-database db &optional with-parameters parameters)
(let ((statement (gensym "STATEMENT-"))
(kwd (if generate 'generate 'for)))
`(progn (with ,statement = (prepare-statement ,db ,query-expression))
Expand All @@ -494,7 +494,7 @@ See BIND-PARAMETER for the list of supported parameter types."
(terminate)))))))


(defmacro-driver (FOR vars ON-SQLITE-STATEMENT statement)
(defmacro-driver (for vars on-sqlite-statement statement)
(let ((statement-var (gensym "STATEMENT-"))
(kwd (if generate 'generate 'for)))
`(progn (with ,statement-var = ,statement)
Expand Down