allow pathnames as well as strings in sqlite3 connection specs
authorRyan Davis <ryan@acceleration.net>
Tue, 28 Aug 2012 18:13:40 +0000 (14:13 -0400)
committerRyan Davis <ryan@acceleration.net>
Tue, 28 Aug 2012 18:13:40 +0000 (14:13 -0400)
ChangeLog
db-sqlite3/sqlite3-api.lisp
doc/appendix.xml

index 6a081a8b9b9bf38c184c5c6a398a083d4406ec3e..bf623de5f1427452ba48976b0e1a1d9be577fc18 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-08-28  Ryan Davis <ryan@acceleration.net>
+       * db-sqlite3/sqlite3-api.lisp - allow pathnames in the connection
+       settings, so '("/db/my.sqlite") and '(#P"/db/my.sqlite") are
+       equivalent. Updated the docs to match.
+
 2012-08-17  Russ Tyndall  <russ@acceleration.net>
        * db-postgresql-socket3/package.lisp - shadow
        postgresql-notification for compatibility with new
index d5b515381baad428ad13afeaf821c2a530a74fba..942246e57a02ae40b34e1c41d1f20f6396b0ed89 100644 (file)
 ;;;;
 ;;;; 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))
index da94765270690e8b7576c0a34e5d5171ea373025..f06f035edfd4915831a7004018c66e278f0f6f46 100644 (file)
@@ -600,8 +600,8 @@ This file can contain forms to set site-specific paths as well as change
            <varlistentry>
              <term><parameter>filename</parameter></term>
              <listitem>
-               <para>String representing the filename of the &sqlite;
-               database file.</para>
+               <para>String or pathname representing the filename of
+               the &sqlite; database file.</para>
              </listitem>
            </varlistentry>
          </variablelist>