+(defun encoding (db)
+ (when (typep db 'database)
+ (slot-value db 'encoding)))
+
+(defun (setf encoding) (encoding db)
+ (when (typep db 'database)
+ (setf (slot-value db 'encoding) encoding)
+ (when (eql (slot-value db 'state) :open)
+ (case (database-type db)
+ ;; FIXME: If database object is open then
+ ;; send command to SQL engine specifying the character
+ ;; encoding for the database
+ (:mysql
+ )
+ ((:postgresql :postgresql-socket)
+ )))))
+
+(defmacro with-database ((db-var connection-spec
+ &key make-default pool
+ (if-exists *connect-if-exists*)
+ (database-type *default-database-type*)
+ (encoding nil))
+ &body body)