Set default encoding for sqlite3 databases to utf-8 if unspecified
[clsql.git] / db-sqlite3 / sqlite3-api.lisp
index 196434d26b3574d0fcd8bf1b01da2b239b975551..942246e57a02ae40b34e1c41d1f20f6396b0ed89 100644 (file)
@@ -7,8 +7,6 @@
 ;;;; Authors:  Aurelio Bignoli
 ;;;; Created:  Oct 2004
 ;;;;
-;;;; $Id$
-;;;;
 ;;;; This file, part of CLSQL, is Copyright (c) 2004 by Aurelio Bignoli
 ;;;;
 ;;;; CLSQL users are granted the rights to distribute and use this software
 ;;;;
 ;;;; wrapper functions.
 ;;;;
-(defun sqlite3-open (db-name &optional (mode 0))
+(defun sqlite3-open (db &optional (mode 0)
+                     &aux (db-name (etypecase db
+                                     (pathname (namestring db))
+                                     (string db))))
   (declare (ignore mode) (type string db-name))
   (let ((dbp (allocate-foreign-object 'sqlite3-db)))
     (declare (type sqlite3-db-ptr-type dbp))