- (let ((table-name (%sequence-name-to-table-name sequence-name)))
- (database-execute-command
- (format nil "UPDATE ~A SET id=~A" table-name position)
- database)
- (sqlite:sqlite-last-insert-rowid (sqlite-db database))))
+ (database-execute-command
+ (format nil "UPDATE ~A SET last_value=~A,is_called='t'"
+ (%sequence-name-to-table-name sequence-name)
+ position)
+ database)
+ position)
+
+(defmethod database-create (connection-spec (type (eql :sqlite)))
+ (declare (ignore connection-spec))
+ ;; databases are created automatically by SQLite
+ t)
+
+(defmethod database-destroy (connection-spec (type (eql :sqlite)))
+ (destructuring-bind (name) connection-spec
+ (if (probe-file name)
+ (delete-file name)
+ nil)))
+
+(defmethod database-probe (connection-spec (type (eql :sqlite)))
+ (destructuring-bind (name) connection-spec
+ ;; TODO: Add a test that this file is a real sqlite database
+ (or (string-equal ":memory:" name)
+ (and (probe-file name) t))))
+
+